- April
- 22
- 2008
.NET Framework 3.5 and Infopath compatibility issue
Posted by lovedjohnysmith
No Comments »
Itay has reported this issue and i had same issue with my development environment.
Request failed.
System.Security.SecurityException: Request failed.
at Microsoft.SharePoint.Administration.SPPersistedObject.ToString()
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
http://www.infopathdev.com/forums/p/7535/27677.aspxThe reason why this environment failed is due to Code Access Security. By default a DLL accessing the SharePoint OM will fail on the SharePoint side, unless you modify the given trust levels beyond their scope, create your own, or use the Full trust level. Another way around the problem would be to install the assembly into the GAC (C:Windowsassembly), which would require strongly naming the DLL. None of these options should be taken lightly, so be sure to dive into CAS before deciding to go with any of these paths. Also, you can look at CAS as it applies to InfoPath here: http://msdn2.microsoft.com/en-us/library/aa944687(VS.80).aspx. Finally, i digged into this problem and resolved by follow the below steps.To allow the form template's business logic to call this member when it is being debugged or previewed, you must set your form template's security level to Full Trust as described in the following procedure.
Configuring a Managed Code Form Template that Requires Full TrustSet your form's security level to Full Trust
- If you are working in InfoPath, open the form template in design mode.
If you are working in Visual Studio, open the InfoPath Form Template project, and then click the manifest.xsf [Design] tab to display the form designer.
- On the Tools menu, click Form Options.
- In the Category list, click Security and Trust.
- Under Security Level, clear Automatically determine security level.
- Select Full Trust, and then click OK.