Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build web desktop web application without specifying RuntimeIdentifier. #357

Closed
NTaylorMullen opened this issue Nov 3, 2016 · 15 comments

Comments

@NTaylorMullen
Copy link
Contributor

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.

@dsplaisted
Copy link
Member

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.

@srivatsn
Copy link
Contributor

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

@tdekoekkoek
Copy link

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.

@nguerrera
Copy link
Contributor

@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?

@dsplaisted
Copy link
Member

@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.

@tdekoekkoek
Copy link

tdekoekkoek commented Jan 26, 2017 via email

@tdekoekkoek
Copy link

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

@tdekoekkoek
Copy link

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.

@tdekoekkoek
Copy link

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.

@dsplaisted
Copy link
Member

@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?

@tdekoekkoek
Copy link

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

@am11
Copy link
Member

am11 commented Mar 7, 2017

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

@nguerrera
Copy link
Contributor

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

@am11
Copy link
Member

am11 commented Mar 7, 2017

@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.

@nguerrera
Copy link
Contributor

That requirement was removed after RC4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants