我在具有管理员权限的 cmd 上使用以下命令:
ILMerge.exe /wildcards /log:ILMerge.log /allowdup
/targetplatform:"v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319"
/lib:"C:\SDK2016\SDK2016\Bin"
/lib:"packages\Microsoft.CrmSdk.Extensions.7.1.0.1\lib\net45"
/lib:"packages\log4net.2.0.5\lib\net45-full"
/keyfile:"Tools\Snk\XXX.snk"
/out:"c:\XXXALLMERGED.dll"
"c:\proj\alldlls\*.dll"
我在日志文件的末尾收到以下错误:
An exception occurred during merging:
Unable to load DLL 'mscorsn.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Compiler.Writer.MscorsnStrongNameSignatureGeneration(String wszFilePath, String wszKeyContainer, Byte[] pbKeyBlob, Int32 cbKeyBlob, IntPtr ppbSignatureBlob, IntPtr pcbSignatureBlob)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
由于我的目标框架是 v4 并且我的文件夹是“v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319”,因此我检查了 mscorsn.dll 是否存在;它存在。
那么,可能是什么问题?你能帮忙吗?