不允许 IL MergeGUI 未解析的程序集引用
IL MergeGUI unresolved assembly reference not allowed
我运行遇到了问题。连续3天我都解决不了问题。该项目需要报告,因此我将注意力转向了 NuGet Microsoft.Reporting.WinForms.v11。通过将其添加到项目中,我无法再将所有 dll 库收集在一个 exe 中。 IL Merge 显示错误。
求助,谢谢。
IL MergeGUI error
Log IL MergeGUI
Copying 2 Win32 Resources from assembly 'AtlantCRM' into target assembly.
Transferring entry point 'AtlantCRM.Program.Main' from assembly 'AtlantCRM' to assembly 'AtlantCRM'.
There were no errors reported in the target assembly's metadata.
ILMerge: Writing target assembly 'C:\Users\return name\Desktop\AtlantCRM.exe'.
AssemblyResolver: Assembly 'AtlantCRM' is referencing assembly 'PresentationFramework'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
AssemblyResolver: Assembly 'PresentationFramework' is referencing assembly 'PresentationCore'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
AssemblyResolver: Assembly 'PresentationCore' is referencing assembly 'WindowsBase'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
AssemblyResolver: Assembly 'PresentationFramework' is referencing assembly 'System.Xaml'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
Resolved assembly reference 'System.Xaml' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Xaml.dll'. (Used framework directory.)
AssemblyResolver: Assembly 'Bunifu_UI_v1.5.4' is referencing assembly 'System.Management'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
Resolved assembly reference 'System.Management' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Management.dll'. (Used framework directory.)
AssemblyResolver: Assembly 'System.Xml' is referencing assembly 'System.Data.SqlXml'.
AssemblyResolver: Attempting referencing assembly's directory.
Resolved assembly reference 'System.Data.SqlXml' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Data.SqlXml.dll'. (Used referencing Module's directory.)
AssemblyResolver: Assembly 'System.Data' is referencing assembly 'System.EnterpriseServices'.
AssemblyResolver: Attempting referencing assembly's directory.
Resolved assembly reference 'System.EnterpriseServices' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.EnterpriseServices.dll'. (Used referencing Module's directory.)
您可能不想听到这个,但 ilmergeGUI 已经过时了。 .net 4.6 真的打破了它,而且从那以后它变得更糟。我强烈建议改用 CMD 进行编译。您将对合并发生的事情有更多的控制和理解。
编辑:很抱歉没有包括 link。可以找到 Ilmerge 文档 here。第 1 部分和第 2 部分是关于如何在您的代码中使用它,但第 3 部分是我所指的内容。
说明:
打开一个Command Prompt
如果您没有在 windows 中设置路径来查找 ilmerge 命令,您可能需要在每次打开命令提示符时设置路径(假设您的安装位置是典型位置) :
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft\ILMerge
然后您只需 运行 您的 ilmerge 命令按照我在上面 link 编辑的文档。
示例:
ilmerge /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1" /out:"C:\Users\my\Documents\VerificationsMerged.dll" Verifications.dll Newtonsoft.Json.dll
此示例使用 .netframework 版本 4.6.1,但您可以改为将其指向不同的版本,然后将 Verifications.dll 和 Newtonsoft.Json.dll 合并在一起(注意这些假定位于命令提示符的当前文件夹,您可以改为提供绝对路径)并将 VerificationsMerged.dll 保存到我的文档文件夹。
我运行遇到了问题。连续3天我都解决不了问题。该项目需要报告,因此我将注意力转向了 NuGet Microsoft.Reporting.WinForms.v11。通过将其添加到项目中,我无法再将所有 dll 库收集在一个 exe 中。 IL Merge 显示错误。
求助,谢谢。
IL MergeGUI error
Log IL MergeGUI
Copying 2 Win32 Resources from assembly 'AtlantCRM' into target assembly. Transferring entry point 'AtlantCRM.Program.Main' from assembly 'AtlantCRM' to assembly 'AtlantCRM'. There were no errors reported in the target assembly's metadata. ILMerge: Writing target assembly 'C:\Users\return name\Desktop\AtlantCRM.exe'. AssemblyResolver: Assembly 'AtlantCRM' is referencing assembly 'PresentationFramework'. AssemblyResolver: Attempting referencing assembly's directory. AssemblyResolver: Did not find assembly in referencing assembly's directory. AssemblyResolver: Attempting input directory. AssemblyResolver: Did not find assembly in input directory. AssemblyResolver: Attempting user-supplied directories. AssemblyResolver: No user-supplied directories. AssemblyResolver: Attempting framework directory. AssemblyResolver: Did not find assembly in framework directory. AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.) AssemblyResolver: Assembly 'PresentationFramework' is referencing assembly 'PresentationCore'. AssemblyResolver: Attempting referencing assembly's directory. AssemblyResolver: Did not find assembly in referencing assembly's directory. AssemblyResolver: Attempting input directory. AssemblyResolver: Did not find assembly in input directory. AssemblyResolver: Attempting user-supplied directories. AssemblyResolver: No user-supplied directories. AssemblyResolver: Attempting framework directory. AssemblyResolver: Did not find assembly in framework directory. AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.) AssemblyResolver: Assembly 'PresentationCore' is referencing assembly 'WindowsBase'. AssemblyResolver: Attempting referencing assembly's directory. AssemblyResolver: Did not find assembly in referencing assembly's directory. AssemblyResolver: Attempting input directory. AssemblyResolver: Did not find assembly in input directory. AssemblyResolver: Attempting user-supplied directories. AssemblyResolver: No user-supplied directories. AssemblyResolver: Attempting framework directory. AssemblyResolver: Did not find assembly in framework directory. AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.) AssemblyResolver: Assembly 'PresentationFramework' is referencing assembly 'System.Xaml'. AssemblyResolver: Attempting referencing assembly's directory. AssemblyResolver: Did not find assembly in referencing assembly's directory. AssemblyResolver: Attempting input directory. AssemblyResolver: Did not find assembly in input directory. AssemblyResolver: Attempting user-supplied directories. AssemblyResolver: No user-supplied directories. AssemblyResolver: Attempting framework directory. Resolved assembly reference 'System.Xaml' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Xaml.dll'. (Used framework directory.) AssemblyResolver: Assembly 'Bunifu_UI_v1.5.4' is referencing assembly 'System.Management'. AssemblyResolver: Attempting referencing assembly's directory. AssemblyResolver: Did not find assembly in referencing assembly's directory. AssemblyResolver: Attempting input directory. AssemblyResolver: Did not find assembly in input directory. AssemblyResolver: Attempting user-supplied directories. AssemblyResolver: No user-supplied directories. AssemblyResolver: Attempting framework directory. Resolved assembly reference 'System.Management' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Management.dll'. (Used framework directory.) AssemblyResolver: Assembly 'System.Xml' is referencing assembly 'System.Data.SqlXml'. AssemblyResolver: Attempting referencing assembly's directory. Resolved assembly reference 'System.Data.SqlXml' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Data.SqlXml.dll'. (Used referencing Module's directory.) AssemblyResolver: Assembly 'System.Data' is referencing assembly 'System.EnterpriseServices'. AssemblyResolver: Attempting referencing assembly's directory. Resolved assembly reference 'System.EnterpriseServices' to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.EnterpriseServices.dll'. (Used referencing Module's directory.)
您可能不想听到这个,但 ilmergeGUI 已经过时了。 .net 4.6 真的打破了它,而且从那以后它变得更糟。我强烈建议改用 CMD 进行编译。您将对合并发生的事情有更多的控制和理解。
编辑:很抱歉没有包括 link。可以找到 Ilmerge 文档 here。第 1 部分和第 2 部分是关于如何在您的代码中使用它,但第 3 部分是我所指的内容。
说明:
打开一个Command Prompt
如果您没有在 windows 中设置路径来查找 ilmerge 命令,您可能需要在每次打开命令提示符时设置路径(假设您的安装位置是典型位置) :
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft\ILMerge
然后您只需 运行 您的 ilmerge 命令按照我在上面 link 编辑的文档。
示例:
ilmerge /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1" /out:"C:\Users\my\Documents\VerificationsMerged.dll" Verifications.dll Newtonsoft.Json.dll
此示例使用 .netframework 版本 4.6.1,但您可以改为将其指向不同的版本,然后将 Verifications.dll 和 Newtonsoft.Json.dll 合并在一起(注意这些假定位于命令提示符的当前文件夹,您可以改为提供绝对路径)并将 VerificationsMerged.dll 保存到我的文档文件夹。