After updating to the latest version of visual studio (17.10.2) I started getting the error below on build.
1>MSBUILD : PackExcelAddIn error DNA-818471385: Assembly at bin\Debug\net6.0-windows\System.Threading.Channels.dll could not be packed. Possibly a mixed assembly? (These are not supported yet.)
1>MSBUILD : PackExcelAddIn error DNA-818471385: Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Threading.Channels, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Cannot specify assembly evidence under MultiDomain after non-GAC assemblies with default evidence have been loaded in appdomain. (Exception from HRESULT: 0x8013101D)
1>MSBUILD : PackExcelAddIn error DNA-818471385: File name: 'System.Threading.Channels, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.Runtime.InteropServices.COMException (0x8013101D): Cannot specify assembly evidence under MultiDomain after non-GAC assemblies with default evidence have been loaded in appdomain. (Exception from HRESULT: 0x8013101D)
1>MSBUILD : PackExcelAddIn error DNA-818471385: at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, Boolean fSkipIntegrityCheck, SecurityContextSource securityContextSource)
1>MSBUILD : PackExcelAddIn error DNA-818471385: at System.Reflection.Assembly.Load(Byte[] rawAssembly)
1>MSBUILD : PackExcelAddIn error DNA-818471385: at ResourceHelper.ResourceUpdater.AddAssembly(String path, String source, Boolean compress, Boolean multithreading, Boolean includePdb)
1>MSBUILD : PackExcelAddIn error DNA-818471385:
1>MSBUILD : PackExcelAddIn error DNA-818471385:
I am able to reproduce this with this minimal project file (no code needed)
After updating to the latest version of visual studio (17.10.2) I started getting the error below on build.
I am able to reproduce this with this minimal project file (no code needed)
The error only happens when building with-in visual studio, not when building via dotnet build.