Microsoft.Web.Infrastructure,Version = 1.0.0.0无法在Windows 2012 64bit,MVC5上加载

Sum*_*pta 11 c# asp.net-mvc visual-studio-2012

我正在尝试在安装了Plesk的Windows 2012 64位操作系统上传一个简单的网站.我使用Visual Studio 2013的FTP发布来使用.NET 4.5在虚拟目录中上传站点.但是我得到了

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

基于StackOverflow或Search中的大量线程,建议每个人都在bin文件夹中上传文件.我做到了,我尝试了三次

  1. 任何CPU构建
  2. 64位构建
  3. x86Build

但我得到的只是错误.我正在使用来自本地主机提供商的共享主机,因此无法运行aspnet_regiis -i以确保.net 4.5配置正确与否,并且技术人员正在争论证明/显示.net4.5是否未安装或正常工作.

知道我应该能够运行什么以及如何运行它?

编辑:我的bin文件夹有这些文件:

System.Web.Webpages.Razor.dll
System.Web.Webpages.dll
System.Web.Webpages.Deployment.dll
System.Web.Razor.dll
System.Web.Mvc.dll
System.Web.Helpers.dll
System.Web.Extensions.dll
System.Web.Entity.dll
System.Web.DynamicData.dll
System.Web.dll
System.Web.ApplicationServices.dll
System.EnterpriseServices.dll
Microsoft.Web.Infrastructure.dll
Run Code Online (Sandbox Code Playgroud)

除了项目的DLL

编辑2:

从错误堆栈跟踪:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
   System.Web.WebPages.PreApplicationStartCode.Start() +0
   System.Web.Mvc.PreApplicationStartCode.Start() +32

[InvalidOperationException: The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +556
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9885060
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Run Code Online (Sandbox Code Playgroud)

Hig*_*hCs -1

文件已经准备好了,环境也准备好了。

如果应用程序池已配置为 Net4.5 Integrated,那么您应该一切顺利。

看起来您的配置可能有问题。

我建议您在本地IIS服务器上安装该应用程序并查看是否出现相同的错误。

我遇到了类似的问题,因为应用程序之前已从一个版本的 MVC 升级到另一个版本,这在项目文件和配置中留下了多个版本引用的痕迹。

应用程序在开发中运行良好,但在生产服务器上运行不佳。

在本地 IIS 服务器上安装(最好与托管提供商的版本相同)通常可以更轻松地解决问题。如果您让它在本地 IIS 上运行,您就可以了解如何在远程服务器上执行相同的操作。我希望您有远程 IIS 访问权限,这样可以更轻松地验证差异。