0

I have a simple C# project in visual studio 2017.

It is a Console Application (.NET Framework).

I want to compile it to an .exe and then copy that .exe to the server where it will run.

When I do: Build -> Publish MyApp I get a setup.exe file with a bunch of other files that I presume setup.exe would use to install on the target machine.

When I do: Build -> Build MyApp VS comes back instantly without any popup. I can see a .exe here: MyApp\bin\Debug\MyApp.exe that has a timestamp that indicates it was built from Build -> Build MyApp

I want to control where the .exe is deployed on the server because we already have a scheme that adds version numbers to the .exes so they are well controlled for backing them out and we know exactly what is changing on the server (this is in contrast with running a setup.exe).

Should I just use the MyApp\obj\Debug\MyApp.exe? [Seems strange that I would use a .exe from the Debug folder].

What other build options should I try?

Be Kind To New Users
  • 9,672
  • 13
  • 78
  • 125
  • 1
    Use the bin folder, not obj. See https://stackoverflow.com/questions/5308491/what-are-the-obj-and-bin-folders-created-by-visual-studio-used-for – Broots Waymb Sep 11 '17 at 20:41
  • Thanks, I am going to revise my question using bin rather than obj; the same questions still apply. Thx. – Be Kind To New Users Sep 11 '17 at 20:43
  • "I want to compile it to an .exe and then copy that .exe to the server where it will run." Then do it. What's in the `bin` folder is the result of the compilation. What you do with it is up to you. (Although I suggest you build in release mode.) In more professional setups, there are dedicated build servers that build the executables from source and deploy them. This presumes a source control system. – Jeroen Mostert Sep 11 '17 at 20:57
  • Ahh, the release mode is what I was missing. I should have made it clear in my question that I was thrown off by the Debug in the directory PATH. I will look for release mode. I inherited this system without source control, first thing I did was throw the code in SVN to get my arms around it. I am dealing with a "bus problem". I am just stepping in until we can hire someone that knows .Net. – Be Kind To New Users Sep 11 '17 at 21:12

0 Answers0