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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:31:59+00:00 2026-05-15T13:31:59+00:00

I am trying to use the debug and release versions of the webconfig but

  • 0

I am trying to use the debug and release versions of the webconfig but it never works. I am trying to do this for a 3rd party library that I am using called combres.

http://combres.codeplex.com/

So I first put all the needed web.config code in the web.config. Now I have 2 different .xml files(thats where you put your javascript and css paths).

So production will have a different .xml path and so will debug.

So I moved this one line to the release and debug of the web.config and changed the path of the xml file.

    // release webconfig
    <combres definitionUrl="~/App_Data/Combres.xml" />

   // debug webconfig
   <combres definitionUrl="~/App_Data/CombresDevelopment.xml" />

I get this

System.UnauthorizedAccessException was unhandled by user code
  Message=Access to the path 'E: test.com' is denied.
  Source=mscorlib
  StackTrace:
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
       at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
       at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
       at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
       at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
       at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
       at System.Xml.Linq.XDocument.Load(String uri)
       at Combres.ConfigReader.ReadCombresUrl(String filePath)
       at Combres.Configuration.GetCombresUrl()
       at Combres.WebExtensions.AddCombresRoute(RouteCollection routes, String name)
       at MyApp.MvcApplication.RegisterRoutes(RouteCollection routes) in E:\Global.asax.cs:line 19
       at MyApp3.MvcApplication.Application_Start() in E:\Global.asax.cs:line 46
  InnerException: 

line 19 -> routes.AddCombresRoute("Combres");

line 46 -> RegisterRoutes(RouteTable.Routes);

So I don’t understand why I get this error. I thought the webconfig jsut get merged dynamically so why would it work on the top level on but not the .debug one.

Edit

Here is my files(some information removed for security concerns)

Web.config

    <configSections>
        <section name="combres" type="Combres.ConfigSectionSetting, Combres, Version=2.0.0.0, Culture=neutral, PublicKeyToken=49212d24adfbe4b4"/>
        <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorTweet" requirePermission="false" type="Elmah.ErrorTweetSectionHandler, Elmah"/>
        </sectionGroup>
    </configSections>

    <appSettings>....</appSettings>


    <!--<combres definitionUrl="~/App_Data/Combres.xml" />-->
    <!--<combres definitionUrl="~/App_Data/CombresDevelopment.xml" />-->

    <connectionStrings>....</connectionStrings>



    <elmah>
        <errorLog type="Elmah.SqlErrorLog, Elmah" logPath="~/App_Data" connectionStringName="...." />
        <errorFilter>
            <test>
                <equal binding="HttpStatusCode" value="404" type="Int32" />
            </test>
        </errorFilter>
        <security allowRemoteAccess="0" />
    </elmah>

    <system.web>
    <globalization culture="en" uiCulture="en-US" />
    <httpRuntime requestValidationMode="2.0"/>

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>

    <authentication mode="Forms">
    </authentication>

    <pages>
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="CustomHtmlHelpers" />
        <add namespace="Combres.Mvc" />
      </namespaces>
    </pages>

      <httpHandlers>
          <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
      </httpHandlers>

      <httpModules>
          <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
          <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
      </httpModules>

  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

As you can see right now I have my combres commented out because right now I have to manually switch back and forth.

Here is my web.debug.config

<?xml version="1.0"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <combres definitionUrl="~/App_Data/CombresDevelopment.xml"  xdt:Transform="Inserting"/>
    <!--
    In the example below, the "SetAttributes" transform will change the value of 
    "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
    finds an atrribute "name" that has a value of "MyDB".

    <connectionStrings>
      <add name="MyDB" 
        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
  -->

  <system.web>        
      <!--
      In the example below, the "Replace" transform will replace the entire 
      <customErrors> section of your web.config file.
      Note that because there is only one customErrors section under the 
      <system.web> node, there is no need to use the "xdt:Locator" attribute.

      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
    -->
  </system.web>
</configuration>
  • 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-15T13:32:00+00:00Added an answer on May 15, 2026 at 1:32 pm

    The way i understood it is that it does not merge, but transforms the web.config using a new syntax. There should be some comments in the release and debug configs with regards how to do this.

    //In the example below, the "SetAttributes" transform will change the value of 
    //"connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
    //finds an atrribute "name" that has a value of "MyDB".
    
    <connectionStrings>
      <add name="MyDB" 
        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
    </connectionStrings>
    

    As it says, this transform will replace the connection string, but im sure you could use it to transform and replace any other part of the web.config.


    Try in your web.release.config

       <combres definitionUrl="~/App_Data/Combres.xml" xdt:Transform="SetAttributes"/>
    

    And

    web.debug.config

       <combres definitionUrl="~/App_Data/CombresDevelopment.xml" xdt:Transform="SetAttributes"/> 
    

    I think your issue is with not using the transforms correctly, you can read this link for more information. Link

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

Sidebar

Related Questions

I am trying to use MSBuild release mode, but it always defaults to debug.
Is it a bad practice to use a release version of 3rd party library
I'm trying to use Firebug to debug some Javascript that entails blur and focus
I'm trying to debug a web page that makes heavy use of events, and
I'm trying to debug an ASP.NET webapp that's configured to Use Local IIS Web
I'm trying to use the QJson library in an application that is being created
I'm trying to use my debug keystore so I can get a key for
I'm trying to use GDB (v 7.3.1) from macports to debug an executable compiled
I am trying to use NuSoap in PHP 5.3. When I debug my script
I'm trying to understand how to use firebug to debug my Javascript. So I

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.