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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:11:26+00:00 2026-06-15T04:11:26+00:00

I have a web config (truncated to show the important bits) like so: <?xml

  • 0

I have a web config (truncated to show the important bits) like so:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
        <section name="nhs-configuration" type="NHibernate.Search.Cfg.ConfigurationSectionHandler, NHibernate.Search" requirePermission="false" />
    </configSections>
    <nhs-configuration xmlns="urn:nhs-configuration-1.0">
        <search-factory>
            <property name="hibernate.search.default.directory_provider">NHibernate.Search.Store.FSDirectoryProvider, NHibernate.Search</property>
            <property name="hibernate.search.default.indexBase">C:\files\FTIndex</property>
            <property name="hibernate.search.default.indexing_strategy">event</property>
        </search-factory>
    </nhs-configuration>
    <nlog
        xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        internalLogFile="c:\temp\nlogInternal.log"
        internalLogLevel="Info"
        internalLogToConsole="true">
        <targets>
            <target
                xsi:type="Database"
                name="db"
                keepConnection="false"
                useTransactions="true"
                connectionStringName="MyConnString"
                dbProvider="Npgsql"
                commandText="insert into logs (timestamp, thread, severity, source, message, exception, username) values (now(), :thread, :severity, :source, :message, :exception, :username);">
                <parameter name="thread" layout="${threadid}" />
                <parameter name="severity" layout="${uppercase:${level}}" />
                <parameter name="source" layout="${logger}" />
                <parameter name="message" layout="${message}" />
                <parameter name="exception" layout="${exception:format=type,message,method:maxInnerExceptionLevel=10}" />
                <parameter name="username" layout="${aspnet-user-identity}" />
            </target>
            <target xsi:type="Debugger" name="outputWindow" layout="${uppercase:${level}} ${aspnet-user-identity} ${message} ${exception:format=type,message,method:maxInnerExceptionLevel=10}"/>
        </targets>
        <rules>
            <logger name="*" minlevel="Trace" writeTo="outputWindow" />
            <logger name="*" minlevel="Debug" writeTo="db" />
        </rules>
    </nlog>
</configuration>

My transform file looks like this:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <nhs-configuration>
        <search-factory>
            <property name="hibernate.search.default.indexBase" xdt:Locator="Match(name)" xdt:Transform="Replace">/var/ftindex</property>
        </search-factory>
    </nhs-configuration>
    <nlog
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        internalLogFile="/var/log/nlogInternal.log"
        internalLogLevel="Warn"
        internalLogToConsole="false"
        xdt:Transform="SetAttributes(internalLogFile,internalLogLevel,internalLogToConsole)">
        <targets>
            <target
                name="db"
                keepConnection="true"
                useTransactions="false"
                xdt:Locator="Match(name)"
                xdt:Transform="SetAttributes(keepConnection,useTransactions)"
                >
                <parameter name="thread" layout="${threadid}" />
                <parameter name="severity" layout="${uppercase:${level}}" />
                <parameter name="source" layout="${logger}" />
                <parameter name="message" layout="${message}" />
                <parameter name="exception" layout="${exception:format=type,message,method:maxInnerExceptionLevel=10}" />
                <parameter name="username" layout="${aspnet-user-identity}" />
            </target>
            <target name="outputWindow" xdt:Locator="Match(name)" xdt:Transform="Remove" />
        </targets>
        <rules>
            <logger name="*" minlevel="Debug" writeTo="db" />
            <logger writeTo="outputWindow" xdt:Locator="Match(writeTo)" xdt:Transform="Remove" />
        </rules>
    </nlog>
</configuration>

Now, all parts of my web.config file transform properly upon publish except these two sections. My hunch is this has something to do with some kind of xml namespace conflict, but it could be something else entirely I guess.

Why won’t these sections transform? They are being completely ignored and are ending up in the published web.config totally unchanged.

  • 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-06-15T04:11:27+00:00Added an answer on June 15, 2026 at 4:11 am

    Turns out the answer is pretty simple: just remove the default namespace declarations from the two nodes.

    In this manner, you lose the nifty Intellisense on the xml nodes, but it transforms properly.

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

Sidebar

Related Questions

i have a web.config file that looks like this: <?xml version=1.0?> <configuration> <system.web> <compilation
I have my web config as follows <?xml version=1.0?> <configuration> <appSettings/> <connectionStrings> <add name=MySqlConnection
Question: in web.config in section system.web I have <globalization culture=de-ch uiCulture=de-ch requestEncoding=UTF-8 responseEncoding=UTF-8/> What
I currently have my web.config location section set up like this <location path=page1.aspx> <system.web>
Suppose I have a Web.config like such: <configuration> <elmah> ... </elmah> </configuration> Is it
I have a web application in VS2010 with a web.config like this: ... <configuration>
I have a web.config containing rewrite rules like this: <system.webServer> <rewrite> <rules><!-- Some rules
I have a web.config in ASP.net giving me configuration error. <connectionStrings> <add name=conn1 connectionString=Data
This attribute is new in the .NET Framework version 4.0.I have web.config file in
In IIS 7 Web site I have web.config authorization configuration to allow only definite

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.