Thursday, March 8, 2012

Calling a .NET assembly

I have implemented a c#-dll and added it to the assembly cache.
My question is if there exists some other way of calling functions in it other than using a script task?

Using a script task works well, but I think it would be nicer if there was some sort of dll-task analoguos to the web service task.

Thanks for some comments!

No, there is no "Assembly Task". Not sure what such as task would give you really as there are so many variations.

I had considered one as a development, but I only see this as being worth the effort for a Transform, supporting limited single call methods.|||Ok, thanks Darren.

But "so many variations" ?
Don't know if I get what you mean, but aren't there just as many variations for a web service task?
|||Have you tried the WS task? It is not very flexible, no dynamic parameter support for example. That is what I mean. The WS task also has the advantage of avoiding constructors, and all methods are of course accessible through XMl therefore type conversions are already handled from string, if you went for native soap calls. This reduces the complexity of type conversion issues. Soap has addressed all the messy issues already, as well as imposing some limitations in itself.

Would you expect it to be limited to static methods? If not how would you define constructor parameters? How would you handle all the data types for methods dynamically? How would you access a dynamic list of input parameters when the task must define fixed properties up front? You cannot access a collection through expressions. What about ref and out parameters?

The signature of a method has a wide variety of options, and coping with all of these would be a lot of work.

It is all possible, albeit with some predefined constraints, but the value I see is limited when you can do all this and more with the script task. Not a viable component commercially in my opinion, and I only have so much time for freebies. Feel free to disagree though.|||Ok, thank you Darren... I can see more clearly now! =)
Yeah, I agree with you after reading your explanations. So thanks again!
|||We actually considered a ".Net Assembly" task. But, really, that's what the script task is.

No comments:

Post a Comment