简体   繁体   中英

What does the end user need to run a C# console program?

I made a console game using Visual C# 2008 Express, the entire game only uses stuff from the System namespace, no fancy third party libraries, and all it requires is 2 folders in the root directory for storing XML files that it creates. I could even go into the Debug folder and copy the application and 2 folders and paste them elsewhere and they'll work. So I'm thinking I could just distribute the game as a zipped folder.

What I want to know is what is the bare minimum an end user who does not have Visual Studio installed need to run this game? I looked at one of my non-programmer friends and she has over 10 things with "Microsoft Visual" in their names like the .NET framework and Redistributable Package in her installed programs list. I don't really know what any of those are for.

They will need to have the Microsoft .NET Framework installed - whichever version you're using, or a later one. That's all.

These days most Windows users are likely to have at least .NET 2 installed, and quite possibly a later version. If not, you can always point them to the redistributable to be downloaded and installed.

There shouldn't be any need for anything with "Visual" in the name.

One option for .NET 3.5 and onwards is to target the "Client Profile" in your project - this is a smaller download for end-users.

The .NET framework is essential for every C# program. The .NET framework contains those namespaces you use. To my knowledge you can not install a part of it , you just have to install it whole .

But be careful when storing files. Usually your programs will be installed in the program files folder in which regular users don't have write rights. Use the %APPDATA% special folder to store any data files that your program must edit.

If you have not used third-party components that you just installed on the target PC NETFramework you used to create your application.

Regards.

Please refer this question on deployment of C# applications on the desktop environment.

It has interesting answers regarding best practices when deploying c# applications for the desktop.在为桌面部署 c# 应用程序时,它有关于最佳实践的有趣答案。

To your specific question I think Jon has summed it up perfectly in his answer. Nothing with 'Visual' is required.

Cheers!

You can also target a different Framework. If you don't need .NET 4.0 stuff, target .NET 3.5. If you not even need .NET 3.5 stuff, then target .NET 2.0. So users with only older versions installed will be able to play your game. They never need to have any Visual Studio version installed!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM