Could not load type '' (blank) when ref .NET assembly

CharlehCharleh Member Posts: 44
edited 2013-08-28 in NAV Three Tier
I've created an assembly that I want to be able to call from C/SIDE in the Role-Tailored Client in Dynamics NAV2013.

I've got this all working locally but when trying to deploy to the server I can't compile the codeunit that references the .NET assembly

I have a variable of type DotNet but when trying to choose a subtype I get this error:

Could not load type '' <-- nothing between the single quotes!

I've followed all steps in the MSDN guide (save exporting the types I want to use) I've got this working locally. I can actually get it running by installing the assembly into the GAC, but I don't want to have to do this when it should work otherwise

(the add in is also registered in the Client Add-in table and is strong-named with the correct public key token in the table)

These are the things I've tried:

* Building for .NET 4.5, 4 and 3.5 all of which worked locally but not on server
* Dropping the dll in the client and service add-ins folder
* Dropping the dll into windows/system32 folders
* Running everything as administrator (dev environment, service etc etc - I'm logged on as a domain administrator)
* Ripping clumps of my own hair out

All the assembly does is calls out to some webservices and a couple of other things, I just can't work out why I can't get it to work

I suspect it's permission related since installing to GAC seems to make it happy

Any ideas?

Thanks in advance
Charleh

Comments

  • wakestarwakestar Member Posts: 207
    depending on the environment ... sometimes DLL's get blocked when you copy files from here to there... ... security reasons... :whistle:

    however... check your dll wheter it is blocked ... look at the pic in this blog..
    http://zamboch.blogspot.ch/2011/02/jni4 ... lease.html


    Another way to find out the problem:

    Use the fusion log viewer... and see whats going on in the background...

    http://www.hanselman.com/blog/BackToBas ... rrors.aspx


    happy troubleshooting :mrgreen:
  • CharlehCharleh Member Posts: 44
    Ah nice one, that has fixed it - I forgot about this feature as I've seen issues with assembly loading before and discovered this was the cause!

    Easy to forget about all the security enhancements in newer versions of Windows Server

    Thanks!
    Charleh
  • wakestarwakestar Member Posts: 207
    you are welcome

    One of those great windows security features ](*,)
Sign In or Register to comment.