HaloSPV3/Gemini

ProjectReference 'HXE' is compiled *twice*

BinToss opened this issue · 2 comments

dotnet publish '.\SPV3.csproj' -r 'win10-x86'
D:\Repos\spv3-loader\src [main ≡ +0 ~4 -0 !]> dotnet publish '.\SPV3.csproj' -r 'win10-x86'
Microsoft (R) Build Engine version 17.0.0-preview-21460-01+8f208e609 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

D:\Repos\spv3-loader\src\SPV3.csproj(3,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
D:\Repos\spv3-loader\src\SPV3.csproj(3,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
  Determining projects to restore...
D:\Repos\spv3-loader\src\SPV3.csproj(3,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
D:\Repos\spv3-loader\src\SPV3.csproj(3,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
  Restored D:\Repos\spv3-loader\ext\hxe\src\HXE.csproj (in 703 ms).
  Restored D:\Repos\spv3-loader\src\SPV3.csproj (in 703 ms).
D:\Repos\spv3-loader\src\SPV3.csproj(3,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  0. GitVersion cannot determine the next version in shallow reposistories.
        We will use Git to determine if the current repository needs to be un-shallowed.
   Checking if Git is available...
  1. Git was found.
   It is git version 2.33.1.windows.1 at...
   D:\Apps\Git\cmd\git.exe
  2. Checking if repository is shallow...
  3. Repository is complete. Proceeding to Build...
  0. GitVersion cannot determine the next version in shallow reposistories.
        We will use Git to determine if the current repository needs to be un-shallowed.
   Checking if Git is available...
  1. Git was found.
   It is git version 2.33.1.windows.1 at...
   D:\Apps\Git\cmd\git.exe
  2. Checking if repository is shallow...
  3. Repository is complete. Proceeding to Build...
C:\Users\Noah\.nuget\packages\gitversion.msbuild\5.7.0\tools\GitVersion.MsBuild.targets(134,9): warning : File contains assembly version attributes which conflict with the attributes generated by GitVersion obj\Debug\net5.0-windows\win10-x86\AssemblyInfo.g.cs [D:\Repos\spv3-loader\ext\hxe\src\HXE_5xahz2ov_wpftmp.csproj]
  HXE -> D:\Repos\spv3-loader\ext\hxe\bin\Debug\net5.0-windows\win10-x86\HXE.dll
D:\Repos\spv3-loader\src\SPV3_qpdb5yod_wpftmp.csproj(11,3): warning MSB4011: "D:\Repos\spv3-loader\src\Directory.Build.props" cannot be imported again. It was already imported at "C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Current\Microsoft.Common.props (33,3)". This is most likely a build authoring error. This subsequent import will be ignored.
  0. GitVersion cannot determine the next version in shallow reposistories.
        We will use Git to determine if the current repository needs to be un-shallowed.
   Checking if Git is available...
  1. Git was found.
   It is git version 2.33.1.windows.1 at...
   D:\Apps\Git\cmd\git.exe
  2. Checking if repository is shallow...
  3. Repository is complete. Proceeding to Build...
  HXE -> D:\Repos\spv3-loader\ext\hxe\bin\Debug\net5.0-windows\win10-x86\HXE.dll
C:\Users\Noah\.nuget\packages\gitversion.msbuild\5.7.0\tools\GitVersion.MsBuild.targets(134,9): warning : File contains assembly version attributes which conflict with the attributes generated by GitVersion obj\Debug\net5.0-windows\win10-x86\AssemblyInfo.g.cs [D:\Repos\spv3-loader\src\SPV3_qpdb5yod_wpftmp.csproj]
  SPV3 -> D:\Repos\spv3-loader\bin\Debug\net5.0-windows\win10-x86\SPV3-Loader.dll
  SPV3 -> D:\Repos\spv3-loader\bin\Debug\net5.0-windows\win10-x86\publish\

Depending on how the builds are timed, the later build could run into a file access error because the earlier build still has the file locked.
In most cases, this is avoided, but it's still possible for builds to fail randomly due to this issue.

The VSCode extension "aliasadidev.nugetpackagemanagergui" helped me spot the potential cause of this issue.
image

A temporary copy of HXE.csproj is created and later compiled. The filename indicates a relation to WPF.