Closed 0xced closed 2 years ago
I've never had any issues debugging unit test. Can you be more specific? How do you run into problems?
I'm asking because this change now causes problems. The pack command fails since package validation fails (both from within Visual Studio as well as from the command line):
C:\Users\m\Documents\SwissQRBill.NET\Core>dotnet pack --configuration Release
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
Core -> C:\Users\m\Documents\SwissQRBill.NET\Core\bin\Release\netstandard2.0\Codecrete.SwissQRBill.Core.dll
Tool 'dotnet-validate' (version '0.0.1-preview.280') was restored. Available commands: dotnet-validate
Restore was successful.
Validating C:\Users\m\Documents\SwissQRBill.NET\Core\bin\Release\Codecrete.SwissQRBill.Core.3.0.4.nupkg
Source Link: ? Valid
Deterministic (dll/exe): ? Non deterministic
Ensure that the following property is enabled for CI builds and you're using at least the 2.1.300 SDK:
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
The following assemblies have not been compiled with deterministic settings:
lib\netstandard2.0\Codecrete.SwissQRBill.Core.dll
Compiler Flags: ? Valid
C:\Users\m\Documents\SwissQRBill.NET\Core\Core.csproj(67,5): error MSB3073: The command "dotnet validate package local bin\Release\Codecrete.SwissQRBill.Core.3.0.4.nupkg" exited with code 1.
I've never had any issues debugging unit test. Can you be more specific? How do you run into problems?
I'm using Rider (on both macOS and Windows) and with the ContinuousIntegrationBuild
MSBuild property set to true
, Rider can't see breakpoints in the Core, PixelCanvas, and Windows projects so it becomes impossible to debug:
The pack command fails since package validation fails
Indeed validation fails when the ContinuousIntegrationBuild
property is not set and that's expected. You can make the validation pass by explicitly setting ContinuousIntegrationBuild
to true
:
dotnet pack --configuration Release -p:ContinuousIntegrationBuild=true
Note that for a real continuous integration build, i.e. on GitHub actions, the ContinuousIntegrationBuild
setting is set to true
and the configuration is set to Release
through environment variables (all environment variables are available to the Microsoft Build Engine (MSBuild) project file as properties):
Is there a way to make the Pack command within Visual Studio work again?
I just did this in 78a87e5a02491f995de90dec07220609d784d4b9:
<ContinuousIntegrationBuild Condition="$(Configuration) == 'Release'">true</ContinuousIntegrationBuild>
This way, packing with the Release configuration works and debugging in Rider with the Debug configuration also works. 🥳
Thanks for merging! 🚀 Are you planing to release a new version on NuGet soon?
I will likely release it within 2 days. The port to Java is already done.
This breaks debugging unit tests. Anyway, it's already set by the continuous integration workflow: