For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2007 > web deployment project, web.config section replacement is not work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author web deployment project, web.config section replacement is not work
Ira Grollman

2007-11-26, 6:56 pm

While debugging why a web.config section replacement was not happening in the
real web application, I tried a simplified case, no replacement is enabled
and the connection string is not showing up?

Suggestions about what could be happening? The code:

Dim rootWebConfig As System.Configuration.Configuration
rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)

For Each objConnectionString As
System.Configuration.ConnectionStringSettings In _
rootWebConfig.ConnectionStrings.ConnectionStrings

lstCS.Items.Add(objConnectionString.Name & "|" &
objConnectionString.ConnectionString)
Next

Puts "LocalSqlServer|data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDire
ctory|aspnetdb.mdf;User Instance=true
" into the listbox.

The web.config is:

<?xml version="1.0"?>
<configuration>

<appSettings/>
<connectionStrings>

<add name="test" connectionString="placeholder"/>
</connectionStrings>

<system.web>
<compilation defaultLanguage="vb" debug="true"/>

</system.web>
</configuration>

Thanks, Ira

Also posted in ASP.NET forum without response
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com