SecurityAccess problem with .Net2.0 and COM

M

Michael.Drescher

Hi out there,

I get a SecurityPermission Exception when trying the following:

My local executable calls an Assembly (let's call it Remote.dll) that
resides on a mapped network drive. This assembly in turn calls a local
Assembly ("Local.dll"), which calls some unmanaged code (a COM Dll).
(Yes, this is somewhat complicated, but cannnot be changed for various
reasons).

When "Local.dll" tries to access the COM dll, I get a
SecurityPermission Exception. I tried to set the
"AllowPartiallyTrustedCallers" Attribute in the Local DLL, without
success.

When I move "Remote.dll" to my local system, everything works fine,
but that is not what we want. Also, when I change the .Net permissions
for the "Local Intranet" via the "Administrative Tools" to "Full
trust", it works fine, but again, this is not a solution for us, as
our final customers cannot do this (they haven't got VS Tools
installed). So I am looking for a solution within my code itself.

Anybody out there who can help me out?

I am working with .Net 2.0 SP1 on a Windows XP.
 
Q

qglyirnyfgfo

Hi Michael,

Long shot here, but what would happen if you decorate the method that
is giving you the error with the attribute below? This should go on a
method on the "Local.dll" assembly.

[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
Name = "FullTrust")]

Thanks.
 
M

Michael.Drescher

Hi Michael,

Long shot here, but what would happen if you decorate the method that
is giving you the error with the attribute below? This should go on a
method on the "Local.dll" assembly.

[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Assert,
Name = "FullTrust")]

Thanks.

Hi out there,
I get aSecurityPermissionException when trying the following:
My local executable calls an Assembly (let's call it Remote.dll) that
resides on a mapped network drive. This assembly in turn calls a local
Assembly ("Local.dll"), which calls some unmanaged code (a COM Dll).
(Yes, this is somewhat complicated, but cannnot be changed for various
reasons).
When "Local.dll" tries to access the COM dll, I get a
SecurityPermissionException. I tried to set the
"AllowPartiallyTrustedCallers" Attribute in the Local DLL, without
success.
When I move "Remote.dll" to my local system, everything works fine,
but that is not what we want. Also, when I change the .Net permissions
for the "Local Intranet" via the "Administrative Tools" to "Full
trust", it works fine, but again, this is not a solution for us, as
our final customers cannot do this (they haven't got VS Tools
installed). So I am looking for a solution within my code itself.
Anybody out there who can help me out?
I am working with .Net 2.0 SP1 on a Windows XP.



Hi,

thanks a lot, it works perfect, this is what I was looking for!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top