Confusion over .Net interop

jbgroblerjbgrobler Member Posts: 18
edited 2014-07-22 in NAV Three Tier
Hi,

I have a C/AL procedure that instantiates a .Net assembly object and pass it some values from the current record. The assembly variable is set to run on the client side. It all works during testing, but I noticed something that I do not understand:

During development and testing I had the assembly on both the server and RTC add in folders. Since it is only called on the client I removed it from the server, but now I get an error that NAV could not create a instance of the assembly class...

Is there some kind of marshaling to the server going on even though the .Net variable is set to run client side?

Answers

  • ppavukppavuk Member Posts: 334
    I think it is because everything actually compiled on the server, and server just can't compile your object as assembly is not here. I had similar issue, and it has been solved after i've put assembly to server Addin folder.
  • jbgroblerjbgrobler Member Posts: 18
    But the object is already saved as compiled using the development environment. Is the server doing another behind-the-scenes compile once a client session connects?
  • ppavukppavuk Member Posts: 334
    I am not entirely sure how it works, but in my understanding when you compile an object it then create metadata (which is c# assembly), and then run it on server side. As assembly referencing to external dll (or .net assembly, or whatever else external) it fails on runtime (everything runs on server in my understanding) as assembly is not here. Again, it is just my view on this complex stuff. I believe MS guys know better - but not sure they are here to explain this to us :). Generally, i had some experience with external .net addins - they must be put to the server addin folder - it just does not works if they aren't here!
Sign In or Register to comment.