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 270687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:02:31+00:00 2026-05-12T00:02:31+00:00

I have a generated (via MSBuild) Web.config that runs prior to the Build target

  • 0

I have a generated (via MSBuild) Web.config that runs prior to the Build target whose content includes, among other things, <compilation debug=”true”>. The generated Web.config is copied to the root and put in the Content item group. But when I run the Debug build in Visual Studio 2008 (via F5) I get the following dialog:

Debugging Not Enabled

If I select “Add …” and click OK it appears to add the generated Web.config to the project and it shows up in the IDE as a project file. So maybe the question should be: Why does the Web.config file need to be a part of the project?

I’d really like to avoid including generated config files in the project because of source control. If the Web.config file is there when the application runs I don’t see why Visual Studio should be concerned. So is there a way for Visual Studio to accept a generated Web.config without it being added through the IDE?

  • 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-12T00:02:32+00:00Added an answer on May 12, 2026 at 12:02 am

    Turns out Visual Studio requires the Web.config to part of the project, no ifs, ands or buts. This MSDN article seems to imply it anyway.

    To get around this I had to create a Web.config in the root, remove everything in the <configuration> element effectively leaving it empty and add it to the project. Then in one of my custom build targets, backup the empty Web.config and copy the generated Web.config to the root. In addition to that, my custom clean target restores the backed-up Web.config. With the above steps source control and Visual Studio are oblivious to my slight of hand.

    This workaround makes me cringe so if anyone has a real solution I’ll gladly change my selected answer.

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

Sidebar

Related Questions

I have a set of radio buttons that are dynamically generated (via JSON call):
I have some dynamic links that are generated via an e-commerce plugin. They have
I am trying to invoke method via webservice (SOAP) I have generated Web service
I have many forms generated dynamically via PHP. I'm trying to verify that all
I have a form that is generated via ajax based of a multi-file uploader
I have an AST generated via ANTLR, and I need to convert it to
I have some set of xml generated via xmlserialization of some WCF messages. Now
I have to expose an ejb service layer via jax-ws . I have generated
I am attempting to build a simple WPF Application using msbuild via a custom
Suppose I have three classes A,B and C generated via emit/reflection abilities of .NET

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.