Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An assembly specified in the application dependencies manifest (RhWeb.deps.json) was not found #8792

Closed
joellacas opened this issue Aug 23, 2017 · 47 comments

Comments

@joellacas
Copy link

I got a weird error on IIS since I migrate my Asp.Net Core 1.1 to Asp.Net Core 2.0.
I publish with MSBuild interface.

I don't use ApplicationInsights.AspNetCore in my project....

Here is the error message.

Error:
  An assembly specified in the application dependencies manifest (RhWeb.deps.json) was not found:
    package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
    path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'

  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.0-linux-x64.xml;aspnetcore-store-2.0.0-osx-x64.xml;aspnetcore-store-2.0.0-win7-x64.xml;aspnetcore-store-2.0.0-win7-x86.xm
@rakeshchevuru
Copy link

HI... I am also having the same issue. Does anyone have a fix for this.

@el2iot2
Copy link

el2iot2 commented Sep 8, 2017

I also hit this. For me, it had to do with the use of

<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />

in my .csproj when running in an environment that had installed a dotnetcore 2.0 runtime, but not an SDK. See docs on implicit store.

The solution was adding the following to my .csproj:

<PropertyGroup>
  <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

Although it should be noted that installing the SDK also worked.

@helloserve
Copy link

^this.

I upgraded to Asp.Net Core 2.0 as well in this week, and I was trying to deploy to my Azure app service. I don't have the option to install the SDK there.

@siimhs
Copy link

siimhs commented Oct 12, 2017

I have arch linux (not officially supported).

dotnet new empty
dotnet publish -o ./published
dotnet published/<ProjectName>.dll
and that error is presented

but
...
//I added runtime identifier for linux
dotnet publish -o ./published -r linux-x64
dotnet published/<ProjectName>.dll
this works.

So perhaps try to specify runtime identifier when you publish your application.

@doctorhilarius
Copy link

I get these errors no matter what I do w/AspNetCore 2.0.3.

I had to roll back to 2.0.0.

@ctrl-brk
Copy link

Having similar issue after upgrading to 2.0.3 and publish to IIS. Was working in 2.0.0

 An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
    package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
    path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'

  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.3.xml

@cr41g1w
Copy link

cr41g1w commented Nov 16, 2017

@ctrl-brk I find that simply creating a new dotnetcore 2.0 mvc project in VS 2017 and then publishing to Azure results in this error when you try to run the app in Azure. Quite annoying as I did nothing but follow wizards. I did not find a solution yet, even after adding Microsoft.AspNetCore.Antiforgery via NuGet and republishing the project.

@doctorhilarius
Copy link

I figured out the issue--I needed to install aspnetcore web hosting 2.0.3.

dotnet restore installs aspnetcore 2.0.3, and we aren't doing standalone deployments, so the higher version couldn't find the libraries it needed.

@ctrl-brk
Copy link

@cr41g1w OMG. I should've think about it. Thank you.

@alexzaytsev-newsroomly
Copy link

@doctorhilarius what do you mean by I figured out the issue--I needed to install aspnetcore web hosting 2.0.3. I have this error in docker?

@kinosang
Copy link

with dotnet 2.0.3, I got the error after I deployed the app onto Azure Web Service. Adding <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> into the project file is dirty but useful, it can work as a charm.

@kinosang
Copy link

I found dotnet/aspnetcore#2254.

@cr41g1w
Copy link

cr41g1w commented Nov 17, 2017

The issue seems to be with using dotnet at the command line to create the project.

I originally created a dotnet core mvc project at the command line, then opened it in VS 2017 and published it to Azure. This did not run in Azure.

I just tried again but this time I used the VS 2017 wizard to create the project and published it to Azure. This project runs perfectly fine in Azure.

I will see if I can find the difference in these two projects as the output looks the same at first glance.

@Mcafee123
Copy link

Mcafee123 commented Nov 17, 2017

Hi, same problem here:

Error:
An assembly specified in the application dependencies manifest (src.deps.json) was not found:
package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'

switched from
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.**3**" />
to
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.**0**" />

Now it works without any other changes.

@riscie
Copy link

riscie commented Nov 17, 2017

@alexzaytsev-newsroomly He most likely means this: https://aka.ms/dotnetcore-2-windowshosting
It's a link from this article: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x (Install the .NET Core Windows Server Hosting bundle)

This will help you, if you run your own IIS Server.

@Mcafee123
Copy link

Mcafee123 commented Nov 17, 2017

sry, forgot to preview.... ;-)

@cr41g1w
Copy link

cr41g1w commented Nov 17, 2017

After a lot more messing about, it seems this dotnetcore 2.0 is very very buggy when you try to deploy to Azure. If you create a dotnet core 1.1 project in VS it will deploy and run perfectly. No matter how you create a 2.0 project, most of the time it will fail to run at all on Azure.

