Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

Could not load file or assembly 'Cesium.Runtime' in tests

Open kant2002 opened this issue 1 year ago • 10 comments

Occasionally Codegen tests in Visual Studio (at least where I work) fails with following exception

System.IO.FileNotFoundException : Could not load file or assembly 'Cesium.Runtime, Version=0.0.1.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
    CodeGenTestBase.CreateAssembly(TargetRuntimeDescriptor targetRuntime, TargetArchitectureSet targetArchitectureSet, String namespace, String globalTypeFqn, String[] referencePaths)
    CodeGenTestBase.GenerateAssembly(String[] sources, TargetRuntimeDescriptor runtime, TargetArchitectureSet arch, String namespace, String globalTypeFqn, String[] referencePaths) line 47
    CodeGenTestBase.GenerateAssembly(TargetRuntimeDescriptor runtime, TargetArchitectureSet arch, String namespace, String globalTypeFqn, String[] sources) line 35
    CodeGenTypeTests.DoTest(String source, String namespace, String globalTypeFqn) line 12
    CodeGenTypeTests.StructForwardDeclaration() line 415
    RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

kant2002 avatar Nov 11 '24 07:11 kant2002

Current directory during run is

artifacts\bin\Cesium.CodeGen.Tests\debug

There only PDB and not DLL files for Cesium.Runtime present there.

kant2002 avatar Nov 11 '24 08:11 kant2002

How often does it happen? What do you do at that moment? Do you start from clean bin directory?

ForNeVeR avatar Nov 11 '24 12:11 ForNeVeR

It’s happens pretty consistently. Never touch artifacts or bin formers. Just add new tests and run them from. Editor.

kant2002 avatar Nov 11 '24 14:11 kant2002

Visual studio was not even closed, same editor session

kant2002 avatar Nov 11 '24 14:11 kant2002

It is very strange then, where could the files go and why :(

ForNeVeR avatar Nov 11 '24 21:11 ForNeVeR

I suspect repro steps following

  1. Run tests
  2. Add new test
  3. Run via Test Explorer or via inlay hints.
  4. Only test project gets build.
  5. Failure during run.
  6. Build test project trigger full build Cesium.CodeGen Cesium.TestFramework Cesium.Compiler Cesium.CodeGen.Tests
  7. Tests run again.

kant2002 avatar Nov 15 '24 12:11 kant2002

I add <AccelerateBuildsInVisualStudio>false</AccelerateBuildsInVisualStudio> and issue is still persists.

kant2002 avatar Nov 22 '24 13:11 kant2002

I had the same issue in Rider. After updating on 2024.3 the problem disappeared.

evgTSV avatar Nov 23 '24 08:11 evgTSV

Can confirm I have just reproduced the same problem in Rider 243.23349. So, it is not VS-specific at all.

Interestingly, artifacts\bin\Cesium.CodeGen.Tests\debug has literally everything else but the Cesium.Runtime.dll file. It even has the corresponding .pdb indeed. How come it's missing the DLL?!

ForNeVeR avatar Dec 08 '24 16:12 ForNeVeR

The problem was solved by dotnet build.

Some interesting info I got while running that:

PowerShell 7.4.6
Loading personal and system profiles took 1097ms.
G:\Projects\Cesium git:[refactor/718.small-fixes]
dotnet build -bl

Restore complete (2.3s)
  Cesium.Solution.Metadata succeeded (0.6s) → artifacts\bin\Cesium.Solution.Metadata\debug\Cesium.Solution.Metadata.dll
  Cesium.Templates.CSharp succeeded (0.7s) → artifacts\bin\Cesium.Templates.CSharp\debug\Cesium.Templates.CSharp.dll
  Cesium.Core succeeded (1.5s) → artifacts\bin\Cesium.Core\debug\Cesium.Core.dll
  Cesium.Runtime net6.0 succeeded with 1 warning(s) (0.9s) → artifacts\bin\Cesium.Runtime\debug_net6.0\Cesium.Runtime.dll
    G:\Projects\Cesium\Cesium.Runtime\StdIoFunctions.cs(732,13): warning CS0219: The variable 'bytesConsumed' is assigned but its value is never used      
  Cesium.Runtime netstandard2.0 succeeded with 1 warning(s) (1.8s) → artifacts\bin\Cesium.Runtime\debug_netstandard2.0\Cesium.Runtime.dll
    G:\Projects\Cesium\Cesium.Runtime\StdIoFunctions.cs(732,13): warning CS0219: The variable 'bytesConsumed' is assigned but its value is never used      
  Cesium.Runtime.Tests net48 succeeded (0.6s) → artifacts\bin\Cesium.Runtime.Tests\debug_net48\Cesium.Runtime.Tests.dll
  Cesium.Sdk succeeded (1.8s) → artifacts\bin\Cesium.Sdk\debug\Cesium.Sdk.dll
  Cesium.Ast succeeded with 2 warning(s) (3.0s) → artifacts\bin\Cesium.Ast\debug\Cesium.Ast.dll
    C:\Program Files\dotnet\sdk\9.0.100\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5104: A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "Yoakke.SynKit.C.Syntax [2024.12.4-18.22.20-nightly, )" or update the version field in the nuspec.
    C:\Program Files\dotnet\sdk\9.0.100\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): warning NU5104: A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "Yoakke.SynKit.Lexer [2024.12.4-18.22.20-nightly, )" or update the version field in the nuspec.
  Cesium.Runtime.Tests net8.0 succeeded (1.9s) → artifacts\bin\Cesium.Runtime.Tests\debug_net8.0\Cesium.Runtime.Tests.dll
  Cesium.Preprocessor succeeded (3.2s) → artifacts\bin\Cesium.Preprocessor\debug\Cesium.Preprocessor.dll
  Cesium.Parser succeeded (2.8s) → artifacts\bin\Cesium.Parser\debug\Cesium.Parser.dll
  Cesium.CodeGen succeeded with 2 warning(s) (0.8s) → artifacts\bin\Cesium.CodeGen\debug\Cesium.CodeGen.dll
    G:\Projects\Cesium\Cesium.CodeGen\Ir\Expressions\Constants\IntegerConstant.cs(59,14): warning CS0219: The variable 'i64Parse' is assigned but its value is never used
    G:\Projects\Cesium\Cesium.CodeGen\Ir\Types\StructType.cs(15,28): warning CS0169: The field 'StructType.AnonType' is never used
  Cesium.TestFramework succeeded (0.7s) → artifacts\bin\Cesium.TestFramework\debug\Cesium.TestFramework.dll
  Cesium.Compiler succeeded with 1 warning(s) (1.5s) → artifacts\bin\Cesium.Compiler\debug\Cesium.Compiler.dll
    G:\Projects\Cesium\Cesium.Compiler\IndentedTextWriter.cs(357,26): warning CS3021: 'IndentedTextWriter.WriteLine(uint)' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute
  Cesium.Sdk.Tests succeeded (0.8s) → artifacts\bin\Cesium.Sdk.Tests\debug\Cesium.Sdk.Tests.dll
  Cesium.Parser.Tests succeeded (0.8s) → artifacts\bin\Cesium.Parser.Tests\debug\Cesium.Parser.Tests.dll
  Cesium.TestFramework.Tests succeeded (1.5s) → artifacts\bin\Cesium.TestFramework.Tests\debug\Cesium.TestFramework.Tests.dll
  Cesium.IntegrationTests succeeded (1.6s) → artifacts\bin\Cesium.IntegrationTests\debug\Cesium.IntegrationTests.dll
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesium.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 1 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
  Cesium.Compiler.Tests succeeded with 1 warning(s) (1.3s) → artifacts\bin\Cesium.Compiler.Tests\debug\Cesium.Compiler.Tests.dll
    G:\Projects\Cesium\Cesium.Compiler.Tests\CommandLineParsingTest.cs(127,13): warning xUnit2029: Do not use Assert.Empty to check if a value does not exist in a collection. Use Assert.DoesNotContain instead. (https://xunit.net/xunit.analyzers/rules/xUnit2029)
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 1 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 1 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 1 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 2 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 2 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 2 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 2 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 3 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 3 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 3 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 3 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 4 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 4 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 4 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 4 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 5 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 5 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 5 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 5 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 6 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 6 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 6 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 6 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 7 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 7 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 7 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 7 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 8 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 8 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 8 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 8 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 9 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 9 in 1000ms. The process c
annot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 9 in 1000ms. The 
process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 9 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning retry
 10 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 10 in 1000ms. The process 
cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 10 in 1000ms. The
 process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\Cesi
um.Solution.Metadata\debug\Cesium.Solution.Metadata.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll". Beg
inning retry 10 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Solution.Metadata.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
  Cesium.CodeGen.Tests failed with 8 error(s) and 40 warning(s) (12.7s)
    C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\
Cesium.TestFramework\debug\Cesium.TestFramework.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll". Beginning r
etry 1 in 1000ms. The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.TestFramework.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
    C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\
Cesium.Core\debug\Cesium.Core.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll". Beginning retry 1 in 1000ms. The proce
ss cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.Core.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"
    C:\Program Files\dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(5035,5): warning MSB3026: Could not copy "G:\Projects\Cesium\artifacts\bin\
Cesium.CodeGen\debug\Cesium.CodeGen.dll" to "G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll". Beginning retry 1 in 1000ms. 
The process cannot access the file 'G:\Projects\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.dll' because it is being used by another process. The file is locked by: ".NET Host (34276)"

It looks like our assemblies are locked by something on disk.

I suspect that there's a msbuild leak from the build host we create during the tests.

ForNeVeR avatar Dec 08 '24 16:12 ForNeVeR

Hypothesis: other tests running at the same moment (integration tests) might interfere with normal builds, or tests could interfere with each other. An aborted test could easily create a process outliving the test itself. All this could lead to a broken build state.

Solution: make sure the runtime and compiler and everything is compiled before running the tests (either via project references or via solution-level dependencies), avoid using dotnet build or dotnet run in tests' runtime.

Alternatively (which might be useful anyway), use job objects in tests on Windows, to make sure no spawned processes outlive the tests themselves.

ForNeVeR avatar Apr 06 '25 00:04 ForNeVeR