Run asp.net 4.0 app under SharePoint
I have an asp.net 2.0 user control library that runs within a SharePoint site. We upgraded one of the assemblies that this application depends on to .net 4.0 so we were forced to update the website to an asp.net 4.0 site so that it could use that assembly. That caused us to run into this开发者_运维知识库 error:
Could not find permission set named 'ASP.Net'.
Which is documented here: http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770151
and states:
"This error occurs because the ASP.NET 4 code access security (CAS) infrastructure looks for a permission set named ASP.Net. However, the partial trust configuration file that is referenced by WSS_Minimal does not contain any permission sets with that name."
Their proposed solution is don't attempt to use .net 4.0 which is not really an acceptable solution. So I'm trying to better understand what the actual problem. Our site is actually using a custom permission config based off of WSS_Minimal but it apparently includes the same reference. Can anyone tell me what file they are referring to when they say "the partial trust configuration file"? Where exactly does wss_Minimal reference this file? If the permission set named ASP.Net doesn't exist, I should be able to create my own permission set to take it's place. I'm not CAS expert but I haven't been able to find an ASP.Net permission set using the .net 2.0 configuration tool, and I'm not sure where it's being referenced in the wss_minimal config. Where is this ASP.Net permission set defined?
SharePoint 2010 is based on ASP.NET 3.5 and SharePoint 2007 is based on ASP.NET 2.0. So I'm guessing that you cannot do this (base your site .NET on 4.0).
I have been running a 4.0 App in a virtual directory in a MOSS 2007 site. I just installed Security Update for Microsoft Office SharePoint Server 2007 (KB2687405) 32-Bit Edition and BAM got the same error on the 4.0 App. Added
<trust level="Full" legacyCasModel="true" />
to web.config in the virtual directory and all's well.
You need to update Web.Config:
Set..
<trust level="WSS_Minimal"
As..
<trust level="Full"
精彩评论