-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to chain link C# Dlls? #226
Comments
Hello, Did you list all mentioned dependencies in that field of merging modules? It's hard to say without inspecting. I recommend isolating the problem using AssemblyResolve to check the generated module after ILMerge |
I'm facing the same problem . Calling the c# dll from rust. |
@sidpara47 Have you tried tracking attempts to load requested modules into the active domain? Are you using module merging somehow in your projects? What about applied resolution of an assembly fails in your code? What DllExport configuration? Can you prepare a minimal reproducible example to understand the issue? I need some details. Thanks. |
@3F |
I don't see anything I requested. I'm not even sure you're using this DllExport project. What version? What configuration?
Custom assembly resolving may still be required for your module MicMonitorDllNetFramework.dll because CLR is initialized for this module by the module (host) written in Rust in that case and valid paths for that modified module can point to the different (host) directories and system path of course. Btw, you can quickly verify this by temporarily moving NAudio.Wasapi and all its dependencies into system32 directory, should help.
So please backtrace all module loading in your domain. You can additionally check And again, what version and configuration please. Thanks. |
. . .
The question is related to:
DllExport -version
: 1.74Data
tab:Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: Cs
Storage: ProjectFiles
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: False
Compiler.ourILAsm: False
Compiler.customILAsm:
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: None
PreProc.Type: ILMerge, DebugInfo, IgnoreErr
PreProc.Cmd:
PostProc.Type: None
PostProc.ProcEnv:
PostProc.Cmd:
SignAssembly:
Identifier: A5E7C3C1-3624-4EA1-8407-19E38D27B525
Instance: C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\z003e9wr\source\repos\C To Managed Call\ManagedCSharp\ManagedCSharp.csproj
Action: Configure
PlatformTarget: x64
TargetFramework:
TargetFrameworks:
TargetFrameworkVersion: v4.8
RootNamespace: ManagedCSharp
AssemblyName: ManagedCSharp
MgrArgs:
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy:
StoragePath: .net.dllexport.targets
ddNS: ManagedCSharp
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\z003e9wr\source\repos\C To Managed Call
PkgPath: C:\Users\z003e9wr\source\repos\C To Managed Call\packages\DllExport.1.7.4
SlnFile:
SlnDir: C:\Users\z003e9wr\source\repos\C To Managed Call
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError:
Maybe a silly question, sorry I am still learning
When trying to access C# DLLs from native C++ I always get : EEFileLoadException at memory location when the C# assembly (decorated with [Dllexport]) is using other references. I have tried putting all the required Dlls into the folder with the C++ exe but this doesn't help.
So in other words I am accessing C# assembly A from C++ and assembly A is using assemblies B,C,D etc and C++ seems to not be able to resolve these links.
(I am using ILmerge in pre-processing tab)
The text was updated successfully, but these errors were encountered: