首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法用mscorsn.dll加载DLL mscorsn.dll

无法用mscorsn.dll加载DLL mscorsn.dll
EN

Stack Overflow用户
提问于 2016-03-10 19:07:03
回答 1查看 3.2K关注 0票数 1

我正在尝试编译一个项目,该项目使用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文件夹,但没有效果。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-20 10:08:37

我找到了答案。ILMerge似乎需要Windows3.5,默认情况下这在Windows8、8.1或10中不存在。安装.NET 3.5后,ILMerge工作得很好。

  • 程序与特性->
  • 打开或关闭->的Windows功能
  • .NET框架3.5 (包括.NET 2.0和3.0)
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35925123

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档