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 publish ubuntu-x64 standalone app on windows #5994

Closed
moozzyk opened this issue May 4, 2016 · 6 comments
Closed

Cannot publish ubuntu-x64 standalone app on windows #5994

moozzyk opened this issue May 4, 2016 · 6 comments

Comments

@moozzyk
Copy link
Contributor

moozzyk commented May 4, 2016

Steps to reproduce

  1. Restore packages
  2. PS C:\Source\cli-samples\HelloMvc> dotnet publish -r ubuntu-x64

HelloMVC with the following project.json

{
  "buildOptions": {
    "preserveCompilationContext": true,
    "emitEntryPoint": true,
    "debugType": "portable"
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views"
    ]
  },
  "dependencies": {
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
    "Microsoft.AspNetCore.Mvc": "1.0.0-*",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
    "Microsoft.Extensions.Logging.Console": "1.0.0-*",
    "Microsoft.NETCore.App": {
      "version": "1.0.0-*"
    }
  },
  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "portable-net45+wp80+win8+wpa81+dnxcore50",
        "portable-net451+win8"
      ]
    }
  },
  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-*",
      "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
    }
  },
  "scripts": {
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }, 

  "runtimes": { 
    "ubuntu-x64": {}
  }
}

Expected behavior

Publishing succeeds.

Actual behavior

PS C:\Source\cli-samples\HelloMvc> dotnet publish -r ubuntu-x64
Publishing HelloMvc for .NETCoreApp,Version=v1.0/ubuntu-x64
Project HelloMvc (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling HelloMvc for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:01.9402395
Failed to make the following project runnable: HelloMvc (.NETCoreApp,Version=v1.0) reason: Expected coreclr library not found in package graph. Please try running dotnet restore again.
Published 0/1 projects successfully

Environment data

dotnet --info output:

PS C:\Source\cli-samples\HelloMvc> dotnet --info
.NET Command Line Tools (1.0.0-rc2-002655)

Product Information:
 Version:     1.0.0-rc2-002655
 Commit Sha:  3e96a05f9c

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
@brthor
Copy link
Contributor

brthor commented May 4, 2016

@moozzyk This error was added so Standalone Apps published without coreclr throw an error prior to host activation.

This means libcoreclr.so is not present in your package graph, probably because ubuntu-x64 is not a rid we publish any runtime packages for (as far as I know).

Try it out with ubuntu.14.04-x64 ?

@TheRealPiotrP
Copy link
Contributor

Please re-open if this still fails with a good RID.

@moozzyk
Copy link
Contributor Author

moozzyk commented May 4, 2016

How am I supposed to know that I need to use exact RID? My runtime section looks just like this:

  "runtimes": { 
    "ubuntu-x64": {}
  }

so there is no version.

@moozzyk
Copy link
Contributor Author

moozzyk commented May 4, 2016

If I put ubuntu.14.04-x64 in my project.json and use this as the -r value then I don't get an error. Still the experience sucks - if I use a RID I cannot publish for in my project.json I should get an error/warning (possibly during restore).

@brthor
Copy link
Contributor

brthor commented May 5, 2016

How am I supposed to know that I need to use exact RID?

I think this is a documentation issue.

The issue here is that ubuntu-x64 is not necessarily a "wrong" rid and indeed individual packages can create their own custom rid graphs using runtime.json. So at restore time, there's not necessarily a way to say that your rid is wrong.

Even at build/publish time the best we can do for a Standalone app is make sure that whatever package graph exists for the rid you've selected contains coreclr.dll or it's xplat equivalent. If, for example, you had a package which declared that ubuntu-x64 imported ubuntu14.04-x64 (ordering might be backwards) then this should work just fine with ubuntu-x64.

@moozzyk
Copy link
Contributor Author

moozzyk commented May 5, 2016

That's OK. As long as it is documented it should be fine. The error message could and should be improved though.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants