By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,424 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,424 IT Pros & Developers. It's quick & easy.

SecurityAccess problem with .Net2.0 and COM

P: n/a
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.
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 27 Jun., 17:25, qglyirnyf...@mailinator.com wrote:
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.S ecurity.Permissions.SecurityAction.Assert,
Name = "FullTrust")]

Thanks.

On Jun 27, 7:23 am, Michael.Dresc...@odt-oce.com wrote:
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!!!
Jun 30 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.