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 (appname.deps.json) was not found: package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1' #3215

Closed
ghost opened this issue Jun 10, 2018 · 16 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Comments

@ghost
Copy link

ghost commented Jun 10, 2018

I'm trying to run this brand new aspnet 2.1 app -- that I built -- on WIndows bash using .netcore 2.1. And I get the following error:

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

I do not have anything to do with ApplicationInsights. And I have not explicitly added it anywhere to my project. How can I get rid of it? Or is this references by the aspnet itself?

@ghost
Copy link
Author

ghost commented Jun 10, 2018

Seems to be a duplicate of https://github.com/dotnet/coreclr/issues/13542

@ghost ghost closed this as completed Jun 10, 2018
@ghost
Copy link
Author

ghost commented Jun 10, 2018

Actually no. the recommendation in the above link did not fix the issue.

@ghost ghost reopened this Jun 10, 2018
@vlmironoff
Copy link

vlmironoff commented Jun 16, 2018

I have the same issue.
I have installed Core SDK v2.1.300, Core Runtime v2.1.0 and Core Hosting Environment on the brand new target server (Windows Server 2012 R2).
Deploying my .Net Core v2.0 app (Microsoft.AspNetCore.All v2.0.8)

Figured temporary workaround - choose target runtime to anything else other than 'Portable' (win-x64 in my case):

image

This will inflate your app size however.
Microsoft, please double check the .Net Core SDK v2.1.300 and/or Core Runtime build for missing libs that should have been included.

@Kritner
Copy link

Kritner commented Jul 3, 2018

Having this issue as well on a console application with the following command:

dotnet publish -c Release

Target server dotnet --info:

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.1.301
 Commit:    59524873d6

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.3.9600
 OS Platform: Windows
 RID:         win81-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.301\

Host (useful for support):
  Version: 2.1.1
  Commit:  6985b9f684

.NET Core SDKs installed:
  2.1.301 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.All]
  Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
  Microsoft.NETCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

Getting the following error at runtime:

Error:
  An assembly specified in the application dependencies manifest (MyProject.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.xml

EDIT:

In our case, we were referencing the 2.0.0 metapackage of Microsoft.AspNetCore.All, which is seemingly packaged along with only the 2.0 SDK, updating to the latest meta package version of 2.1.1 fixed it for us.

@Eilon
Copy link
Member

Eilon commented Jul 13, 2018

@pakrym - any idea on this?

@warren-lockhart
Copy link

warren-lockhart commented Jul 20, 2018

I have a very similar issue on an Amazon EC2 running WIndows Server 2016, where if I do anything other than publish a self-contained app (i.e. with runtime win-x64) I receive an error. This is even the case when I deploy with false, and in this case the error is:

An assembly specified in the application dependencies manifest (XTag.API.deps.json) was not found:
package: 'System.Security.Cryptography.Cng', version: '4.5.0'
path: 'runtimes/win/lib/netcoreapp2.0/System.Security.Cryptography.Cng.dll'

I don't know why the deps.json has specified this runtimes path, since I can see this exact dll in the site root. The deps.json file is generated, so is there any way to force it to look in the local directory first?

It's possible that installing the sdk on the server will allow me to ship a smaller package, but I'm a bit confused as to why you would need to install an sdk when you're not doing any development on the server - why does the sdk give you dlls which the runtime doesn't?

Deploying a self contained app works, but it's very frustrating to be forced to deploy a much larger package just because somehow the dotnet core runtime on the Server is incomplete. Is there any clean solution for this, or do we have to wait for a later version of dotnet core for these bugs in common deployment scenarios to be fixed?

Just to emphasise, the publish command which works is:
dotnet publish proj.csproj -c Release -f netcoreapp2.0 -r win-x64 -o site

and the one which doesn't is:
dotnet publish proj.csproj -c Release -f netcoreapp2.0 -o site

Also note that I'm not doing anything specific with cryptography.

@mmulhearn
Copy link

I'm seeing this as well running ASP.NET Core 2.1. Running locally through IIS. I have two apps using the same nugets. One works fine, the other gives me this in my log file:

Error: An assembly specified in the application dependencies manifest (Users.Web.Api.deps.json) was not found: package: 'AutoMapper', version: '7.0.1' path: 'lib/netcoreapp2.0/AutoMapper.dll'

@alborozd
Copy link

My solution was to upgrade all project dependencies. It solved the problem in my case.

@dropsonic
Copy link

Have the same issue with Windows Server 2016 on AWS and a console app on .NET Core 2.0 / 2.2.
Tried to publish it for win-x64, but that didn't help.

@yanniskonstas
Copy link

yanniskonstas commented Feb 4, 2019

I'm trying to deploy to GCP and I get a similar error: (dotnet --version: 2.1.500)

Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
Error: An assembly specified in the application dependencies manifest (MY-APP-NAME.deps.json) was not found:
    package: 'AspNetCoreRateLimit', version: '2.1.0'
    path: 'lib/netstandard1.6/AspNetCoreRateLimit.dll'

My MY-APP-NAME.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web"> 
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>    
  </PropertyGroup>
  <ItemGroup>
    <Folder Include="wwwroot\"/>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App"/>
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All"/>
   ...
    <PackageReference Include="AspNetCoreRateLimit" Version="2.1.0"/>
   ...
  </ItemGroup>
</Project>

@Eilon
Copy link
Member

Eilon commented Feb 5, 2019

@pakrym / @pranavkm - any ideas on what might cause this or how to diagnose?

@pakrym
Copy link
Contributor

pakrym commented Feb 5, 2019

@Eilon I remember seeing similar issues a long time ago but can't remember the cause. csproj looks reasonable. Repro app would help to diagnose the issue here.

@y123321
Copy link

y123321 commented Mar 27, 2019

something that resembles that happened to me, there was another project (.net framework) in the solution and it was referenced by the .net core project. I've deleted the project from the solution, and after that I've started seeing this error when trying to publish. It was solved by re-adding the other project to the solution, referencing it again, removing the reference from the references window and only then deleting the project from the solution explorer. It appears that there is an issue with removing the referenced project from the manifests when dependencies are deleted. In a case of a nuget like application insights, I would try removing it using the nuget manager or the package manager console. Anyway, at least in my case it looks more like a bug in visual studio than a bug in .net core.

@tomRedox
Copy link

tomRedox commented May 21, 2019

I had this with an IIS deployment on a Windows Server 2016 VM after installing .NET Core 3 Preview and running my first Core 3 web app. After lots of IIS restarts and a huge amount of faffing with code (because I thought the issue was there) it finally occurred to me to restart the server, which then magically fixed it.

I could hear the words "have you tried turning it off and on again" ringing in my ears...

@stevebroshar
Copy link

Had similar error:
Error: An assembly specified in the application dependencies manifest (ISS.API.deps.json) was not found: package: 'System.Diagnostics.DiagnosticSource', version: '4.5.1' path: 'lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll'

Problem was due to a small change to dependencies in csproj file. That resulted in more files to deploy. Modified installer to include the new files.

@BrennanConroy
Copy link
Member

Closing as this issue is old and hasn't had any traffic.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

No branches or pull requests