Why does Microsoft not allow you to link a build configuration to a publish profile. Instead it tells you to use the dropdown in the main VS interface.
I find this extremely annoying, because we use config transforms to change our config settings based on the environment we are publishing to (such as database connection strings). We also check-in the .Publish.xml file, so that the publish paths are saved in source control. If someone forgets to change the build configuration they could accidentally publish test to production or vice versa. If we could check in the build configuration selection 开发者_JAVA百科with the publish profile we would not have this issue.
Does anyone know if Microsoft plans on changing this in the future?
By pure luck, I found this:
http://blogs.msdn.com/b/webdev/archive/2012/06/15/visual-studio-2010-web-publish-updates.aspx
If you install this update (related to Azure), then the publishing tools are updated to a wizard type interface that DOES tie a publish profile to a specific build configuration.
I don't really understand why this is tied to Azure, but it works perfectly for all types of publishing (I use the publish to a folder option). No more publishing with the wrong build configuration!
To get around this, you can write a batch script to do both parts of the process. Use MSBuild to build your projects in the required build configuration (we use release for our web apps). If all you need to do is copy the output, MSBuild should be able to do that for you as well with a copy task. If you need to deploy a web application, use MSDeploy command line tools to complete the publish command. Going command line with both of these tools opens up a lot of customization.
I very much agree that this should be implemented. It's currently very easy to make fatal mistakes when publishing.
Seems like this will be (/has been) fixed for Visual Studio 11 but won't be changed for Visual Studio 2010: https://connect.microsoft.com/VisualStudio/feedback/details/690284/publish-profiles-do-not-include-build-configuration
精彩评论