创建动态程序集后如何更改其名称?

发布于 2024-08-26 08:49:30 字数 208 浏览 4 评论 0原文

有没有办法在创建动态程序集后更改其名称?我正在使用一个使用动态方法的框架,并且它正在创建一个与我的主程序集同名的动态程序集(这会在尝试加载资源时导致 WPF 出现问题)。所以我需要找到一个解决方法,我想到尝试更改动态程序集的名称。

我尝试使用 GetName(),然后设置 Name 属性,但 GetName 似乎返回名称的克隆,因为我的更改没有保留。

我还能尝试什么?

Is there any way to change the name of a dynamic assembly after it has been created? I'm using a framework that uses dynamic methods, and it is creating a dynamic assembly with the same name as my main assembly (which causes problems with WPF when it tries to load resources). So I need to find a workaround, and I thought of trying to change the name of the dynamic assembly.

I've tried using GetName() and then setting the Name property, but it appears that GetName returns a clone of the name because my change doesn't stick.

What else can I try?

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

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

发布评论

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

评论(1

悸初 2024-09-02 08:49:30

您应该能够使用通用编译器基础结构来修改保存的程序集并更改存储的程序集名称。

You should be able to use the Common Compiler Infrastructure to modify the saved assembly and change the stored Assembly Name.

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