我正在尝试编译一个项目,该项目使用ILMerge将多个DLL组合在一起,然后对它们进行签名以便部署到客户关系管理。已编译代码,但ILMerge失败。这个过程适用于其他开发人员机器,而不是我的。
我正在使用Visual 2015、Windows 10,并使用.NET 4.5.2构建。
所有的项目都是用AnyCPU编译的。
解析程序集引用“System.Runtime.Caching”到System.Runtime.Caching(使用框架目录) 合并过程中发生异常:无法加载DLL‘mscsn.dll’:找不到指定的模块。(除HRESULT: 0x8007007E外)在System.Compiler.Writer.MscorsnStrongNameSignatureGeneration(String wszFilePath,String wszKeyContainer,Byte[] pbKeyBlob,Int32 cbKeyBlob,IntPtr ppbSignatureBlob,IntPtr pcbSignatureBlob) at System.Compiler.Writer.WritePE(String location,Boolean,module模块,Boolean delaySign,String keyFileName,String keyName)在System.Compiler.Writer.WritePE(CompilerParameters delaySign,Module模块(( args) )
我的构建后事件参数是:
if "$(ConfigurationName)" == "Debug No ILMerge" goto :exit REM **** Create ILMerge Directory **** md "$(TargetDir)IlMerge" REM **** Delete Previous Log **** del "$(TargetDir)IlMerge\Log.txt" REM **** Run IlMerge **** "$(SolutionDir)packages\ILMerge.2.14.1208\tools\ILMerge.exe" /log:"$(TargetDir)IlMerge\Log.txt" /keyfile:"$(ProjectDir)Client.Xrm.Plugins.Key.snk" /targetplatform:v4 /out:"$(TargetDir)IlMerge\$(TargetFileName)" "$(TargetPath)" "$(TargetDir)DLaB.Common.dll" "$(TargetDir)DLaB.Xrm.2015.dll" "$(TargetDir)Client.Xrm.dll" "$(TargetDir)Applications.Web.Security.dll" "$(TargetDir).Domain.dll" "$(TargetDir)Newtonsoft.Json.dll" :exit
我可以在我的计算机上手动定位mscorsn.dll并将它放到本地文件夹中。ILMerge会拿起它,但取决于我使用的版本(在Windows中有4-5个不同的副本),它要么会彻底失败,要么会声明它无法签署最终的dll。
我尝试将targetplatform指向具有mscorsn.dll文件的特定.NET文件夹,但没有效果。
发布于 2016-05-20 10:08:37
我找到了答案。ILMerge似乎需要Windows3.5,默认情况下这在Windows8、8.1或10中不存在。安装.NET 3.5后,ILMerge工作得很好。
https://stackoverflow.com/questions/35925123
复制相似问题