Can I force Visual Studio to use only the release build configuration for my publish publish profile?

I have two publishing profiles defined for my project in Visual Studio 2010: one uses ftp for production, and the other for my local file system for debugging and day-to-day development.

I have web.config conversions for debug and release configuration. My project is an application for Facebook in which I set the application identifier and secret depending on the deployment.

I would like to be able to apply the rule in such a way that it is not possible to use the ftp publish publish profile with the debug build configuration. This combination will be catastrophic and completely disrupt my production environment.

How can I apply this rule?

I am open to alternative deployment methods, but I am very pleased with the simplicity of what I have now, except for the ability to ignore the assembly configuration when clicking on production.

+7
source share
3 answers

I came to the conclusion that this is not possible, so apparently the answer is ... NO

+2
source

I do not need to use the publication for anything other than production. You said that you publish Debug assemblies on other servers, so my solution will not work for you, but it can work for others without this need.

You can effectively deploy the Release assembly to the publication by breaking the Web.Debug.config conversion. Any syntax error will be executed, but I prefer this change to the root tag:

<configuration_ONLY_PUBLISH_IN_RELEASE_CONFIG!! xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 

When someone tries to post to Debug, they will receive an error message with this tag, indicating a solution.

Note that you can still create and run locally using the Debug assembly, rather than publish.

+7
source

I posted a related question here: configure the assembly in the publication profile , asking why you cannot do this. Hopefully someone finds out if Microsoft plans to change this.

0
source

All Articles