@mythz
Copy link

mythz commented Nov 20, 2017

Also started getting this error after upgrading Microsoft.AspNetCore.All to 2.0.3 as prompted by NuGet. The .NET Core 2.0 Web App ran locally but failed to run the published App on my Ubuntu server with:

deploy@Ubuntu-1604-xenial-64-minimal:~/client-tests$ dotnet Tests.Server.dll
Error:
  An assembly specified in the application dependencies manifest (Tests.Server.deps.json) was not found:
    package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.1'
    path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.dll'
  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.3.xml

The solution was to downgrade Microsoft.AspNetCore.All back to 2.0.0. Either this was not tested properly or we're supposed to manually upgrade Microsoft's NuGet packages on each deployed server everytime the meta Microsoft.AspNetCore.All package is updated? If so what command are we supposed to run as I don't see anything in dotnet --help.

@doctorhilarius
Copy link

nuget doesn't install aspnetcore windows server hosting 2.0.3.

that has to be installed with: https://aka.ms/dotnetcore-2-windowshosting

@mythz
Copy link

mythz commented Nov 20, 2017

@doctorhilarius What do we need to do for Ubuntu?

@pravin271
Copy link

Having the same problem on ubuntu

@niemyjski
Copy link

I'm also running into this while deploying to azure :\

@maroallegro
Copy link

I am also having same problem:
Error: An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found: package: 'Microsoft.Extensions.FileProviders.Embedded', version: '1.0.0' path: 'lib/netstandard1.0/Microsoft.Extensions.FileProviders.Embedded.dll'

Without success I:

  • added <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
    to my .csproj
  • downgraded .net core to 2.0.0
  • installed aspnetcore-store-2.0.0

can I install web-hosting package on ubuntu? if not what is the solution?

@DamianEdwards
Copy link
Member

The details for updating Linux servers running to run 2.0.3 are at https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.3.md#linux.

In short, you need to update the same components you installed to get 2.0.0 on to the box, whether it was the .NET Core SDK (apt-get install dotnet-sdk-2.0.3), .NET Core runtime (apt-get install dotnet-hosting-2.0.3), or manual TAR ball deployment.

@DamianEdwards
Copy link
Member

DamianEdwards commented Nov 22, 2017

A little further detail, this is the default behavior of the Microsoft.AspNetCore.All package, as documented at https://docs.microsoft.com/en-us/dotnet/core/deploying/runtime-store#aspnet-core-implicit-store

That package implicitly publishes your application without any of the ASP.NET Core assemblies, thus requiring that your server has them installed in the runtime store. You can disable this behavior if you wish but it will result in all of the ASP.NET Core runtime assemblies being deployed with your application, which is both quite large, and slower to start, as they assemblies won't be pre-JITed (CrossGen'ed).

It is not entirely dissimilar to installing an update to .NET Framework on your dev box, targeting your application to use it, then deploying it to a server that hasn't yet been updated to that version of .NET Framework. The app will fail to start as the required version of the framework is not there.

I appreciate this is more complicated than some might have expected, especially given they were offered an update to the package via NuGet and it works locally when you do this. We're currently investigating ways to simplify this in upcoming releases such that getting patches for ASP.NET Core when running on .NET Core will not require any project update at all, you'll simply need to install the patch release in all environments where you want it to be used.

Hope that helps.

@maroallegro
Copy link

@DamianEdwards I don't know do I understand you correctly.
This is what I done now:
-uninstalled .net core 2.0.0 (by i.e sudo apt-get purge --auto-remove dotnet-sdk-2.0.0) and other packages connected with that.
-installed .net core 2.0.3 by sudo apt-get install dotnet-sdk-2.0.3
-installed sudo apt-get install dotnet-hosting-2.0.3
-runned dotnet run in my project folder
-tried to run MyApp.dll from bin/Debug/netcoreapp2.0 by dotnet MyApp.dll
but still I am getting the same error.

@DamianEdwards
Copy link
Member

@maroallegro did you revert the changes to your project?

You shouldn't need to install both dotnet-sdk-2.0.3 and dotnet-hosting.2.0.3. Just install the one you need (usually SDK for dev box, hosting for server). Also you shouldn't need to uninstall the previous version.

Can you share your csproj file? Also, did you do a dotnet restore after the install of 2.0.3?

@maroallegro
Copy link

maroallegro commented Nov 22, 2017

@DamianEdwards This is my first test of this app on linux so this bug is not connected with any feature which I implemented, I didn't revert it if you mean reverting to previous version (using git).

I did dotnet restore now, but it didn't help.

Should i uninstall dotnet-hosting.2.0.3 and install dotnet-sdk-2.0.3 now?

