© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
12 replies
Karolis2011

❔ Native DLL in source generator

I am trying to make source generator that relies on custom native DLL, compiled from Rust.
But Issue I am facing issues with managing it to be able to load them.
CSC : warning CS8785: Generator 'HybridByondCodeGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'DllNotFoundException' with message 'Unable to load DLL 'dreammaker' or one of its dependencies: The specified module could not be found. (0x8007007E)' [C:\Projektai\ExternalByondSharp\ExtBySharp.Game\ExtBySharp.Game.csproj]
CSC : warning CS8785: Generator 'HybridByondCodeGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'DllNotFoundException' with message 'Unable to load DLL 'dreammaker' or one of its dependencies: The specified module could not be found. (0x8007007E)' [C:\Projektai\ExternalByondSharp\ExtBySharp.Game\ExtBySharp.Game.csproj]

ExtBySharp.Generator
ExtBySharp.Generator
is project containing
HybridByondCodeGenerator
HybridByondCodeGenerator

DMNet.SpacemanDMM
DMNet.SpacemanDMM
is project containing native bindings and wrapper for native DLL.
libdreammaker.a
libdreammaker.a
and
dreammaker.dll
dreammaker.dll
are native DLLs.
ExtBySharp.Game
ExtBySharp.Game
is project for containing generator source files
*.dm
*.dm
and
*.dme
*.dme
and needs code to be generated for.

I tried renfrecing project directly, but it didn't work, then I ended up packaging it as nuget package, and generator seems to load things, just it fails at loading native dlls, I tried putting them under
analyzers/dotnet/cs
analyzers/dotnet/cs
,
build/
build/
and I am out of idea what to try.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

source generator
C#CC# / help
3y ago
❔ Access AdditionalFiles in source generator
C#CC# / help
3y ago
❔ Source generator & protobuf
C#CC# / help
4y ago
Source generator not working?
C#CC# / help
12mo ago