Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6662373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:22:58+00:00 2026-05-26T02:22:58+00:00

I have an Asp.NET MVC site that I manage multiple instances of. Each instance

  • 0

I have an Asp.NET MVC site that I manage multiple instances of. Each instance uses it’s own database but the code base is all the same. To facilitate this I have several build configurations with matching web.config transforms, so that when I publish it doesn’t use my development database but instead uses the specific database for that site instance.

The problem with this came today when I went to publish an update to one of the sites. I forgot to change the build configuration, so my publish to site A was using a web.config transform that was meant for site B, and mayhem and confusion ensued.

Is there any way to to specify that a specific publish target will ONLY be used with a specific build configuration?

Or is there a better way to handle this situation than juggling build configurations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:22:58+00:00Added an answer on May 26, 2026 at 2:22 am

    Maybe you could go a solution where you don’t rely on the ‘Publish’ dialog of the web application that requires you to make the right setting every time, but instead use a automated command-line like solution (batch file, your own msbuild target, or a build server like CStroliaDavis suggested [cruisecontrol, tfs, teamcity]).

    You can just call the ‘package’ target from command line which creates a package:

    msbuild MyWebProject.csproj /t:Package /P:Configuration=Release;DeployIisAppPath="Default Web Site/Main/MyWebProject";PackageLocation="F:\MyWebProjectDeploy.zip"
    

    This also creates a *.cmd file so you can deploy it like this:

    F:\MyWebProjectDeploy.deploy.cmd /Y -allowUntrusted /M:http://webserver/MSDeployAgentService /U:Administrator /P:"Secret"
    

    You can add a custom *.msbuild file to your solution that performs these actions, or maybe it’s easiest to just add a command to Tools -> External tools.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET MVC site that uses forms authentication with custom AuthorizeAttribute on
I have an ASP.NET MVC site that uses both Microsoft Ajax [ Ajax.BeginForm() ]
I have an asp.net mvc 3 site that with my own authorize attribute. When
I have an ASP.NET MVC 3 web site that uses Windows Authentication running under
I have an ASP.Net MVC site that has a subdomain for each customer e.g.
I have a very simple CRUD asp.net-mvc site that uses nhibernate to interface with
I have an ASP.NET MVC intranet site that uses Windows Authentication (Kerberos) exclusively with
I have a asp.net mvc site that references a couple of libraries. Recently I
I have an ASP.NET MVC 3 site that makes use of a ClientDependency framework
I have an ASP.NET MVC site and ELMAH is showing me that my site

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.