Sure, here is my .csproj file

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  </PropertyGroup>
  
  <PropertyGroup>
    <CodeAnalysisRuleSet>../Solution.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
 
  <ItemGroup>
    <Compile Include="..\AssemblyVersion.cs" Link="Properties\AssemblyVersion.cs" />
  </ItemGroup>
  
  <ItemGroup>
    <PackageReference Include="log4net" Version="2.0.8" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
    <PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\MyApp.Configuration\MyApp.Configuration.csproj" />
    <ProjectReference Include="..\MyApp.Models\MyApp.Models.csproj" />
    <ProjectReference Include="..\MyApp.WebApi\MyApp.WebApi.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Update="AppConfig.Linux.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </None>
    <None Update="AppConfig.Windows.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </None>
    <None Update="appsettings.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
    <None Update="log4net.xml">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

</Project>

I also tried to run dotnet publish and got result

/usr/share/dotnet/sdk/2.0.3/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.Publish.targets(137,5): 

error MSB3030: Could not copy the file 

"/home/myname/.nuget/packages/microsoft.extensions.fileproviders.embedded/1.0.0/lib/netstandard1.0/Microsoft.Extensions.FileProviders.Embedded.dll" because it was not found. 

[/media/WindowsDir/AppFolder/MyApp/MyApp/MyApp.csproj]

UPDATE
I guess i found the issue
I checked whether file Microsoft.Extensions.FileProviders.Embedded.dll exist. And it exist but was created by root. So I run sudo dotnet publish --framework netcoreapp2.0 -o ./published
and runned dll by dotnet MyApp.dll and it worked.
Thanks a lot for your help ;)

@DamianEdwards
Copy link
Member

@maroallegro have you deployed (via dotnet publish) this application to any server before, including Windows? This is a slightly odd looking project layout, where you seem to be using a .NET Core console application that then references a web application (MyApp.WebApi.csproj). There is no use of Microsoft.AspNetCore.All here, so I'm not sure how you'd be affected by this issue.

@niemyjski
Copy link

An update. I resaved my environment variables in azure and redeployed the same code and it appears to be up and running now, but getting lots of errors with jobs. I'm thinking something could have been cached?

@niemyjski
Copy link

I spoke too soon, static landing page now loads but any other page errors out :... This is really annoying.

<div class="content-container"> 
<fieldset><h4>More Information:</h4> 
This error occurs when a CGI application does not return a valid set of HTTP headers, or when a proxy or gateway was unable to send the request to a parent gateway. You may need to get a network trace or contact the proxy server administrator, if it is not a CGI problem. 
<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=502,5,0x00000000,9200">View more information &raquo;</a></p> 
<p>Microsoft Knowledge Base Articles:</p> 

and

<div id="content"> 
<div class="content-container"> 
<h3>HTTP Error 502.5 - Bad Gateway</h3> 
<h4>The specified CGI application encountered an error and the server terminated the process.</h4> 
</div> 
<div class="content-container"> 
<fieldset><h4>Most likely causes:</h4> 
<ul> 	<li>The CGI application did not return a valid set of HTTP errors.</li> 	<li>A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.</li> </ul> 
</fieldset> 
</div> 
<div class="content-container"> 
<fieldset><h4>Things you can try:</h4> 
<ul> 	<li>Use DebugDiag to troubleshoot the CGI application.</li> 	<li>Determine if a proxy or gateway is responsible for this error.</li> </ul> 
</fieldset> 
</div> 

@DamianEdwards
Copy link
Member

