© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•17mo ago•
3 replies
LPeter1997

Could not load file or assembly '...' with a weaved DLL

I have a DLL I have weaved with
Mono.Cecil
Mono.Cecil
, called
Draco.Compiler
Draco.Compiler
. The weaver adds an assembly reference to
Draco.Coverage
Draco.Coverage
, as the compiler DLL will call out to functions of this. When I execute with
dotnet exec Draco.Compiler.dll
dotnet exec Draco.Compiler.dll
, I get the usual exception indicating a failure to locate the assembly:
System.IO.FileNotFoundException: Could not load file or assembly 'Draco.Coverage, Version=0.2.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Now opening up the weaved DLL with ILSpy, all looks good and ILSpy actually manages to locate the dependency assembly as it's in the exact same folder as the weaved DLL. I'm not sure if ILSpy has a different/simpler assembly location strategy or something, but is there any way I could debug why this assembly loading fails when running with
dotnet exec
dotnet exec
?
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

Could not load file or assembly…
C#CC# / help
2y ago
❔ could not load file or assembly
C#CC# / help
3y ago
✅ Could not load file or assembly 'StackExchange.Redis
C#CC# / help
4y ago
DLL Unable to load file or assembly [Answered]
C#CC# / help
4y ago