简体   繁体   中英

How to export a program from Visual Studio 2019?

I'm trying to export a text-based game, existing entirely in the command prompt, from Visual Studio 2019. The game is written in C# with .NET Framework 4.6.

I've been trying everything to think of to get it to export, and it always works fine on my machine. Yet, as soon as it's on another person's machine, the same error is encountered: The program opens as a command prompt, then disappears immediately. Given that the program mostly relies on Console.ReadLine(), I don't believe that it could be finishing its execution and closing automatically.

I don't quite understand how to export this game in a way that will function. I've been experiencing this error solely on Windows computers (the program is only designed to run on Windows computers). I've tried exporting it both as Framework-reliant and Self-Contained. Even with Self-Contained, the error persists.

I've tried building and cleaning the game, publishing it from both the terminal and the "Publish" screen, trying all sorts of different settings. I really don't know what I'm doing wrong. Any help would be much appreciated!

If it helps, this is the settings I'm currently trying.

Visual Studio Publish Settings

A similar question may help you

You have not described how you export your application. I suggest the following solution:
Build your application, sure that you have.exe in bin\debug.
Archive your solution and share on other machine.

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