DJA
Guest
|
Posted:
Tue Jan 18, 2005 8:46 am Post subject:
Re: Security Exception while using Excel COM object in web p |
|
|
Your webpart must have the correct Code Access Permissions. For this to
work the webpart requires at least the permission to call unmanaged
code. This is configured in the trust configuration file. If your
webpart is placed in the bin directory of the website, it will not have
this right as a default. Also note that when your webpart is in the bin
directory it is not granted full trust. If you call another assembly
like an Interop-assembly, the Interop-assembly must have the attribute
[assembly: AllowPartiallyTrustedCallers] set (remember the using
System.Security declaration) in the assemblyinfo file. This is because
your webpart is not fully trusted.
If you do not care about giving your webpart full trust. Your problems
would probably be solved by placing your webpart assembly in the GAC.
Remember to do an IISRESET after each deployment in GAC.
Find more information about Code Access Security in SPS here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/spptsdk/html/smpscCodeAccessSecurityDevs.asp
Regards,
Dan |
|