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

published application is missing assembly (missing runtime store associated ...) [2.0.0-preview2-005905] #8213

Closed
tmds opened this issue May 4, 2017 · 47 comments
Milestone

Comments

@tmds
Copy link
Member

tmds commented May 4, 2017

Steps to reproduce

Using latest cli (2.0.0-preview2-005905)

mkdir mvc;cd mvc
dotnet new mvc
dotnet publish
dotnet bin/Debug/netcoreapp2.0/publish/mvc.dll

Expected behavior

Published application should run

Actual behavior


Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with manifest.linux-x64.xml -- package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.0-preview1-24647', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll'

Environment data

$ dotnet --info
.NET Command Line Tools (2.0.0-preview2-005905)

Product Information:
 Version:            2.0.0-preview2-005905
 Commit SHA-1 hash:  2cc5612fec

Runtime Environment:
 OS Name:     rhel
 OS Version:  7
 OS Platform: Linux
 RID:         rhel.7-x64

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-002093-00
  Build    : 1a195046fd92bd73d993d804bea2f4506c2b56f1
@eerhardt
Copy link
Member

eerhardt commented May 4, 2017

I can repro this as well.

It looks like the one that is in the store has a mis-matched version than the one trying to be used.

Error from the run:

Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with manifest.win-x64.xml;manifest.win-x86.xml;manifest.osx-x64.xml;manifest.linux-x64.xml -- package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.0-preview1-24801', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll'

Notice version: '2.0.0-preview1-24801'

My store contains:

image

@JunTaoLuo
Copy link
Contributor

The store has the no-timestamp versions, but the manifest seems to have timestamped versions. We need to be using the no-timestamp version of the Microsoft.AspNetCore.All version here \aspnetci\drops\Coherence-Signed\2.0.0-preview1\Latest\Signed\Packages-NoTimeStamp

@JunTaoLuo
Copy link
Contributor

Have the templates not been updated?

@mlorbetske
Copy link
Contributor

The cache being picked up has been converted to the timestamp versions since there is no feed with the preview1-final packages

@tmds
Copy link
Member Author

tmds commented May 4, 2017

When are packages downloaded to the "store"?
Can I still publish my app in a way they don't require certain packages to be present on the host's store?
Is there some documentation on the "store"?

@eerhardt
Copy link
Member

eerhardt commented May 4, 2017

When are packages downloaded to the "store"?

They are installed when you install the .NET Core SDK.

Can I still publish my app in a way they don't require certain packages to be present on the host's store?

Yes, set <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> in your .csproj

Is there some documentation on the "store"?

There's some work in progress:

dotnet/docs#1912

@eerhardt
Copy link
Member

eerhardt commented May 4, 2017

@livarcocc @mlorbetske - this still repos for me on

>dotnet --info
.NET Command Line Tools (2.0.0-preview1-005952)

Product Information:
 Version:            2.0.0-preview1-005952
 Commit SHA-1 hash:  356e309f17

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   F:\dotnet\sdk\2.0.0-preview1-005952\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002106-00
  Build    : 86fe9816c8ba782241c441c3228c665e393c3ef3

@eerhardt
Copy link
Member

eerhardt commented May 4, 2017

Which is the tip of dotnet/cli/release/2.0.0 right now

@livarcocc
Copy link
Contributor

Me and @mlorbetske have talked about this. We have a feed that we can use now and @mlorbetske will send a PR (soon) that will align the templates, the cache and the runtime store, which will fix this.

@mlorbetske any idea when we can expect this PR? Anything I can help with?

@mlorbetske
Copy link
Contributor

The PR is out dotnet/cli#6521

@tmds
Copy link
Member Author

tmds commented May 5, 2017

@eerhardt Thanks for explaining!

After reading the docs, I think a more generic way of saying 'don't assume stored packages' is to specify a --manifest parameter on publish and point that to an empty manifest file. Perhaps it makes sense to add a command line option that doesn't require creating an empty manifest file.

Where can I find the manifest file for ASP.NET projects?

@davidfowl
Copy link
Member

You can just set the msbuild property on the command line.

@tmds
Copy link
Member Author

tmds commented May 5, 2017

@davidfowl I added /p:TargetManifestFiles= and it works like a charm. Thanks! Do you know where the ASP.NET manifest is stored in git?

@davidfowl
Copy link
Member

The manifest is generated from the Microsoft.AspNetCore.All meta package https://github.com/aspnet/MetaPackages/tree/dev/src

@tmds
Copy link
Member Author

tmds commented May 5, 2017

Does the cli build process generate it? Or fetch it from somewhere?
Where does it end up under /opt/dotnet?

@davidfowl
Copy link
Member

Does the cli build process generate it?

There's a new dotnet cache command that creates it.

Where does it end up under /opt/dotnet?

https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/DotNetCore-SharedPackageStore.md

@tmds
Copy link
Member Author

tmds commented May 5, 2017

