I am running Visual Studio 2010, using an ASP.Net forms application.I am trying to transform XMl on build but it is not working.
In my config section I have the following:
<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionString="Data Source=TestServer;Initial Catalog=OnlineApplication;Trusted_Connection=True" />
<errorMail from="emhelp@server.edu" to="person@test.com" subject=" Exception" async="true" smtpserver="smtpgate.server.edu" />
I am trying to get it the ELMAH server name to transform when I publish to production via web.config.production xml transformation. All of my other settings for the app settings and connection strings work fine.
I have the following in my web.production.config:
<add type="Elmah.SqlErrorLog, Elmah"
connectionString="Server=ProductionServer;Initial Catalog=OnlineApplication;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(type)"/>
</elmah>
It doesn’t complain but it also does’t transform the text. What do I need to change to make the file transform on build/publish.
Since is only one
errorLogtag, you can useReplaceinstead ofSetAttributeswith a locator. Also note that you have to use the actual tag name, not<add>.