WebPart permission issue when using Microsoft.Office.Project.Server.Library

  • Thread starter Termin_Terminator
  • Start date
T

Termin_Terminator

Hello everybody,

in my custom WebPart for Project 2007 Web Access I am using PSI web
services, and some of them need parameters coming from an external
library called "Microsoft.Office.Project.Server.Library".

An example are those two code lines:

using PSLibrary = Microsoft.Office.Project.Server.Library;
PSLibrary.Filter f = new
Microsoft.Office.Project.Server.Library.Filter();

This filter object is used in the ReadResources method of Resource web
service.
What happens is that I get a System.Security.SecurityException exactly
at the second code line.

Example:
System.Security.SecurityException: That assembly does not allow
partially trusted callers.
at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at MyNamespace.ConfigurationSettings.GetResourceData()
at MyNamespace.TestWebPart.OnInit(EventArgs e)
in C:\SharePoint\TestWebPart\TestWebPart.cs:line 147
The action that failed was: LinkDemand
The assembly or AppDomain that failed was:
TestWebPart, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=61f51e230a86efb2
The Zone of the assembly that failed was: MyComputer
The Url of the assembly that failed was:
file:///C:/Inetpub/wwwroot/wss/VirtualDirectories/80/bin/TestWebPart.DLL

While my own assemly TestWebPart.dll has the attribute
"AllowPartiallyTrustedCallers" and does of course not run with "full
trust", I am not allowed to use the
Microsoft.Office.Project.Server.Library because this library does not
allow calles from partially trusted callers like my WebPart.
For a long time I thought my assembly has been meant, but no it is
this Microsoft.Office.Project.Server.Library !

Because I may not run the final WebPart in "full trust" what
Permission do I have to assign to my WebPart in order to use that
Microsoft.Office.Project.Server.Library ? Thanks.

Bye

Termin_Terminator
 

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

Similar Threads


Top