MVC3 Deployment Dependency Problems

后端 未结 4 745
不知归路
不知归路 2020-12-05 17:27

I\'ve just tried deploying an MVC3 application to our IIS7 hosting environment but I\'m being presented wtih the following exception:

Could not load t

相关标签:
4条回答
  • 2020-12-05 18:06

    Make sure that the root web.config file on your server (located somewhere like here: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config) has the following entry:

    <configuration>
      <location allowOverride="true">
        <system.web>
          <fullTrustAssemblies>
            <add
              assemblyName="Microsoft.Web.Infrastructure"
              version="1.0.0.0"
              publicKey="[bunch of letters and numbers]"
            />
    

    If it's missing then it means that somebody messed with your .NET 4 installation.

    0 讨论(0)
  • 2020-12-05 18:15

    Microsoft.Web.Infrastructure is now a Nuget package, and it can be added to your project to enable bin directory deployments --

    http://nuget.org/packages/Microsoft.Web.Infrastructure

    0 讨论(0)
  • 2020-12-05 18:18

    It turns out after doing a Reference Cleaning, it removed Microsoft.Web.Infrastructure, but not from the packages.config file. After trying to add it again using the Package Manager Console, Visual Studio says that it is already installed which is false because it was removed.

    I then removed the line of code in the packages.config file

    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
    

    and ran the command again

    PM> Install-Package Microsoft.Web.Infrastructure
    

    After this, now it works fine.

    0 讨论(0)
  • 2020-12-05 18:27

    This is because Microsoft.Web.Infrastructure is not in your GAC. You need to add this reference to your project. Right click the reference and go to properties then set copy to local to true.

    Copy Local

    Output (Ignore the Ninject and NCU):

    alt text

    0 讨论(0)
提交回复
热议问题