An assembly specified in the application dependencies manifest (…) was not found

前端 未结 9 518
长发绾君心
长发绾君心 2020-12-23 16:38

I upgraded Microsoft.AspNetCore from 2.0.3 to 2.0.5 and my WebAPI project, although running successfully locally, fails to start in production (IIS). Everything was fine in

相关标签:
9条回答
  • 2020-12-23 17:05

    In most case you get that error because there's misalignment of versions.

    I changed the Microsoft.VisualStudio.Web.CodeGeneration.Design version, an it worked.

    Before

    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
    

    After

    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.4" />
    
    0 讨论(0)
  • 2020-12-23 17:07

    To solve the first half of the error message, An assembly specified in the application dependencies manifest (…) was not found be sure to always use the publish output when deploying to a target sever.

    For a self-contained application it can be found in

    bin\Release\netcoreapp2.0\win81-x64\publish
    

    or for framework-dependent deployments in

    bin\Release\netcoreapp2.0\publish
    

    The output in the directories above are meant to be used in development only, since they are specific to machine and user configuration built with.

    Taken from a related answer.

    0 讨论(0)
  • 2020-12-23 17:08

    Development machines usually have the SDK installed but on production the runtime only.

    Add the following to your .csproj file and publish again.

    <PropertyGroup>               
        <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
    </PropertyGroup>
    
    0 讨论(0)
提交回复
热议问题