Sdk: Cannot build web desktop web application without specifying RuntimeIdentifier.

Created on 4 Nov 2016  Â·  15Comments  Â·  Source: dotnet/sdk

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.

Bug Urgency-Soon release blocking

Most helpful comment

That requirement was removed after RC4.

All 15 comments

This seems the same as #396.

@srivatsn, I'd suggest closing this one in favor of #396, as #396 has more of the background information.

Alright all this means that we need to fix this soon :)

This is a huge mess. I have done a dotnet migrate (using VS 2017) and I get the Runtime identifier errors even though RIDs are already specified. So I cannot run my project in VS2017. What's worse, since migrating I can no longer run my project in VS2015 even when retrieving all project.json files back from source control. I have NO working solution in either project.json or msbuild.

@tdekoekkoek We're looking at the runtime identifier issue.

On not being able to use project.json in VS2015 any longer, that seems like a separate issue. @livarcocc @piotrpMSFT can you help diagnose that?

@tdekoekkoek Try adding a RuntimeIdentifier property to the .csproj in addition to the plural RuntimeIdentifiers

@nguerrera @livarcocc It sounds like dotnet migrate may be setting the plural RuntimeIdentifiers property but not the singular. We have #414 to fix this on the SDK side, if we don't do that we probably need migrate to be updated to account for this.

Well I've made some progress. First of it seems this should be singular: <
RuntimeIdentifier>

On Thu, Jan 26, 2017 at 11:03 AM, Nick Guerrera notifications@github.com
wrote:

@tdekoekkoek https://github.com/tdekoekkoek We're looking at the
runtime identifier issue.

On not being able to use project.json in VS2015 any longer, that seems
like a separate issue. @livarcocc https://github.com/livarcocc
@piotrpMSFT https://github.com/piotrpMSFT can you help diagnose that?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/sdk/issues/357#issuecomment-275427662, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABFUpTLYMWhBEKAJNR4OhYq_vrKMS04kks5rWMPjgaJpZM4KpCpp
.

--
Trevor de Koekkoek
http://sincere.ly/tdekoekkoek

ok so I should have both. It seems to work with just the singular though. Now I am getting typescript issues in my UI project that I didn't get with VS2015. Namely finding d.ts files. Perhaps the compilation is more exact than VS2015 and these errors were bipassed in 2015?
Severity Code Description Project File Line Suppression State
Error TS6053 Build:File xxx/node_modules/angular2-toaster/node_modules/typescript/lib/lib.es6.d.ts' not found

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.

How do I go back to no MSBuild? Ever since running migrate I cannot run my old project. I just want to go back to a working project with project.json until this is fixed.

@tdekoekkoek The migration process creates a backup copy of your project. We've also just released an update to the VS 2017 RC which may also help with some of the issues you're seeing if you want to give that a try.

@livarcocc @piotrpMSFT Is there documentation on how to revert a migration?

Is there anyway to uninstall the msbuild update? At least I was somewhat functional before that.

@dsplaisted, do we need to specify all possible RIDs for pure MSIL console apps? Can we have some kind of a wildcard or auto-inference like in the absence of RuntimeIdentifiers, consider it "select all"?

<!-- the goal is to avoid stamping this in every csproj for exe -->
<RuntimeIdentifiers>
  centos.7-x64; debian.8-x64; ol.7.0-x64; ol.7.1-x64; ol.7.2-x64; opensuse.13.2-x64;
  osx.10.10-x64; osx.10.11-x64; linuxmint.17-x64; linuxmint.17.1-x64; linuxmint.17.2-x64;
  linuxmint.17.3-x64; rhel.7.2-x64; ubuntu.14.04-x64; ubuntu.14.10-x64; ubuntu.15.04-x64;
  ubuntu.15.10-x64; ubuntu.16.04-x64; win7-x64; win7-x86
</RuntimeIdentifiers>

You do not need to specify any RuntimeIdentifiers in that case.

@nguerrera, sorry, it was singular <RuntimeIdentifier>win7-x64</RuntimeIdentifier>, which I had to set to be able to build on AppVeyor CI (in VS2017 RC worker image). That fails the build on TravisCI for Unix-like systems.
Without setting the property, although it builds on VS2015 & CLI RC4 box, but on AppVeyor it throws the same message as in the top post:

RuntimeIdentifier must be set for .NETFramework executables.

That requirement was removed after RC4.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dasMulli picture dasMulli  Â·  3Comments

moozzyk picture moozzyk  Â·  3Comments

krwq picture krwq  Â·  3Comments

noelitoa picture noelitoa  Â·  3Comments

thomaslevesque picture thomaslevesque  Â·  3Comments