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.

Cannot build web desktop web application without specifying RuntimeIdentifier.

See original GitHub issue

You can repro this by doing the following:

  1. dotnet new -t web
  2. Convert the project to net451
  3. dotnet restore
  4. dotnet build

Here’s a project with 1 & 2 already done: Repro.zip

Once doing that you get:

Build FAILED.

       "C:\Users\nimullen\Documents\temp\web\src\web\web.csproj" (Build target) (1) ->
       "C:\Users\nimullen\Documents\temp\web\src\web\web.csproj" (Build target) (1:2) ->
       (CheckRuntimeIdentifier target) ->
         C:\Users\nimullen\.nuget\packages\microsoft.net.sdk\1.0.0-alpha-20161029-1\build\Microsoft.NET.RuntimeIdentifierInference.targets(45,5): error : RuntimeIdentifier must be set for .NETFramework executables. Consider RuntimeIdentifier=win7-x86 or RuntimeIdentifier=win7-x64. [C:\Users\nimullen\Documents\temp\web\src\web\web.csproj]

    0 Warning(s)
    1 Error(s)

This used to be possible in project.json land so I’d think it would be the same in msbuild land. If this issue happens to be “by design” then we’ll need to fix the CLI migration to specify a RuntimeIdentifier when migrating an executable desktop application.

/cc @livarcocc mostly for the last sentence.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
nguerreracommented, Mar 7, 2017

That requirement was removed after RC4.

1reaction
tdekoekkoekcommented, Jan 27, 2017

This is awful. I have no working environment now for over 24 hours. VS2017 gives me dozens of errors and I can’t get VS2015 to work any more. There must be a utility that allows us to see what versions are compatible. I have tried to use Core.EF and when I add that to my project it complains about incompatibility. And now nothing works. This is just awful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`RuntimeIdentifier` warning if self-contained is unspecified ...
NET SDK defaults the build, publish, and run outputs to be self-contained applications. The default without specifying a RuntimeIdentifier ...
Read more >
error NETSDK1031: It is not supported to build or publish a ...
I am running following command to publish .NET CORE 5.0 web api project using command line on windows 10 box. c:\test\Service>dotnet publish -c ......
Read more >
Mobile Applications Can't build in Blazor Maui Hybrid ...
I developed Maui Blazor Hybrid Application. Then, Desktop Application clearly works. But, Mobile doesn't work, It Generates the following ...
Read more >
Dotnet build linux. The answer you're looking for is basically
Dotnet build linux. The answer you're looking for is basically: To build your . Missing linux 64 folder. Build : 2d61d0b043915bc948ebf98836fefe9ba942be11.
Read more >
Publish a .NET Application | Office File API
Method 1 (Edit the project file). Specify the Runtime Identifier and set the PublishSingleFile option to true in your project file. xml.
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