My daily cli doesn't have a dotnet cache or an /opt/dotnet/store. The doc doesn't mention where manifest files are stored.

We'd prefer to build the CLI and include the manifest file but not the packages themselves. This is to avoid shipping binary blobs we are not building. Is that feasible?

@tmds
Copy link
Member Author

tmds commented May 5, 2017

Was cache renamed to store?

@davidfowl
Copy link
Member

Yes, dotnet store my bad.

/cc @JunTaoLuo who is working on the runtime store for ASP.NET to answer those questions

@tmds
Copy link
Member Author

tmds commented May 5, 2017

Thanks @davidfowl , I'll check with him.

@livarcocc
Copy link
Contributor

This has been fixed now. Please, re-activate if you still run into issues.

@Jonathan34
Copy link

Jonathan34 commented May 22, 2017

I am confused by this issue. I started to see it too:

Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with manifest.win7-x64.xml;manifest.win7-x86.xml;manifest.osx-x64.xml;manifest.linux-x64.xml -- package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.0-preview1-final', path: 'lib/netcoreapp2.0/Microsoft.AspNetCore.Antiforgery.dll'

I am using the docker image dotnet:2.0-runtime to deploy for an asp.netcore 2.0 preview 1 final app.
I still do the regular dotnet restore/build/test/publish and then tries to deploy this to google cloud via docker (this is when it fails).
I do use the new <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview1-final" /> meta package in the csproj

could you please advise if anything is required to fix this?

@JunTaoLuo
Copy link
Contributor

@Jonathan34 you need to use the aspnetcore docker image @natemcmaster knows the exact version.

@natemcmaster
Copy link
Contributor

@Jonathan34 The microsoft/dotnet:2.0-runtime image does not include the ASP.NET Core runtime store. Either you need (1) use the ASP.NET Core image,

FROM microsoft/aspnetcore:2.0

or (2) disable runtime store trimming and bring ASP.NET Core into the microsoft/dotnet image yourself. You can disable runtime store trimming by adding this to your project:

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

cc @glennc

@igorkrug
Copy link

I had the same problem using
FROM microsoft/dotnet:2.0-runtime-deps

and importing version
2.0.0-preview1-002111-00

(1) solved the problem and I'm not using the import anymore
(2) I didn't try

@Jonathan34
Copy link

Jonathan34 commented May 22, 2017

Ok thanks. I was using dotnet image to easily set my own port and ASPNETCORE_URLS.
The aspnetcore image does not easily allow to set https with a custom port that google app engine requires (8080)

crit: Microsoft.AspNetCore.Server.Kestrel[0]
      Unable to start Kestrel.
System.InvalidOperationException: HTTPS endpoints can only be configured using KestrelServerOptions.Listen().
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.<BindAddressAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
...

will try to use .UseUrls("https://*:8080") instead

@Jonathan34
Copy link

Ok i actually have an issue with this change. Likely not related to cli though!

When i run my app locally, i set the ASPNETCORE_ENV to http://localhost:5000 using vscode tasks.
In the dockerfile, i used to set the following (notice http vs https):

EXPOSE 8080/tcp
ENV ASPNETCORE_URLS https://*:8080

This was good because I could control the port and http/https using environment variable only.
Now it seems i have to hardcode this value in Program.cs which i can't really do.
I deploy several services in docker containers that are listening on port 8080 (Google App Engine requirement). App Engine provide the https certificate automatically.
But when I run them locally, I override the env var and specify some custom port 5000, 5001...

How would you recommend i now handle this case using the aspnetcore 2.0 image.
The Kestrel ListenOptionsHttpsExtensions seem to require a certificate or a password which i do not have as it is managed by Google...

@natemcmaster
Copy link
Contributor

@Jonathan34 this has strayed off topic. Can you open a new issue on https://github.com/aspnet/KestrelHttpServer?

@Jonathan34
Copy link

doing it right now :)

@ivannaranjo
Copy link

Hello,
I work on the Google runtime images for App Engine Flex for .NET Core. Currently looking at the 2.0.0 images. Is there a way to control this cachine/store behavior that does not require the user to modify the .csproj? Or, are there official redist packages that we can use to pre-populate the cache ourselves as well?

@tmds
Copy link
Member Author

tmds commented May 24, 2017

@ahdung
Copy link

ahdung commented Sep 21, 2017

@livarcocc this issue still exists on dotnet core 2.0, please view my post https://github.com/dotnet/cli/issues/7680

@faGH
Copy link

faGH commented Sep 27, 2017

Still having this issue. Mine is with application insights.

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

@livarcocc
Copy link
Contributor

@faGH do you have the asp.net core runtime store installed in the machine where you are trying to run your app? That's is required because by default, ASP.NET Apps are published with a dependency on the runtime store.

cc @JunTaoLuo

@tonyranieri
Copy link

@livarcocc how do I install the asp.net core runtime store? I followed these instructions to install the .net core 2.0.0 runtime on Ubuntu: https://www.microsoft.com/net/download/linux

