
I Switched from iPhone to Android: A Programmer's Notes
Writing code got faster for me in the last two years. An idea at night, an agent's homework in the morning, a few fixes, and it runs. The phone in my pocket did
Read more
When working with Windows Service applications based on .NET 8.0 in a .NET Core environment, you might encounter issues with file structure changes during the DevOps pipeline process. This article explains the problem and provides a solution.
While building and packaging a Windows Service application using Azure DevOps, I noticed that the runtimes directory’s file structure was altered when downloading the build artifacts in the Release pipeline. This caused the application to fail during deployment.
The issue occurred because the build artifacts were not compressed during the packaging step. Without compression, the file structure was modified during the artifact download process.
To resolve this issue, I updated the pipeline to compress the build artifacts during the packaging step. Additionally, during deployment, I ensured that the compressed artifact was manually extracted and used to overwrite the existing files.
DotNetCoreCLI@2 task, enable the Zip published projects option during the publish step. This ensures that the build artifacts are automatically compressed into a .zip file.Extract files task to the Release pipeline to extract the compressed artifact. This step ensures that the files are properly extracted to the deployment directory.runtimes directory and other file structures remain intact.Below is an example of how you can modify your Azure DevOps YAML pipeline to enable compression during the DotNetCoreCLI@2 publish step:
yaml- task: DotNetCoreCLI@2 inputs: command: 'publish' publishWebProjects: false zipAfterPublish: true arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
During deployment, you can use an Extract files task in the Release pipeline. Below is an example configuration:
yaml- task: ExtractFiles@1 inputs: archiveFilePatterns: '$(System.DefaultWorkingDirectory)/build-artifact.zip' destinationFolder: '$(System.DefaultWorkingDirectory)/extracted' cleanDestinationFolder: true
By compressing the build artifacts and ensuring proper extraction during deployment, you can avoid file structure issues in the DevOps pipeline. This approach ensures that your Windows Service application based on .NET 8.0 is deployed correctly and functions as expected.
If you encounter similar issues, consider reviewing your pipeline configuration and ensuring that artifacts are handled in a way that preserves their integrity.
Related Posts

Writing code got faster for me in the last two years. An idea at night, an agent's homework in the morning, a few fixes, and it runs. The phone in my pocket did
Read more
I played GTA5 in 2013, before my kid was born. This year GTA6 is out, and he's eleven. The game is new. The pictures in my head are old. Just some notes.
Read more
AI has improved faster than my sense of what my job even is. The hours after dinner go into handing tasks to agents and building my own systems. If I need something, I build it — bookkeeping, photo sync, my own deployment, all written and shipped by one person.
Read more
How this blog connects to AI agents via MCP/OpenAPI — motivation, workflow, and reflections, without manual layout work.
Read more