question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet run looks for net451 reference assemblies when trying to run netcoreapp1.0

See original GitHub issue

Start 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ddrinkacommented, Nov 30, 2016

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:

root@2b4c894ee4a0:/usr/lib/mono/xbuild-frameworks/.NETFramework# ls
v2.0  v3.0  v3.5  v4.0  v4.5  v4.5.1  v4.5.2  v4.6  v4.6.1
0reactions
mattjohnsonpintcommented, Dec 20, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found