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.

Can't publish netcoreapp1.0 if .NET/Mono not installed

See original GitHub issue

Steps to reproduce

If a project.json contains both netcoreapp1.0 and netXXX targets it is impossible to publish the netcoreapp1.0 target when .NET Framework/Mono is not installed on the machine.

e.g. with project.json like this: https://github.com/aspnet/cli-samples/blob/098f56c4f677e64f0ffbeca3b1a8cde68787f499/HelloMvc/project.json#L22-L30

MacOS (I changed net451 to net461 because I have Mono already installed):

XXXX:HelloMvc Administrator$ dotnet publish -f netcoreapp1.0
The current project is not valid because of the following errors:
/Users/Administrator/source/cli-samples/HelloMvc/project.json(30,15): error DOTNET1011: Framework not installed: .NETFramework,Version=v4.6.1 in

Fedora:

[XXXX@localhost HelloMvc]$ dotnet publish -f netcoreapp1.0
The current project is not valid because of the following errors:
/home/moozzyk/source/cli-samples/HelloMvc/project.json(30,15): error DOTNET1012: The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.

Windows (I changed net451 to net465 to get non-existing .NET Fx version - should it even restore?):

PS C:\Source\cli-samples\HelloMvc> dotnet publish -f netcoreapp1.0
The current project is not valid because of the following errors:
C:\Source\cli-samples\HelloMvc\project.json(30,15): error DOTNET1011: Framework not installed: .NETFramework,Version=v4.6.5 in

Expected behavior

When publishing for a specific framework other frameworks should be ignored

Actual behavior

Unable to publish

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003118)

Product Information:
 Version:            1.0.0-preview2-003118
 Commit SHA-1 hash:  7ada53d523

Runtime Environment:
 OS Name:     fedora
 OS Version:  23
 OS Platform: Linux
 RID:         fedora.23-x64
.NET Command Line Tools (1.0.0-preview2-003118)

Product Information:
 Version:            1.0.0-preview2-003118
 Commit SHA-1 hash:  7ada53d523

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mikehardercommented, Jun 23, 2016

I have the same issue on a machine with .NET 4.6, where the project.json targets both net451 and netcoreapp1.0. For dotnet build, it fails if I don’t specify the target framework, but it works if I specify -f netcoreapp1.0. However, dotnet publish fails even if I specify -f netcoreapp1.0.

0reactions
ddrinkacommented, Nov 30, 2016

I’ve posted a workaround for this issue in the duplicate issue dotnet/sdk#6473 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET Core vs Mono
NET Core code runs on .NET Core, and not on Mono. So mixing the two will be difficult. And since Mono is quite...
Read more >
NET application publishing overview
Applications you create with .NET can be published in two different modes, and the mode affects how a user runs your app.
Read more >
Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >
Self-contained .NET Core Applications
My app is a .NETCore.App, but it's not going to use the .NET Core platform that's installed. It'll use a local version so...
Read more >
.NET core vs .NET framework
NET Core is used to create server applications that run on Windows, Linux and Mac. It does not currently support creating desktop applications...
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