core icon indicating copy to clipboard operation
core copied to clipboard

Unable to build standalone binaries with .NET Core 1.1 using csproj

Open mmaguigan opened this issue 9 years ago • 4 comments

So, I just installed Visual Studio 2017 and decided to make the leap to csproj files from project.json, ran a dotnet migrate on a project that used to produce standalone executables and now it produces DLL files.

Has this functionality been eliminated or am I missing something? This was a major factor in my ability to push adoption of CoreCLR.

mmaguigan avatar Dec 07 '16 01:12 mmaguigan

Here is a gist of the original project.json file and the migrated csproj.

mmaguigan avatar Dec 07 '16 01:12 mmaguigan

... and I feel rather silly. It did publish it, the output simply did not list it as having been published.

[root@a601d681038f grr]# dotnet publish -f netcoreapp1.0 -r centos.7-x64
Microsoft (R) Build Engine version 15.1.454.57113
Copyright (C) Microsoft Corporation. All rights reserved.

  grr -> /sandbox/grr/bin/Debug/netcoreapp1.0/grr.dll

mmaguigan avatar Dec 07 '16 01:12 mmaguigan

In project.json world, publishing a standalone app and a portable app were a development decision (type: platform in the project.json).

In msbuild, this is actually a deployment decision, meaning, that when you run dotnet publish, if you want to publish it as a standalone app, you just need to pass the --runtime flag to it indicating for which runtime you want to publish it for.

livarcocc avatar Dec 07 '16 01:12 livarcocc

I see, thank you @livarcocc, yeah I was running it with -r, but I guess I was used to the old output and didn't bother to browse the bin folder myself - my apologies :) keep up the great work guys!

mmaguigan avatar Dec 07 '16 01:12 mmaguigan