Compile DLLs referenced into exe/dll

Posted Deon 非著名IT人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Compile DLLs referenced into exe/dll相关的知识,希望对你有一定的参考价值。

 

1:

DLLs  build action: Embedded Resource

 

2:

AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;  

 

static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
return LoadFromResource("LitJson.dll");
}

private static Assembly LoadFromResource(string resName)
{
Assembly ass = Assembly.GetExecutingAssembly();
using (Stream stream = ass.GetManifestResourceStream(".....Common.Lib." + resName))
{
byte[] bt = new byte[stream.Length];
stream.Read(bt, 0, bt.Length);
Assembly asm = Assembly.Load(bt);
return asm;
}
return null;
}

以上是关于Compile DLLs referenced into exe/dll的主要内容,如果未能解决你的问题,请参考以下文章

FFmpeg non-existing PPS 0 referenced问题描述

WinDbg常用命令系列---!dlls

can't find referenced pointcut myMethod的解决

无法设置 MQL_DLLS_ALLOWED

c_cpp AppInit_DLLs注入

DLL注入之Appinit_Dlls