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 #13542

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

Comments

@joellacas
Copy link

commented Aug 23, 2017

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

This comment has been minimized.

Copy link

commented Sep 7, 2017

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

@el2iot2

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Sep 14, 2017

^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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 15, 2017

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

This comment has been minimized.

Copy link

commented Nov 16, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 16, 2017

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

This comment has been minimized.

Copy link

commented Nov 16, 2017

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

@alexzaytsev-newsroomly

This comment has been minimized.

Copy link

commented Nov 17, 2017

@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

This comment has been minimized.

Copy link

commented Nov 17, 2017

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

This comment has been minimized.

Copy link

commented Nov 17, 2017

@cr41g1w

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 17, 2017

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

@cr41g1w

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 20, 2017

nuget doesn't install aspnetcore windows server hosting 2.0.3.

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

@mythz

This comment has been minimized.

Copy link

commented Nov 20, 2017

@doctorhilarius What do we need to do for Ubuntu?

@pravinpatil83

This comment has been minimized.

Copy link

commented Nov 21, 2017

Having the same problem on ubuntu

@niemyjski

This comment has been minimized.

Copy link

commented Nov 21, 2017

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

niemyjski added a commit to exceptionless/Exceptionless that referenced this issue Nov 21, 2017

@maroallegro

This comment has been minimized.

Copy link

commented Nov 22, 2017

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

This comment has been minimized.

Copy link

commented Nov 22, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Nov 22, 2017

@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

This comment has been minimized.

Copy link

commented Nov 22, 2017

@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

This comment has been minimized.

Copy link

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 ;)

@niemyjski

This comment has been minimized.

Copy link

commented Nov 24, 2017

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

This comment has been minimized.

Copy link

commented Nov 27, 2017

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

mmisztal1980 added a commit to OpenSmog-NET/os-smog-api that referenced this issue Nov 30, 2017

@MohanVijayakumar

This comment has been minimized.

Copy link

commented Dec 1, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Dec 15, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Jan 24, 2018

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

@alexandervantrijffel

This comment has been minimized.

Copy link

commented Jan 25, 2018

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

@RussKeldorph

This comment has been minimized.

Copy link
Member

commented Mar 17, 2018

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

@evil-shrike

This comment has been minimized.

Copy link

commented Mar 19, 2018

@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

This comment has been minimized.

Copy link
Member

commented Mar 19, 2018

@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

This comment has been minimized.

Copy link

commented May 7, 2018

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Oct 29, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.