2014-07-06 160 views
1

差不多相同scenario as before但这一次我需要将应用程序从.NET 4.5(MVC 4)升级到4.5.2(MVC 5.2)。我在Win 8机器上解决了上一个问题。它在Win 7上不起作用。 现在,执行相同的程序(在Win 8机器上),我再次遇到问题。从.NET 4.5 MVC 4升级到.NET 4.5.2 MVC 5.2

我已经followed the steps

  1. 升级后,所有项目框架4.5.2。
  2. 检查Microsoft.AspNet.WebHelpers卸载它,它不存在。
  3. 做了管理的NuGet包解决方案...一步,升级Microsoft.ASPNET MVC 5.2和Microsoft.ASPNET的Web API至2.2。
  4. 编辑所有Web.Config文件。
  5. 我试过最后的步骤(卸载项目...)但GUID已经消失。

该项目建立罚款,但是当我运行它,我得到一个服务器错误页:

Attempt by security transparent method 
'WebMatrix.WebData.PreApplicationStartCode.Start()' to access security 
critical method 'System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)' failed. 

我已经试过了我在网络上,但没有运气找到的所有解决方案。

由于目标版本4.5.2/5.2,我还需要做些什么吗?

UPDATE 1

移除WebMatrix.Data和WebMatric.WebData。现在我得到403.14错误。该请求命中Global.asax Application_PreRequestHandlerExecute方法,但它不会进入Application_Start。

+0

你实际使用WebMatrix吗?我之前已经将WebMatrix包添加到了我的项目中,但没有意识到它或者打算让它们在那里。 –

+0

是的,我有WeMatrix.Data和WebMatrix.WebData,我不使用WebMatrix。我删除了它们。现在,我收到HTTP错误403.14 - 禁止的错误。该请求根本不会触及Global.asax。 – user2178726

+0

你见过这个:http://stackoverflow.com/questions/11425574/mvc4-http-error-403-14-forbidden –

回答

1

我解决了它。我在项目中使用Fluent Validation,并没有将FluentValidation.MVC4更新为MVC5。