@niemyjski check the event log (https://blogs.msdn.microsoft.com/benjaminperkins/2016/07/01/how-to-view-the-event-logs-of-your-azure-app-service/) to see if there's any more detail on what caused the ASP.NET Core IIS Module (ANCM) to crash. You should also enable ANCM logging to disk in the web.config to capture any console output that might provide clues (see https://docs.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module). You can also try running the application manually in the Kudu console to see if an error is displayed there.

@MohanVijayakumar
Copy link

Had a same problem on vm server debian 8.
.Net core sdk installed version was 2.0.2 . on server and published version from windows machine is 2.0.3
After doing apt-get install .net-sdk-2.0.3 on server my problem was solved

@onlyann
Copy link

onlyann commented Dec 5, 2017

Maybe the section how to use the Docker images should be updated with the instructions mentioned by @DamianEdwards

EDIT: I then discovered the Docker images for aspnet core and they work fine on 2.0.3

@onlyann
Copy link

onlyann commented Dec 6, 2017

Here's how I adapted the multi-stage build sample DockerFile for asp.net core 2.0.0.3.

# build dotnet core runtime image with dotnet-hosting-2.0.3. 
# required by aspnet core but doesn't get pulled by Microsoft.AspNetCore.All meta package
FROM microsoft/dotnet:runtime AS dotnet-runtime-aspnet
RUN apt-get update && apt-get install -y gnupg apt-transport-https
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
    mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg && \
    sh -c 'echo "deb https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/dotnetdev.list' && \
    apt-get update && apt-get install -y dotnet-hosting-2.0.3

FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app

# copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# build runtime image
FROM dotnet-runtime-aspnet
WORKDIR /app
COPY --from=build-env /app/out ./
ENTRYPOINT ["dotnet", "dotnetapp.dll"]
ENV ASPNETCORE_URLS http://*:5000
EXPOSE 5000

@bruno-garcia
Copy link
Member

It seems to me that this problem exists when the published application relies on a runtime store which is not available at the server it was deployed.
It can be solved by installing the .NET Core SDK or not relying on runtime store by setting PublishWithAspNetCoreTargetManifest to false or not using the '.All' metapackage.

What's unclear to me is if the hosting package alone should be enough or not. @DamianEdwards mentioned:

Just install the one you need (usually SDK for dev box, hosting for server). Also you shouldn't need to uninstall the previous version.

I have installed the dotnet-hosting-2.0.3-rhel.7-x64.rpm on CentOS using yum but the problem persists.
The docs for the ASP.NET Core implicit store actually say the SDK is required. There's no reference to installing the hosting package only.

Would it be correct to say that the only option now if using the metapackage is to install the SDK on the server?

@johnnyRose
Copy link
Contributor

johnnyRose commented Dec 19, 2017

I experienced this issue because my dotnet SDK version was behind the Microsoft.AspNetCore.All packages version. Making the versions match (either by reverting the package or upgrading the host SDK) fixed my problem. Simple/stupid mistake to make but hopefully it will help someone.

@alexandervantrijffel
Copy link

alexandervantrijffel commented Jan 22, 2018

I also had this error when using the dockerfile generated by Visual Studio.

With the docker file below my app is able to start with a nuget reference to Microsoft.AspNetCore.All version 2.0.3 and without the line <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>:

FROM microsoft/aspnetcore-build:2.0.3-stretch AS build-env
WORKDIR /app
COPY . ./
RUN dotnet build AppApi/AppApi.csproj -c Release -r linux-x64 
RUN dotnet publish AppApi/AppApi.csproj -c Release -r linux-x64 -o out

FROM microsoft/aspnetcore:2.0.3-stretch
RUN mkdir /app
WORKDIR /app
COPY --from=build-env /app/AppApi/out .
RUN mkdir /app/logfiles

ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
ENTRYPOINT ["/app/AppApi"]

@faliqulamin
Copy link

@alexandervantrijffel me too, do you have a fix for this?

@alexandervantrijffel
Copy link

@faliqulamin the first line wasn't visible in the dockerfile I posted, that is fixed now. You can try that one.

@RussKeldorph
Copy link
Contributor

If there is further discussion necessary on this, please track it at https://github.com/aspnet/Home or some place more appropriate.

@evil-shrike
Copy link

@RussKeldorph which issue do you suggest to track? Why this one is closed?

For me the issue is still having place when I build and run in Docker:

FROM microsoft/aspnetcore-build:2.0 AS build-env

for any project with reference:

    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />

@RussKeldorph
Copy link
Contributor

@evil-shrike I don't have another issue. I'm suggesting that this issue doesn't have anything to do with the .NET runtime so dotnet/coreclr is not the right place to track it. It seems to have more to do with ASP.NET or its SDK, so I recommend opening a new issue in an appropriate repo.

If I'm mistaken in my assessment, please accept my apologies.

@dcu-sharepoint
Copy link

el2iot2

thanks, your PropertyGroup xml code did it for me. I'm getting into docker and it showed me how to move on to the next phase and use the latest preview code from the insiders code.

Thanks again for sharing, awesome.

@opeca
Copy link

opeca commented Oct 2, 2018

Guys, I tried it, really, I wanted to use NET Core because of cross-platform possibility, but I fed up., This chaos with the references, cannot even revive a simple application on another windows machine for hours.
I use SDK 2.1.402 for dev on my windows machine, I installed Runtime 2.1.4 on the other I go trough to the official publish process and missing assemblies because of version differencies, publish folder contains the right ones but deps.json contains some /lib folders, totally confused, hundreds of dll's, dependency chains, too much for my simple mind.

Thank you, anyway...

@alborozd
Copy link

I upgraded all my dependencies in the project and it solved the problem.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
real-zony added a commit to real-zony/AliDDNSNet that referenced this issue May 12, 2020
@Dzivo
Copy link

Dzivo commented Dec 6, 2020

Error:
An assembly specified in the application dependencies manifest was not found:
package: 'Microsoft.OpenApi', version: '1.2.3'
path: 'lib/netstandard2.0/Microsoft.OpenApi.dll'

This happens when i deploy to azure app service .net 5

@dotnet dotnet locked as resolved and limited conversation to collaborators Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests