开发者

ASP MVC 2 in Sharepoint 2007 Security Exception

I am trying to configure ASP MVC 2 Framework to run within a SharePoint 2007 install on IIS 6.0. I have managed to get the two web.config setups together, and made GAC and global.asax changes.

When I try to access the MVC application within the SharePoint domain (http://Sharepoint.com/MVCApp), I get a security exception.

**Source Error:** 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

**Stack Trace:** 

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.GetReferencedAssemblies() +14
   System.Web.Mvc.TypeCacheUtil.FilterTypesInAssemblies(IBuildManager buildManager, Predicate`1 predicate) +88
   System.Web.Mvc.TypeCacheUtil.GetFilteredTypesFromAssemblies(String cacheName, Predicate`1 predicate, IBuildManager buildManager) +65
   System.Web.Mvc.AreaRegistration.RegisterAllAreas(RouteCollection routes, IBuildManager buildManager, Object state) +80
   System.Web.Mvc.AreaRegistration.RegisterAllAreas(Object state) +55
   System.Web.Mvc.AreaRegistration.RegisterAllAreas() +7
   CapExRequest.MvcApplication.Application_Start() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CapExRequest\CapExRequest\Global.asax.cs:29

 --------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3614

I have trie开发者_开发知识库d adding permissions to the MachineName\ASPNET account for the \MVCApplication as suggested in one article. No joy.

Other occurences seem to be related to accessing a remote file share. There is no remote file share in my instance.

Any thoughts, suggestions, answers??


So, here is what the setup is, and the steps taken to get it all together...

  • Followed basic instructions for running an ASP.NET MVC application in SharePoint (see link below), but I put the custom MVCHttpApplication in it's own project and created a standalone assembly;

  • Updated SharePoint to include AJAX 3.5 (ours was only referencing 1.0 standalone);

  • Built a signed application and deployed to the virtual directory, including adding the application assembly in the GAC.

Actually pretty straight-forward so far. It just took a while to come to my senses.

"Using ASP>NET with Sharepoint Publishing" http://vspug.com/mbailey/files/2010/04/Using-ASP.NET-MVC-2-with-Sharepoint-Publishing.pdf

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