Interop problems "Access is denied"

  • Thread starter Thread starter Peter Reid
  • Start date Start date
P

Peter Reid

Hi

I've created an interop dll with the following commands:

tlbimp NegociosObjects.dll /keyfile:key.snk /out:NegociosObjectsInterop.dll
gacutil -i NegociosObjectsInterop.dll

Then, in a web part, i've tried to create an object of one of the classes in
the dll:

Dim obj
obj = CreateObject("NegociosObjects.XMLInterface");

This has always worked until recently (needed to reinstall the software that
provides the above dll). Now the web part just says that there is an error.
So, I decided to create an asp.net web application and reference the dll
directly. Now i'm getting an "Access is denied" error . I've checked the
permissions on the directory and they look ok, and i've tried running as
Administrator and my own user account, but still have the same problem.

Any ideas? Thanks.
 
Perhaps try giving full permissions to the interop.DLL in the .Net framework
configuration tool in Start --> Programs --> Administrative tools.

It looks like you are giving the interop.dll a strong name, so in the config
tool (at the machine level) setup a full trust for any code that has a
specific public key. The config tool will allow you load a public key from a
strongly named assembly.
 
Back
Top