I am publishing ASP.NET Core 2 application and seeing the following error.
Error:
An assembly specified in the application dependencies manifest (MyApp.deps.js
This assembly was expected to be in the local runtime store
You are getting this error because you don't have the ASP.NET Core Runtime Store installed. You have two options to fix this.
Install the ASP.NET Core Runtime Store. It comes bundled with the .NET Core SDK, which is why installing the SDK fixed this. You can also install just the store, without the SDK, by downloading it here: https://www.microsoft.com/net/download/all.
Don't use runtime store trimming. You can disable the trimming by setting this property in your csproj file.
false
You can also pass this in on command line.
dotnet publish /property:PublishWithAspNetCoreTargetManifest=false
Update: June 25, 2018
This answer only applies to ASP.NET Core 2.0 projects. In ASP.NET Core 2.1, there is no runtime store anymore.