The dotnet publish command compiled the dotnet core application and writes the output to a folder.The contents of this folder could be deployed.So effectively dotnet publish command publishes the compiled output along with the application dependencies.If you are in the root folder of your application then you can issue the command
dotnet publish
this will write the output by default in the following directory
root folder\bin\Debug\netcoreapp2.1\publish\
The output includes
- Intermediate Language (IL) code
- The application’s dependencies
so if the name of your application is webapp1 then your output will be generated in:
I:\cc\asp.net core\webapp1\webapp1\bin\Debug\netcoreapp2.1\publish
If you want you can specify a different path then the default path by providing the path to the publish command
dotnet publish -o "directpry path to publish the dotnet core application"
you can specify other required options when executing this command:-
- -c or –configuration to specify Debug or Release configuration
- –no-restore
- “path to csproj file”
- –framework “framework version”
So if you want to publish using a specific framework then you can use:
dotnet publish --framework "framework version"
You can publish you .net application in of the following ways:
- Framework-dependent deployment dotnet publish -c Release
- Framework-dependent executable dotnet publish -c Release -r Id –self-contained false
- Self-contained deployment dotnet publish -c Release -r <RID> –self-contained true
Leave a Reply