Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to deploy a .NET Core 3.x worker service with TeamCity + Octopus?

$
0
0

We are migrating our current .Net Framework services to .NET Core 3.x.
The current deployment pipeline involves the creation of nuget packages using nuget.exe and custom nuspec files.
Then Octopus will install the service on the remote machine.
These nuget packages just contains everything (.nuspec file): '''xml '''

I wrote the new TeamCity project steps to use dotnet publish, test and pack.
I don't want to use custom nuspec files.
My issue now is that the nuget packages I create does not contain the .exe file, needed to start the webservice.

The project is a Worker Service: <Project Sdk="Microsoft.NET.Sdk.Worker"> and I use the Microsoft.Extensions.Hosting.WindowsServices:
'''csharp Host.CreateDefaultBuilder(args) .UseWindowsService() ''' I also use <OutputType>Exe</OutputType> or --runtime --win-x64 so I have I have MyProject.dll and MyProject.exe in bin\Release\netcoreapp3.1\publish when I build with: ''' dotnet publish MyProject/MyProject.csproj -c Release --runtime win10-x64 '''

Then, I try to create the nuget package with: ''' dotnet pack -c Release --no-build SS.Betting.Spikes.WorkerService/ArbitrageMonitor/ArbitrageMonitor.csproj ''' or ''' dotnet pack -c Release SS.Betting.Spikes.WorkerService/ArbitrageMonitor/ArbitrageMonitor.csproj --runtime win10-x64 '''

How to include the .exe file in the nuget package?
packOptions require a project.json file that is not what I want.
So, previously the nuget packages were used just as zip (versioned) files?
Is this approach OK or just using a zip file will be better; I mean, is this the "official way" to deploy a windows service ?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>