AndreyMagnificent
AndreyMagnificent

Reputation: 175

How to publish .Net Core ASP portable version from command line?

I need 1 version of build for each os (win-32, win-64, Linux). From the Visual Studio, you can choose when to publish: framework dependent and portable. But I need to do it on Jenkins.

I tried use command:

dotnet publish myapp.csproj --self-contained false --configuration Release --runtime ??? --output "С:\myapp"

but runtimes: "any", "portable" does not work.

How VS build with params framework dependent and portable? I did not use MSBuild, dotnet build, or dotnet MSBuild because publish command adds some unique files(web.config, resources) and remove unuseful(dep*.json).

Upvotes: 5

Views: 7106

Answers (1)

Daniel
Daniel

Reputation: 9839

you can find a list of all runtimes here runtime.json. Taken from .NET Core RID (Runtime Identifier Catalog) Catalog.

e.g.

dotnet publish myapp.csproj --self-contained false --configuration Release --runtime "alpine.3.7" --output "С:\myapp_alpine_3_7"

dotnet publish myapp.csproj --self-contained false --configuration Release --runtime "linuxmint.19.2-x64" --output "С:\myapp_linuxmint_19_2_x64"

Upvotes: 1

Related Questions