简体   繁体   English

C# 编译我的代码只适用于我的电脑,没有其他人

[英]C# Compiling my code only works for my PC and no one elses

My code is built in.NET Framework 4.7.2 , it uses two.dlls siticone.dll + windowsinput.dll .我的代码内置于 .NET Framework 4.7.2中,它使用 two.dlls siticone.dll + windowsinput.dll

How do I let my code be used by others and include these.dlls.如何让我的代码被其他人使用并包含这些.dll。 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!我非常确定这是由 those.dlls 引起的,因为当我制作一个新的 WinForms 应用程序时,我的朋友可以打开该代码,但不能打开我的主程序有这些.dlls!

PS: on opening the code it sits in Task manager but does not physically open PS:打开代码时,它位于任务管理器中,但实际上并未打开

What worked for me: Costura Fody , a NuGet that includes.dlls to your execute for you.对我有用的是:Costura Fody ,一个 NuGet,其中包含 .dll 文件,可以为您执行。

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.我发现Costura.Fody的另一个错误是您可能需要从引用中删除 .dll,然后再将它们添加回去。

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.如果愿意,您也可以使用安装程序(如 inno setup),但我发现将其全部包含在执行中要简单得多。 Hope this helps like everyone has helped me:)希望这会有所帮助,就像每个人都帮助过我一样:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的emgu cv(c#)代码仅在一个图像上起作用,而在其他图像上崩溃 - My emgu cv (c#) code only works on one image and crash for other image 带有 sql server 的 C# wpf 应用程序只能在我的电脑上运行 - C # wpf application with sql server works only on my pc 压缩的.wav文件仅在我的PC上可用(C#) - Zipped .wav file only on my pc available (C#) 如何使用我的C#代码使用psexec在远程PC上安装 - How to install on remote PC with psexec with my c# code 问题查询数据库-仅在我的PC上有效 - Issues querying database - works only on my PC 使用 C# 获取存储过程的参数仅在我在代码中放置断点时才有效 - Getting out parameter of stored procedure with C# only works when I put a breakpoint in my code C#MysqlConnector可在我的一台计算机上运行,​​但不能在另一台计算机上运行 - C# MysqlConnector works on one of my computers but not on another computer C# 软件中的“NetUseAdd”可在一台电脑上运行,但不能在另一台电脑上运行(错误 1232) - "NetUseAdd" in C# software works on one pc, but not another (Error 1232) 由MySQL支持的Entity Framework应用程序仅在我的PC上有效 - Entity Framework app backed by MySQL works only on my PC 为什么我的组合框只显示一项? C#MySQL - Why my combobox only shows one item? c# mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM