C# Microsoft.Web.Infrastructure,版本=1.0.0.0无法在Windows 2012 64位MVC5上加载

C# Microsoft.Web.Infrastructure,版本=1.0.0.0无法在Windows 2012 64位MVC5上加载,c#,asp.net-mvc,visual-studio-2012,C#,Asp.net Mvc,Visual Studio 2012,我正在尝试在Windows 2012 64位操作系统上上传一个安装了Plesk的简单网站。我在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 depend

我正在尝试在Windows 2012 64位操作系统上上传一个安装了Plesk的简单网站。我在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.
基于StackOverflow或Search中的大量线程,建议每个人将文件上载到bin文件夹中。我做到了,我试了三次

  • 任何CPU构建
  • 64位构建
  • x86Build
  • 但我所得到的只是以上的错误。我正在使用本地主机提供商提供的共享主机,因此无法运行
    aspnet_regiis-I
    ,以确保.net 4.5配置正确与否,而tech正在论证/显示.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
    
    而不是项目的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
    

    文件已经存在,环境听起来已经准备好了

    如果已将应用程序池配置为Net4.5集成版,则您应全力以赴

    您的配置似乎有问题

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

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

    应用程序在开发环境中运行良好,但在生产服务器上运行不正常


    在本地IIS服务器上安装(最好与宿主提供商的版本相同)通常可以更容易地解决问题。如果您在本地IIS上运行了它,那么您已经准备好在远程服务器上执行相同的操作。我希望您可以远程访问IIS,这样可以更轻松地验证差异。

    这与您尝试安装软件包的情况类似,正如答案所示。您还可以下载dll并使用gacutil在GAC中手动安装它。exe@GearTrooper是的,我已经提到我在我的BIN文件夹中复制了这些文件,它们和所有其他文件都在那里,用于Razor和MVC。你真的应该检查一下,系统上是否安装了.NET 4.5。如果没有这个假设,你就不能说问题出在哪里。您能提供异常的堆栈跟踪吗?@VMAtm.NET 4.5已安装,如技术支持所述。我不确定它们是如何安装的,即。从服务器管理器或单独的安装程序。添加堆栈跟踪。您可以检查一下,您的应用程序所在的应用程序池是否使用了.NET4.5?您的应用程序可以位于默认应用程序池中,该池仍然可以配置为使用较低版本的.NET