locked
Why are Web.Debug.config and Web.Release.config marked as "Content" instead of "None" ? RRS feed

  • Question

  • User-1030575685 posted

    Hi,

    When I create a new Web project in Visual Studio, the Web.Debug.Config and Web.Release.Config files are marked as "Content".

    I always go back and change the type to "None" because after I transform the Web.Config, the files are no longer needed and I don't want them on the server.

    I should proabably be asking this question on connect.microsoft.com, but I'm just curious why they are marked as Content by default.  They do not need to be deployed.

    Does anyone know?

    Friday, August 30, 2013 1:50 PM

Answers

  • User1070236303 posted

    When you deploy/publish your web project, the Web.Debug/Release.Config files won't be published at all. You can leave the files marked as content.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 1, 2013 4:57 AM
  • User-1454326058 posted

    Hi tomballard,

    Thanks for you post!

    Based on my test, I find there is difference between Visual Studio 2010 with Visual Studio 2012.

    In Visual Studio 2010 they are both included in Content. However in visual Studio 2012 they are both included in None.

    So, in my opinion, I think that is by design.

    On the other hand, I am agree with stmarti said that the Web.Debug or Release.Config files won't be published at all.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 2, 2013 5:26 AM

All replies

  • User1070236303 posted

    When you deploy/publish your web project, the Web.Debug/Release.Config files won't be published at all. You can leave the files marked as content.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 1, 2013 4:57 AM
  • User-1454326058 posted

    Hi tomballard,

    Thanks for you post!

    Based on my test, I find there is difference between Visual Studio 2010 with Visual Studio 2012.

    In Visual Studio 2010 they are both included in Content. However in visual Studio 2012 they are both included in None.

    So, in my opinion, I think that is by design.

    On the other hand, I am agree with stmarti said that the Web.Debug or Release.Config files won't be published at all.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 2, 2013 5:26 AM
  • User-1030575685 posted

    Yep, I saw that - in VS2012 they are marked as None by default.

    And I did verify that even when they are marked as "Content", they are not published when I use "Publish" dialog box from inside Visual Studio 2012.

    Interestingly, they *are* included when marked as Content when I build from the command line like this, and they are not when they are marked as None:

    msbuild /p:Configuration=Release /t:Rebuild,ResolveReferences,TransformWebConfig,_CopyWebApplication WebApplication1.csproj

    But since they are marked as None by default I will definitely go back and change the type from Content to None for my old VS2010 projects.

    Thanks both of you!

    Tuesday, September 3, 2013 1:31 PM