dotnet run looks for net451 reference assemblies when trying to run netcoreapp1.0
See original GitHub issueStart with an app that targets net451
and netcoreapp1.0
. Run dotnet restore
, followed by dotnet run -f netcoreapp1.0
.
Expected:
App runs with netcoreapp1.0
Actual: dotnet run fails with
The current project is not valid because of the following errors:
/home/release/test111/project.json(0,0): error DOTNET1012: The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.
Removing net451
from the project.json and re-running after restoring fixes this. Perhaps it should check for reference assemblies later on?
~/.dotnet/dotnet --info
.NET Command Line Tools (1.0.0-preview2-003119)
Product Information:
Version: 1.0.0-preview2-003119
Commit SHA-1 hash: 0708fe095e
Runtime Environment:
OS Name: centos
OS Version: 7
OS Platform: Linux
RID: centos.7-x64
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:8 (1 by maintainers)
Top Results From Across the Web
NET Core CLI running non-Core App, how does it work?
This is what it means to use net451 : that reference assemblies for .Net Framework 4.5.1 are used to compile the application. In...
Read more >Target frameworks in SDK-style projects - .NET
It's used to select the reference assemblies that your project compiles against, and to select assets from NuGet packages. Think of this version ......
Read more >MSB3644: The reference assemblies for 'version' were not ...
This error occurs when the .NET reference assemblies aren't found for the version of .NET that a project requests.
Read more >Build apps against Microsoft.NETFramework. ...
NET Framework, by default your application is built by using the reference assemblies that are included with that version's developer pack.
Read more >Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve found a simple workaround for this issue:
mkdir -p /usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5.1
There’s no need to actually install mono. Just create a folder for the .Net framework version you “need”, and publish using
-f netcoreapp1.0
. It will succeed.If you want to create a complete list of available frameworks, the Debian package xbuild-frameworks 4.6.2.7-0xamarin2 contains the following:
I am using Ubuntu, BTW, not OSX, and it specifically occurs during a
dotnet publish
, unless the directories exist.dotnet build
seems to work fine.