0

I created a console app that I want to use in a scheduled package in SSIS. In the app, I'm connecting to the database to get email addresses and sending emails to that list. When I put the .exe on the server it won't work, but when I put the whole folder over, it works fine. I'm assuming it needs the app.config.

What's the best way to deploy the exe to the server? Should I publish the console app first, or just build it and take the exe and the app.config (not sure if that's possible)?

2 Answers 2

1

If your .exe needs the app.config either copy the app.config over as well, or alter the program so that whatever relies on the app.config...doesn't...so you don't need to copy the app.config. The second may or may not be a viable option, since we don't know what in your program uses the app.config.

Seems like a fairly simple choice to me. What else were you expecting to hear?

2
  • if I copy the app.config over as well, still doesn't work. If I copy the whole debug or release folder over, and run the exe from that folder, it works fine. I guess I'm just trying to find the lease amount of files I need to deploy. In the past, I only had to drop the exe on the server, but in this app I'm connecting to the database and sending emails, so I guess I'll have to settle with putting the whole debug or release folder on the server......just looking for a simpler solution Apr 9, 2012 at 17:26
  • You should have some feel for what your project dependencies are. If you copy the whole bin/debug folder you're also copying a lot of debugging information which isn't needed. For sitting on a server, it doesn't really hurt much, but if you're giving it to clients it could be more information than you want them to have. You could be referencing other .dlls, using files that the program expects to be in the same folder as the .dll, etc. Even if you are copying the whole file, you should know what your dependencies are.
    – Servy
    Apr 9, 2012 at 17:38
0

Copying whole Bin folder is perfectly valid way of deploying files (sometimes called x-copy deployment).

There could be other files in Bin folder (i.e. referenced assemblies that you marked as "copy" in the project).

You can build more formal install package, but it most likely overkill for simple scenarios.

1
  • ok, thanks. I guess that's the right way to do it. I was just looking for the best/simplest solution. Apr 9, 2012 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.