Resolved Making a standalone EXE in VS

Post number 2 has been selected as best answer.

Pin-Lui

New member
Joined
Mar 22, 2020
Messages
2
Programming Experience
Beginner
Hello, I made myself a Console Application. It does various stuff in the base directory where the exe file is placed.
When I publish my project I get the following files:
  • MyAPP.deps.json
  • MyAPP.dll
  • MyAPP.exe
  • MyAPP.pdb
  • MyAPP.json
The app needs all files or otherwise it will just close after the start.
How can I publish my project to get a single EXE file?
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,860
Location
Sydney, Australia
Programming Experience
10+
Publishing creates an installer. If you don't want an installer then don't publish. You're creating an EXE every time you build so just deploy that if that's all you want. Just be sure to change the build configuration to Release and use that EXE rather than a Debug one.

Based on that output, it appears that you have created a .NET Core project. You can safely ignore the PDB file but I'm not sure whether the JSON files can be ignored. The DLL certainly can't. If you targeted .NET Framework rather than .NET Core then you could just deploy the EXE.
 

Pin-Lui

New member
Joined
Mar 22, 2020
Messages
2
Programming Experience
Beginner
If you targeted .NET Framework rather than .NET Core then you could just deploy the EXE.
Made a new Framework Project, Imported my classes and it now works exactly as I want, thank you very much.
 
Last edited:

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,860
Location
Sydney, Australia
Programming Experience
10+
Be aware that the .NET Framework is inclusive of a big class library that all .NET Framework apps can make use of. Part of the reason for .NET Core is that people wanted to be able to pick and choose the parts of the .NET class library they wanted.
 
Top Bottom