Skip to content

Commit ed9b2bd

Browse files
committed
fix: pass Configuration property to all ProjectReferences
The Integration.Tests projects were being built in Debug mode even when the solution was built in Release mode, causing CycloneDX.MSBuild to be built twice simultaneously (once in Release, once in Debug), resulting in file locking on CycloneDX.MSBuild.deps.json. Changes: - Add Configuration=$(Configuration) to all Integration.Tests ProjectReferences - Add Configuration=$(Configuration) to CycloneDX.MSBuild ProjectReference - This ensures all referenced projects build with the same configuration as the parent test project Build output showed the problem: 1. CycloneDX.MSBuild -> .../bin/Release/... (correct) 2. CycloneDX.MSBuild -> .../bin/Debug/... (wrong - caused by Integration.Tests) 3. DisabledProject -> .../bin/Debug/... (wrong - should be Release) Now all projects build with the same configuration, preventing simultaneous Release and Debug builds of the shared dependency.
1 parent 0cba86c commit ed9b2bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/CycloneDX.MSBuild.Tests/CycloneDX.MSBuild.Tests.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,26 @@
3131
<ProjectReference Include="../../src/CycloneDX.MSBuild/CycloneDX.MSBuild.csproj">
3232
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
3333
<BuildInParallel>false</BuildInParallel>
34-
<Properties>GeneratePackageOnBuild=false</Properties>
34+
<Properties>GeneratePackageOnBuild=false;Configuration=$(Configuration)</Properties>
3535
</ProjectReference>
3636

3737
<!-- Reference the test projects to ensure they're built before copying -->
3838
<!-- Disable parallel builds to prevent file locking on shared CycloneDX.MSBuild dependency -->
39+
<!-- Pass Configuration to ensure all projects build with the same configuration -->
3940
<ProjectReference Include="../Integration.Tests/SimpleProject/SimpleProject.csproj">
4041
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
4142
<BuildInParallel>false</BuildInParallel>
43+
<Properties>Configuration=$(Configuration)</Properties>
4244
</ProjectReference>
4345
<ProjectReference Include="../Integration.Tests/MultiTargetProject/MultiTargetProject.csproj">
4446
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
4547
<BuildInParallel>false</BuildInParallel>
48+
<Properties>Configuration=$(Configuration)</Properties>
4649
</ProjectReference>
4750
<ProjectReference Include="../Integration.Tests/DisabledProject/DisabledProject.csproj">
4851
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
4952
<BuildInParallel>false</BuildInParallel>
53+
<Properties>Configuration=$(Configuration)</Properties>
5054
</ProjectReference>
5155
</ItemGroup>
5256

0 commit comments

Comments
 (0)