Could not load file or assembly 'Microsoft.Web.Infrastructure,

后端 未结 20 2013
走了就别回头了
走了就别回头了 2020-12-09 00:57

I tried to upload my web site to a server. It was working fine with my local host, so I uploaded everything in my localhost wwwroot folder to the server and cha

相关标签:
20条回答
  • 2020-12-09 01:23

    I had a similar problem. NuGet showed the package successfully installed, but the reference was not added to my project.

    Running <PM> Install-Package Microsoft.Web.InfraStructure also didn't help as the package manager kept saying it's already installed

    I finally added it manually by editing the csproj file and adding these lines:

     <Reference Include="Microsoft.Web.Infrastructure">
      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
      <Private>True</Private>
    </Reference>
    

    That solved the problem.

    0 讨论(0)
  • 2020-12-09 01:24

    I don't know what happened with my project but it referenced the wrong path to the DLL. Nuget installed it properly and it was indeed on my file system along with the other packages but just referenced incorrectly.

    The packages folder exists two directories up from my project and it was only going up one by starting the path with ..\packages\. I changed the path to start with ..\..\packages\ and it fixed my problem.

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