roslyn: Unable to load analyzer assembly when targeting ARM64
This is Alfred from the M365 Clipchamp team. We’ve recently added a source generator project using Microsoft.CodeAnalysis, but we’ve run into an issue that the compiler complains that it isn’t able to load the generator project DLL, and it occurs ONLY when we target ARM64: it builds fine when targeting x64. We are running out of ideas so reaching out to see if you have ideas about what we might have done wrong, or further contacts who you think might be able to help 🙏.
Version Used: Microsoft.CodeAnalysis.CSharp 4.12.0
Steps to Reproduce:
- Clone this Clipchamp repo branch
- Open Clipchamp.sln with Visual Studio
- Copy Clipchamp\App.Local.config into Clipchamp\App.config
- Build Clipchamp.csproj targeting ARM64
Diagnostic Id: CS8034: Unable to load Analyzer assembly C:\Users\alfredsee\source\repos\clipchamp-native\Clipchamp.Generators\bin\ARM64\Debug\netstandard2.0\Clipchamp.Generators.dll : Unable to load Clipchamp.Generators
P.S.: I can confirm that ^ DLL exists in ^ directory.
Link to failed build with ^ error
Expected Behavior: The build should pass when targeting ARM64 just like when targeting x64.
Actual Behavior: The build fails with the following error:
1>CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\alfredsee\source\repos\clipchamp-native\Clipchamp.Generators\bin\ARM64\Debug\netstandard2.0\Clipchamp.Generators.dll : Unable to load Clipchamp.Generators
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (7 by maintainers)
In your build step, I think you need to modify
msbuildArgsto have:/bl:$(Build.ArtifactStagingDirectory)/build-package.binlog(and ensure this is published as artifact)