C# 应用程序要求(.NET 除外)
人们究竟需要什么才能以可执行形式使用我的 C# Windows 应用程序?我确实知道计算机上必须安装.NET 框架,但我听说还有更多。除了通过“发布”进行可安装形式之外,还有什么方法可以传播应用程序?我的意思是,需要哪些项目文件?只有 exe 文件,还是这些 pdb 和清单文件?它们必须来自 bin/debug 或 bin/Release,还是没有区别? (我知道用这个应用程序创建的文件保存在“调试”中)因为我需要向某些具有.NET框架的人展示我的程序(作为exe)...
What exactly is needed for someone to use my C# windows application in executable form? I do know that .NET framework has to be installed on the computer, but I heard there is much more. And is there any way to spread the application besides doing installable form via "Publish"? I mean, which project files are needed? Only exe file, or these pdb and manifest files too? Do they have to be from bin/debug or bin/Release, or makes no difference? (I know files created with this application are saved in "debug") Because I need to show my program (as exe) to certain person with .NET framework...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您实际上只需要 .NET 框架,除非您使用了第三方组件。
如果您在解决方案中使用打包和部署项目,它将自动为您生成一个 .msi 文件,其中包含您的应用程序需要安装的所有内容。
如果您需要应用程序抛出的任何异常中的文件和行号详细信息,则需要 .pdb 文件。如果您将应用程序作为产品出售,请勿包含它们,因为该信息会带来安全风险。如果它是内部应用程序,请考虑将它们包含在您的包和部署项目中,因为它是通过异常日志获取的有用信息。
You only really need the .NET framework, unless you've used third party components.
If you use a Package and Deployment project in your solution it will automatically generate a .msi file for you with everything that your app needs to be installed.
You need .pdb files if you want file and line number detail in any exceptions thrown by your app. If you're selling the app as a product, don't include them as that information poses a security risk. If it's an internal app, then consider including them in your package and deployment project, because it's useful information to get with exception logs.
对于运行时等,.NET 应该足够了。或者使用一些工具(例如通过 MonoTouch 和其他一些工具使用的工具),甚至不是这样。
对于应用程序来说,只有 exe 是必需的,但是可能有许多其他必需的文件 - 可能是配置文件,或者可能支持非 CLR dll(第三方 dll)也许)。
对于部署,您可以仅使用 exe 等(xcopy 部署)、ClickOnce (
.application
) 或安装程序 (.exe
/.msi
)。For runtime etc, .NET should be enough. Or with some tools (like as is used via MonoTouch and some others), not even that.
For the application, just the exe is necessary, but there can be lots of other required files - a config file perhaps, or maybe supporting non-CLR dlls (third party dlls perhaps).
For deployment, you can just use the exe etc (xcopy deployment), or ClickOnce (
.application
), or an installer (.exe
/.msi
).最好的选择是向他们提供 bin/release 文件夹中的文件。
PDB 文件(您只能在调试文件夹中找到)包含用于调试应用程序的符号,因此您不需要向它们提供这些符号。
还有其他选项,例如 ClickOnce 部署或 MSI,但听起来您只需要暂时仅向一个人显示此选项,因此不值得走这条路。
简而言之,只要用户在其计算机上安装了正确版本的 .NET Framework,并且您为他们提供了 bin/release 文件夹中的所有相关文件(EXE 文件、您的应用程序引用的任何其他 DLL,以及任何杂项文件(例如 app.config 文件),他们应该能够正常运行它。
The best option is to give them the files from your bin/release folder.
PDB files (which you should only find in your debug folder) contain the symbols for debugging your application, so you don't need to give them those.
There are other options such as ClickOnce deployment or an MSI, but it sounds like you just need to temporarily show this to only one individual, so it won't be worth it to go down this path.
In short, as long as the user has the correct version of the .NET framework installed on their machine, and you give them all of the relevant files from your bin/release folder (the EXE file, any additional DLLs that your application references, and any miscellaneous files like an app.config file), they should be able to run it just fine.