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

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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 54
  • Comments: 47 (9 by maintainers)

Commits related to this issue

Most upvoted comments

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.

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.

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

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.

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

I had to roll back to 2.0.0.

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…

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.

^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.

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.

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.

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.

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.

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

Having the same problem on ubuntu

@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?

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

@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" />

@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.

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.

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"]

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.

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

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

@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.

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

nuget doesn’t install aspnetcore windows server hosting 2.0.3.

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

@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.