需要 ILMerge 提示

发布于 2024-10-10 13:14:38 字数 1311 浏览 3 评论 0原文

我正在尝试将 vintasoft 条形码 sdk 与我的数据访问 dll 合并,但在 ilmerge 后它不起作用。欢迎任何想法,

这里是错误:

IndexOutOfRangeException: Index was outside the bounds of the array.]
2.┌.©(Byte[] param0) in :0
2.┌..cctor() in :0

[TypeInitializationException: The type initializer for '2.┌' threw an exception.]
2.┌.¥Σ() in :0
Vintasoft.Barcode.WriterSettings..cctor() in :0

[TypeInitializationException: The type initializer for 'Vintasoft.Barcode.WriterSettings' threw an exception.]
Vintasoft.Barcode.WriterSettings..ctor() in :0
Vintasoft.Barcode.BarcodeWriter..ctor() in :0
_Default.buttonGenerateBarcode_Click(Object sender, EventArgs e) in E:\ILMergeSample\WebBarcodeWriterDemo\QRBarcode.aspx.vb:27
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

提前致谢

I'm trying to merge vintasoft barcode sdk with my data access dll and it's not working after ilmerge. Any ideas are welcome

here is the error:

IndexOutOfRangeException: Index was outside the bounds of the array.]
2.┌.©(Byte[] param0) in :0
2.┌..cctor() in :0

[TypeInitializationException: The type initializer for '2.┌' threw an exception.]
2.┌.¥Σ() in :0
Vintasoft.Barcode.WriterSettings..cctor() in :0

[TypeInitializationException: The type initializer for 'Vintasoft.Barcode.WriterSettings' threw an exception.]
Vintasoft.Barcode.WriterSettings..ctor() in :0
Vintasoft.Barcode.BarcodeWriter..ctor() in :0
_Default.buttonGenerateBarcode_Click(Object sender, EventArgs e) in E:\ILMergeSample\WebBarcodeWriterDemo\QRBarcode.aspx.vb:27
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月下凄凉 2024-10-17 13:14:38

就像莱皮所说,合并混淆的程序集通常会导致问题。

一种替代方法是将有问题的 dll 粘贴到嵌入式资源中,然后使用

byte [] bytes = Resources.SomeAssemblyDll;
Assembly.Load(bytes);

我们在 AppDomain 的程序集解析器中按需执行此操作:

AppDomain.CurrentDomain.AssemblyResolve += new 
    ResolveEventHandler(CurrentDomain_AssemblyResolve);

我们在其中测试框架正在查找的程序集,并在需要时从嵌入式资源加载它。

Like leppie said, merging obfuscated assemblies usually leads to problems.

One alternative is to stick the offending dll into an embedded resource, and load it from there using

byte [] bytes = Resources.SomeAssemblyDll;
Assembly.Load(bytes);

We do it on demand in our AppDomain's assembly resolver:

AppDomain.CurrentDomain.AssemblyResolve += new 
    ResolveEventHandler(CurrentDomain_AssemblyResolve);

where we test what assembly the framework is looking for, and if needed load it from the embedded resource.

瞄了个咪的 2024-10-17 13:14:38

您正在尝试合并混淆的程序集。机会很大,但根本行不通。

You are trying to merge an obfuscated assembly. Chances are good, it wont work at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文