473,396 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

web.config again

Hi all!

I have browsed through houndreds of threads with problems conserning
web.config, but not yet found a solution to this problem.

I have a test server running .NET 1.0, 1.1 and 2.0
I have a web application (virtual directory with application set), with
a web.config file.
The asp.net properties of this application is set to use .NET 1.0 in
IIS
web.config file:
<appSettings>
<add key="DBstring"
value="SERVER=x.x.x.x;DATABASE=db;UID=uid;PWD=pwd; application
name=somename;Max Pool Size=75000"/>
</appSettings>
<system.web>

in aspx file:
Imports System.Configuration

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
DBString = ConfigurationSettings.AppSettings("DBstring")

This however returns null and produces this error:
The ConnectionString property has not been initialized

Any help would be greatly appreciated.
-Erlend

Dec 21 '05 #1
6 1663
The appSettings belongs OUTSIDE of the system.web section...

<appSettings>
<add .../>
</appSettings>
<system.web>
...
</system.web>

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

<ba******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi all!

I have browsed through houndreds of threads with problems conserning
web.config, but not yet found a solution to this problem.

I have a test server running .NET 1.0, 1.1 and 2.0
I have a web application (virtual directory with application set), with
a web.config file.
The asp.net properties of this application is set to use .NET 1.0 in
IIS
web.config file:
<appSettings>
<add key="DBstring"
value="SERVER=x.x.x.x;DATABASE=db;UID=uid;PWD=pwd; application
name=somename;Max Pool Size=75000"/>
</appSettings>
<system.web>

in aspx file:
Imports System.Configuration

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
DBString = ConfigurationSettings.AppSettings("DBstring")

This however returns null and produces this error:
The ConnectionString property has not been initialized

Any help would be greatly appreciated.
-Erlend

Dec 21 '05 #2
Thanks for your reply!

But it is outside:
<appSettings>
<add key="DBstring"
value="SERVER=x.x.x.x;DATABASE=db;UID=uid;PWD=pwd; application
name=somename;Max Pool Size=75000"/>
</appSettings>
<system.web>
.....
</system.web>

Dec 21 '05 #3
lol...and here I thought I had the easy fix...must have been too early when
I saw that, was sure it was inside...

Have you tried setting it to work with 1.1 instead? Or on a server with only
1 version?

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
<ba******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Thanks for your reply!

But it is outside:
<appSettings>
<add key="DBstring"
value="SERVER=x.x.x.x;DATABASE=db;UID=uid;PWD=pwd; application
name=somename;Max Pool Size=75000"/>
</appSettings>
<system.web>
....
</system.web>

Dec 21 '05 #4
Easy to get lost in them tags:)

I tried setting it to 1.1, and interestingly enough, I get an access
denied error trying to read the web.config file located in the parent
virtual directory.
"Access denied to 'c:\inetpub\wwwroot\myApp\web.config'. Failed to
start monitoring file changes. "

The web.config file I want it to use is:
'c:\inetpub\wwwroot\myApp\myRealApp\web.config'
I then copyed my web.config file to the folder in the errormsg, and set
(read/execute)permissions to iuser and aspnet, but I still got the same
error.

Then I tried recreating the application in iis, but without luck.
Yes, the application is also running on a live server without 2.0, and
it works perfectly!
I tried reregistering asp.net (regasp_iis from the 1.0 framework
folder) today, without any luck.

I suspect the 2.0 Framework installation caused this, strange
web.config behaviour.

I hope someone might share some ideas to what I'm doing wrong.

Dec 22 '05 #5
Amazing! I got it to work.
I set 1.1 on the virtual directory closest to the root, and 1.0 on the
virtual directory hosting my webapp

I wish I knew why though.

Dec 22 '05 #6
Let's say the leprechaun's were up to their old tricks and call this one
close :)

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

<ba******@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Amazing! I got it to work.
I set 1.1 on the virtual directory closest to the root, and 1.0 on the
virtual directory hosting my webapp

I wish I knew why though.

Dec 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tom Willis | last post by:
How are the expert pythoneers dealing with config files? Is there anything similair to .net's config files or java's .properties? A quick search on google didn't return anything that looked...
2
by: Scanner2001 | last post by:
I have a service with settings in the app.config file. I would like to be able to change these settings without restarting the service. Something similar to a web.config with web services. Whenever...
1
by: Rolf Molini | last post by:
Hello everybody, I put this in a separate thread because altough it is connected to the localization-problem in my former thread this is a completely different "joke" of the IDE. While waiting...
5
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
5
by: feng | last post by:
Hi, We just converted our VB.Net Windows exe project from VS.Net 2002 to VS.Net 2003 and ran into a problem. the MyApp.exe.config file that we use for our customized configuration settings is...
13
by: Khodr | last post by:
Hello, I am using VS.NET 2003 and vb. I build my application MyApp and it generates MyApp.exe.config. So now MyApp.exe reads parameters from MyApp.exe.config. Great and no problem! I need to...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
0
by: df | last post by:
I'm seeing a strange problem in the Web App config tool: After creating a role and a user, going back to the Security tab home page, I get a "Specified cast is not valid" error. I've set up my...
6
by: Irfan | last post by:
hi, After installing the application in the client machine using ClickOnce, i would like that the client be able to change the database path in the Application.Config file. However, clickonce...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.