使用.exe文件启动我的c#应用程序 [英] Start my c# application using its .exe file

查看:128
本文介绍了使用.exe文件启动我的c#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我在C#中完成了一个应用程序,现在我想使用我找到的文件.exe / bin / Debug启动它。



.exe文件只有在我将它保存在文件夹/ bin / Debug中,或者如果我重新复制整个文件时才有效在其他地方的文件夹。



应用程序引用了一些可以在/ bin / Debug中找到的.dll,我认为这是问题所在。



事实上,我只使用.exe文件,将它移动到任何我想要的地方,在任何其他计算机上没有随身携带500mb库.. exe只有2mb!



有没有办法创建一个独立的.exe,它不需要存在.dll文件?当然,有......但我不知道!谁给了我一些帮助?



提前致谢!

Massimiliano C.

Hello everyone!

I finished an application in C # and now i want to use its file .exe that i find in the /bin/Debug to get it started.

The .exe file only works if I keep it in the folder / bin / Debug, or if i recopy the entire folder somewhere else.

The application refers to some .dll that can be found in /bin/Debug, i think it''s the problem.

The fact is that i would use only .exe file, move it wherever i want, in any other computer without carry around 500mb libraries .. exe is only 2mb!

Is there a way to create an "indipendent" .exe, which doesn''t require the presence of the .dll files? Surely, there''is.. But I don'' t know! Who gives me some help?

Thanks in advance!
Massimiliano C.

推荐答案

只要您的所有.DLL都是.NET程序集而不是本机代码,您就可以使用 Ilmerge [ ^ ]构建一个可执行文件。



但是,如果你使用的是500MB的.DLL',那么你得到的可执行文件将是关于500MB!你可以免费得到你想要的东西!



除此之外,没有办法做你想做的事。
So long as all of your .DLL''s are .NET assemblies and not native code you can use Ilmerge[^] to build a single executable.

But, if you''re using 500MB worth of .DLL''s, your resulting executable will be about 500MB!! You do get what you want for free!

Other than that, there is no way to do what you want.


在Release模式而不是Debug模式下编译,从/ bin / Release文件夹中获取EXE。
Compile in Release mode rather than Debug mode and get the EXE from the /bin/Release folder.


这篇关于使用.exe文件启动我的c#应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