bytecodealliance / componentize-dotnet

Tooling for creating WebAssembly components from C#
Apache License 2.0
40 stars 9 forks source link

Build warning - CSC : warning CS8784 #23

Open mikkelhegn opened 5 months ago

mikkelhegn commented 5 months ago

On biulding a project created following the instaructions in the README, I recevie the following warning. The build does succeed, and produces a runable Wasm.

CSC : warning CS8784: Generator 'VtableIndexStubGenerator' failed to initialize. It will not contribute to the output and compilation e
rrors may occur as a result. Exception was of type 'TypeLoadException' with message 'Could not load type 'Microsoft.Interop.Marshalling
GeneratorFactoryKey`1' from assembly 'Microsoft.Interop.SourceGeneration, Version=9.0.10.30401, Culture=neutral, PublicKeyToken=b03f5f7
f11d50a3a'.'. [C:\Users\mikkelhegn\test\MyApp\MyApp.csproj]
CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. It will not contribute to the output and compilation err
ors may occur as a result. Exception was of type 'TypeLoadException' with message 'Could not load type 'Microsoft.Interop.MarshallingGe
neratorFactoryKey`1' from assembly 'Microsoft.Interop.SourceGeneration, Version=9.0.10.30401, Culture=neutral, PublicKeyToken=b03f5f7f1
1d50a3a'.'. [C:\Users\mikkelhegn\test\MyApp\MyApp.csproj]
jsturtevant commented 1 week ago

I asked on the .net Discord channel: https://discord.com/channels/143867839282020352/1141126727028985877/1304582707287818314

The first one CSC : warning CS8784: Generator 'VtableIndexStubGenerator' failed to initialize. is used for COM and only used in CI so will not cause any issues.

The second one CSC : warning CS8784: Generator 'LibraryImportGenerator' failed to initialize. Would be an issue if you used custom marshallers or anything with [LibraryImport] in user code.

It maybe that this might be because the versions of the native-aot-llvm compiler are miss matched with the .net version you are using, i.e. the .NET SDK version used is 8 and the native-aot-llvm is build against 9 (or now 10)