Reputation: 149
I've been playing around with asp.net core recently and I wanted to deploy my app to one of the ubuntu servers.
What I wanted to know is if there's a way to package the entire application (including configuration and other nuget dependencies) into a an single executable nuget which I could then execute with something like dotnet run myapp.nupkg
?
The java equivalent would be having a jar file all the dependencies bundled into it. Can something similar be achieved with dotnet or dotnet core?
Upvotes: 0
Views: 2046
Reputation: 15203
What you are asking for is not exactly possible without third party software (like the example you linked).
What you can do is to package you your application, all nuget dependencies, and (optionally) the .NET Core runtime into a single directory, possibly convert that to a tarball or zip file (a nupkg is just a zip file), and then uncompress and execute that program on your server/deployment target. But the uncompressing will be required; .NET Core can't execute a nuget package itself.
Look into dotnet publish
, which lets you build your application in ways you can distribute them.
Upvotes: 2