C# 编译我的代码仅适用于我的电脑,不适用于其他人

发布于 2025-01-15 04:50:22 字数 281 浏览 6 评论 0原文

我的代码是在 NET Framework 4.7.2 中构建的,它使用两个 .dll siticone.dll + windowsinput.dll

如何让我的代码被其他人使用并包含这些 .dll。我非常确定这是由这些 .dll 引起的,因为当我制作一个新的 WinForms 应用程序时,我的朋友可以打开该代码,但不能打开包含这些 .dll 的主应用程序!

PS:打开代码时,它位于任务管理器中,但实际上并未打开

My code is built in NET Framework 4.7.2, it uses two .dlls siticone.dll + windowsinput.dll.

How do I let my code be used by others and include these .dlls. I am highly certain this is caused by those .dlls, as when I make a new WinForms app my friends can open that code but not my main one that has these .dlls!

P.S: on opening the code it sits in Task manager but does not physically open

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

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

发布评论

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

评论(1

堇年纸鸢 2025-01-22 04:50:22

对我有用的:Costura Fody,一个包含 .dll 供您执行的 NuGet。

您还可以使用“嵌入互操作文件”,但经过一番挖掘和测试后,我发现它在某些版本上不起作用,很多人说将其关闭。

我在 Costura.Fody 中遇到的另一个错误是您可能需要从中删除 .dll您的参考文献,然后将它们添加回来。

附言。如果您愿意,您还可以使用安装程序(例如 inno setup),但我发现将所有内容都放在执行中要简单得多。希望这有帮助,就像每个人都帮助过我一样:)

What worked for me: Costura Fody, a NuGet that includes .dlls to your execute for you.

You can also use "Embed Interop Files" but after some digging and testing myself I found it didn't work on certain versions and lots of people saying to turn it off.

Another error I had with Costura.Fody which I figured out was you may need to remove the .dlls from your references and add them back in afterwards.

PS. You can also use an installer (like inno setup) if you like but I find it much simpler having it all inside of the execute. Hope this helps like everyone has helped me :)

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