2

I am wanting to have a deployment process for console applications, similar to the web deployments. I am looking for a way to copy all the contents of the "Release" directory into a network share directory via VS deployment process.

I know, this seems strange, however, these applications are used for batch for internal jobs. However, they have to go thru the development process, dev, uat, production. Since our process is only to copy/paste and not install, I am limited to this process. The problem with copy/pasting from the UAT environment is that we are getting UAT server settings instead of production. I'm trying to make this as efficient as possible without having our deployment team do much thinking.

So the main question: What is the process to deploy a console application from visual studio where the results are, essentially, copy/pasting from the Release directory to the target directory on the remote server?

Aaron Ward
  • 57
  • 3
  • 10

2 Answers2

2

I think you are asking for a mix of things:

  1. how to transform configuration files to target a specific environment
  2. how to automatically copy the binaries and the transformed configuration files

The VS Publish button does both.

For #1 you need to define a Compile Configuration for each target environment and a Transform file. Non-web apps can use the add-in described in App.Config Transformation for projects which are not Web Projects in Visual Studio 2010?.

For #2 there are plenty of solutions: you can make your own add-in that adds a Publish button, or hook the standard build process (see https://www.simple-talk.com/dotnet/.net-tools/extending-msbuild/) or simply wrap the build of your VS solutions in a script that does the deploy after compile. The more complete process would be to implement a continuous Integration Server that allowed different Environment configurations to be created as part of the build and deploy process.

Community
  • 1
  • 1
Giulio Vian
  • 8,248
  • 2
  • 33
  • 41
0

It depends on whether your application references any external resources like files, registry settings, other applications and libraries, etc. The remote server must have same resources, same environment for application to work properly. The application itself could be just copied to arbitrary location.

OpenMinded
  • 496
  • 3
  • 10
  • The application does reference other libraries, etc. However, during the build process, everything the application needs to run is copied into the Debug/Release directory. What I need is the publish process to copy from the Release directory to an arbitrary directory and then complete. What is the best way to do this? – Aaron Ward May 13 '13 at 17:18
  • Just copy the contents of the Release directory. You could try this locally - copy the contents of the Release directory to different location and try to run a program. It won't crash if everything it needs is indeed inside the Release directory. But it really depends on what your program does. There may be such things like firewall rules, machine.config settings. Even console apps may require installer sometimes. – OpenMinded May 13 '13 at 17:45
  • The current approach is to copy the directory - this works fine. What I am looking for is a way to utilize VS Publish functionality. I would like to simply hit publish and the contents of the configuration folder be copied to whatever folder we establish for the projects directory. What is the best approach in doing this? – Aaron Ward May 13 '13 at 18:05