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

  • Home
  • SEARCH
  • 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 6119527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:33:48+00:00 2026-05-23T15:33:48+00:00

Possible Duplicate: Use Visual Studio web.config transform for debugging I have an asp.net application

  • 0

Possible Duplicate:
Use Visual Studio web.config transform for debugging

I have an asp.net application with three web.config transformations.

enter image description here

I was thinking when I launch debug running (F5 with Debug mode selected) the transformations written in the Web.Debug.config will apply.. But it doesn’t work.. the Web.config used is the “Base” one.

You will tell me : “The transformation aren’t right”.. But they are because when I make a deploy (right click/publish) with debug release config :
enter image description here

The rendered web.config have modifications! So it works, but the debug running is using the base web.config.. Is there a place I can configure that?

  • 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-23T15:33:49+00:00Added an answer on May 23, 2026 at 3:33 pm

    EDIT: Much more refined approach can be found on SO:
    Use Visual Studio web.config transform for debugging

    I had commented that I too would like this feature but hadn’t found a way to do it yet. Then decided to have a quick google.

    A discussion here has lead me to one possible solution provided by cmac3095:

    I don’t mess with MSBUILD that much
    but my solution was to add a custom
    target to the XXX.Web.csproj that did
    the transform and then add a custom
    "Post build" event to the
    XXX.Web.csproj that invoked MSBUILD
    (to perform the transform) and an
    XCOPY to copy the transformed
    web.config over the original. One side
    effect is that, as we have TFS, it
    always contains the last web.config
    that was transformed which can be a
    bit usettling (you keep thinking one
    of your other developers has
    overwritten your settings – which, in
    a sense, they have ;-)….but, of
    course, your settings are in the
    web.xxxxxx.config you use in the
    transform. Okay, enough explanation.
    Here’s what you do: Copy and paste
    this into you XXXX.Web.csproj just
    above the commented out "Target
    Name="BeforeBuild" element…

    <UsingTask TaskName="TransformXml"
               AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
    <Target Name="Transform">
        <MakeDir Directories="obj\$(Configuration)"
                 Condition="!Exists('obj\$(Configuration)')"/>
        <TransformXml Source="Web.Config"
                      Transform="Web.$(Configuration).config"
                      Destination="obj\$(Configuration)\Web.config"
                      StackTrace="true"/>
    </Target>
    <Target Name="AfterBuild">
    </Target>
    

    That’s it. On the next build
    of your xxx.web.config, the post build
    will run the custom target and
    generate transformed web.config. The
    XCOPY will overwrite the existing.

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

Sidebar

Related Questions

Possible Duplicate: Can I use .NET 4.0 beta in Visual Studio 2008? Hot can
Possible Duplicate: Internationalization in SSRS We use SQL Server Reporting Services for our web
Possible Duplicate: Escape string for use in Javascript regex I have a msg like
Possible Duplicate: Using Git with Visual Studio What's the most painless way for the
Possible Duplicate: Watermarked Textbox for Compact Framework Using Visual Studio 2008 SP1, the latest
Possible Duplicate: When to use virtual destructors? let's say i have an abstract class
Possible Duplicate: When do you use the “this” keyword? If I have the following
Possible Duplicate: How do I Embed a font with my C# application? (using Visual
Possible Duplicate: How to Prevent Visual Studio launch WcfSvcHost.exe in Debuggin? When I debug
Possible Duplicate: How do I create a native application using Visual C++ 2008? Can

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.