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

dotnet examples arent self contained #1

Closed
ghost opened this issue Jan 4, 2020 · 1 comment
Closed

dotnet examples arent self contained #1

ghost opened this issue Jan 4, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 4, 2020

First go here:

https://dotnet.microsoft.com/download/dotnet-core/3.1

Download SDK Windows Binary x64, then extract. Then run:

dotnet new console -o sunday

Then take one of your example commands:

dotnet publish -r win-x64 -c Release /p:Mode=CoreRT sunday

this creates:

$ fd exe sunday -x wc -c
169984 sunday\bin\Release\netcoreapp3.1\win-x64\publish\sunday.exe
169984 sunday\bin\Release\netcoreapp3.1\win-x64\sunday.exe
169984 sunday\obj\Release\netcoreapp3.1\win-x64\sunday.exe

I dont know why it makes 3 of the same thing, but whatever. So if you try to run
one of them, you get:

A fatal error occurred. The required library hostfxr.dll could not be found.

So how is that self contained?

@MichalStrehovsky
Copy link
Owner

The Mode=CoreRT thing is defined in the project file in this repo. Vanilla dotnet new doesn't know about it and won't produce self-contained executable by default.

See here: https://github.com/MichalStrehovsky/SeeSharpSnake/blob/master/SeeSharpSnake.csproj

@ghost ghost closed this as completed Jan 5, 2020
This issue was closed.
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

1 participant