How to embed external reference (merge DLLs into one)

How to embed external reference (merge DLLs into one)

tbarana
Participant Participant
702 Views
2 Replies
Message 1 of 3

How to embed external reference (merge DLLs into one)

tbarana
Participant
Participant

Mabye more of a general C# question, but how to embed other DLLs into single one to be loaded into Autocad, if possible? I tried AssemblyResolve, but don't know where to put it in my code. So far I have a simple public partial class for WinForm with few button click events and one class for code. I want to merge one reference assembly added through NuGet to my release dll so I don't have multiple dlls. I also tried ILMerge, but it didn-t work.

0 Likes
703 Views
2 Replies
Replies (2)
Message 2 of 3

ntclmain
Advocate
Advocate

There is a similar topic here:

https://forums.autodesk.com/t5/net/using-ilmerge-to-get-one-assembly-from-multiple/m-p/12222532#M785...

*

My previous answer:

I use ILRepack.Lib.MSBuild.Task by RBSoft instead of ILMerge to combine .dll files into one DLL

and

Resource.Embedder by Marc Stan to embed translations files  into the above combined .DLL file

You can get these packages from Nuget Packages Manager in Visual studio

With these packages installed, the combination process is automatically done when you build a project.

Message 3 of 3

tbarana
Participant
Participant

I'm coming back to this now and trying to use mentioned method, but I'm getting errors, first if acad references Copy Local is set to false, I get "Failed to resolve assembly: 'accoremgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null'", if I set it to true so it copies the reference, I get "Failed to load assembly with Zero PeKind: bin\x64\Release\accoremgd.dll", which is a ILRepack error but I can't figure out the solution, any help with that maybe?

0 Likes