ForNeVeR / Cesium

C compiler for the CLI platform
MIT License
382 stars 42 forks source link

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

Open kant2002 opened 2 weeks ago

kant2002 commented 2 weeks ago

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 commented 2 weeks ago

Current directory during run is

artifacts\bin\Cesium.CodeGen.Tests\debug

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

ForNeVeR commented 2 weeks ago

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

kant2002 commented 2 weeks ago

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

kant2002 commented 2 weeks ago

Visual studio was not even closed, same editor session

ForNeVeR commented 2 weeks ago

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

kant2002 commented 1 week ago

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 commented 3 days ago

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

evgTSV commented 2 days ago

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