However I'm seeing this error when I run dotnet xxx.dll

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

I have another Ubuntu box where I've got the 2.0.0 SDK installed and the same code is working fine, but I'd prefer to not have the SDK installed here if possible...?

@livarcocc
Copy link
Contributor

@JunTaoLuo @leecow can you provide instructions on how to install the store separately?

@wessiyad if possible, you can just install the SDK, which will bring the store with it.

@leecow
Copy link
Member

leecow commented Oct 5, 2017

The aspnetcore-store-2.0.0 package should be available in all of the feeds (just confirmed the rpm and xenial feeds). sudo apt-get aspnetcore-store-2.0.0 on Ubuntu.

@JunTaoLuo
Copy link
Contributor

You can install the runtime store by itself on ubuntu via sudo apt get install aspnetcore-store-2.0.0. This part of our documentation is poor and we should update this somewhere.

However this isn't the expected mechanism for acquisition on Ubuntu. The runtime and runtime store are packaged into "Linux Server Hosting" installers with the package name dotnet-hosting-2.0.0. Those were built for 2.0.0 and should be on the official feeds but I can't seem to find them via apt get. Is there any reason they are missing @leecow ? This should also be documented.

@leecow
Copy link
Member

leecow commented Oct 5, 2017

Looks like an oversight on my part. Will need to add them to the release list.

@evil-shrike
Copy link

I encountered this issue when I published my app built for 2.0.3 onto a server with 2.0.0 only installed. Obviously it couldn't work and should fail but I believe error message could be a bit clearer.

C:\Apps\survey-core-dev>dotnet SurveyNetCore.dll
Error:
  An assembly specified in the application dependencies manifest (SurveyNetCore.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

And ideally as I was publishing the app via dotnet publish -c Debug /p:WebPublishMethod=MSDeploy it could tell me about missing dependencies.

@verysimplenick
Copy link

verysimplenick commented Dec 19, 2017

@evil-shrike same issue, found workaround without this?

  <PropertyGroup  Condition="'$(Configuration)' == 'Release'">
    <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
  </PropertyGroup>

In dockerfile:

FROM microsoft/aspnetcore

@evil-shrike
Copy link

@verysimplenick updating .net sdk to 2.0.3 solved the problem, but my comment was about the lack of diagnostic and bad dev experience.

@joaopgrassi
Copy link
Member

joaopgrassi commented Mar 27, 2018

There are so many issues open/closed on this so please point me if I'm supposed to ask about this somewhere else:

I have a fresh install centOS 7 box where I deployed our api. The API is targeting the latest sdk 2.1.101. As part of our deployment process via Octopus, we check if we need to install the sdk/runtime. Since we saw all these issues when installing only the runtime, we decided to go with installing the SDK instead.

Oddly enough, when I ran a deploy for this new machine, it failed starting the service with:

An assembly specified in the application dependencies manifest 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

So, listing the packages installed, I can see I don't have the store folder at /usr/share/dotnet. I have only dotnet host LICENSE.txt sdk shared ThirdPartyNotices.txt

Running dotnet --list shows me:

.NET Command Line Tools (2.1.101)

Product Information:
 Version:            2.1.101
 Commit SHA-1 hash:  6c22303bf0

Runtime Environment:
 OS Name:     centos
 OS Version:  7
 OS Platform: Linux
 RID:         centos.7-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.101/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.6
  Build    : 74b1c703813c8910df5b96f304b0f2b78cdf194d

I'm confused now. I thought installing the SDK would also install the runtime store thus preventing this issues. Can someone clarify, please?

@tmds
Copy link
Member Author

tmds commented Mar 27, 2018

@joaopgrassi if you are using dotnet packages that come with CentOS, those do not include the runtime store. For 2.0, the runtime store wasn't source buildable, so only Microsoft packages include the runtime store. In any case, you should be able to get your app running if you include the store packages with your app. This can be done by adding /p:PublishWithAspNetCoreTargetManifest=false to your dotnet publish command (or adding that property to the csproj file).

@joaopgrassi
Copy link
Member

joaopgrassi commented Mar 27, 2018

I see. But if I do that, then my artifact is way bigger.. which is not cool. But what I don't understand is we have several other linux vms and the store folder is there, and they were also installed via yum. The only difference is the other machines have also other versions installed. But I tried installing the 2.0.0 and 2.0.3 SDK's and that didn't work so.. not sure anymore.

@tmds
Copy link
Member Author

tmds commented Mar 27, 2018

Microsoft provides a feed which has these packages. Probably those vms use Microsoft packages.
2.1 should be cooler 😎

@joaopgrassi
Copy link
Member

Ah I see your point now, was a little confused. Sure, as part of our deploy script we add the microsoft feed as explained here . Then we just do yum install dotnet-sdk-{version}. The issue is that this package (from MS feeds) doesn't contain the runtime store.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests