0

Is it possible to set up my build process so that if I build for release (and publish with Clickonce) then the appRelease.config config file would be used with the production database and other settings instead of the debug one?

This would avoid me having to alter these settings in VS2013 whenever I publish

Our Man in Bananas
  • 5,809
  • 21
  • 91
  • 148
  • Have you tried this: https://msdn.microsoft.com/en-us/library/vstudio/dd465318%28v=vs.100%29.aspx – John Koerner Feb 27 '15 at 14:24
  • possible duplicate of [App.Config Transformation for projects which are not Web Projects in Visual Studio 2010?](http://stackoverflow.com/questions/3004210/app-config-transformation-for-projects-which-are-not-web-projects-in-visual-stud) – John Koerner Feb 27 '15 at 14:28
  • It is technically possible, but you'll have to hack the .vbproj file with a text editor. You however do have to think through this for a bit, the odds that your Release .config file is going to be directly usable by the user should be very close to zero. You need to give him a way to change it anyway so he can hook up your program with his database. That same feature is now also very useful to you. – Hans Passant Feb 27 '15 at 15:19

1 Answers1

0

Switching to Release or Debug is grateful because you can use some compiled statements for debug and other for release Example:

#If Debug Then 
    dim SharedFolder as String ="c:\ApplicationDebugFolder\"
#Else
    dim SharedFolder as String ="\\ProductionFolder\"
#End If

I used all the time when I'm developing the application or even I used it to make some test.

If you select the Debug the compile will only use the code inside of the Debug statement if you select other will use the code inside of the Else statement.

MrAlex6204
  • 167
  • 7