473,698 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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;applicatio n
name=somename;M ax Pool Size=75000"/>
</appSettings>
<system.web>

in aspx file:
Imports System.Configur ation

Protected Overrides Sub OnInit(ByVal e As System.EventArg s)
DBString = ConfigurationSe ttings.AppSetti ngs("DBstring")

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

Any help would be greatly appreciated.
-Erlend

Dec 21 '05 #1
6 1672
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******** *************@f 14g2000cwb.goog legroups.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;applicatio n
name=somename;M ax Pool Size=75000"/>
</appSettings>
<system.web>

in aspx file:
Imports System.Configur ation

Protected Overrides Sub OnInit(ByVal e As System.EventArg s)
DBString = ConfigurationSe ttings.AppSetti ngs("DBstring")

This however returns null and produces this error:
The ConnectionStrin g 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;applicatio n
name=somename;M ax 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.goo glegroups.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;applicatio n
name=somename;M ax 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\www root\myApp\web. config'. Failed to
start monitoring file changes. "

The web.config file I want it to use is:
'c:\inetpub\www root\myApp\myRe alApp\web.confi g'
I then copyed my web.config file to the folder in the errormsg, and set
(read/execute)permiss ions 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.goo glegroups.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
1641
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 useful, and I almost would expect to see some module that would be for dealing with config information. I can think of at least one way to do it, but I'm sure there are shortcomings I can't see yet, and I'd rather use something someone
2
4893
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 I change a setting, for example the folder that data is written to, the change does not seem to register. What I believe is that the app.config is read in at the startup of the exe (windows service), and then never read again. Is there a way to...
1
1558
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 for some hint on how to include my own ressources in IDE-generated satellite-assemblies (because there can only be on assembly per each language) I decided to try to use the XML-editor for the IDE-generated .resx-files again. I noticed that the...
5
555
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 it is invoked by pressing "F5", or when the web.config file is modified. In all these cases the web.config file contains <identity impersonate="false" />. The mysterious problem arrises when I set <identity impersonate="true"/> in the...
6
2471
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 machine config, this was necessary as our web site has 4 environments and the database server has a different name in each. Since the upgrade the applications can't read the strings in the
5
3381
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 removed when the conversion is done. It won't work even if I menully copy the file back. The settings are not get recogenized. What's going on? Thanks
13
507
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 run the same program but with different configuration data. So I made a copy of MyApp.exe and MyApp.exe.config to put them in another folder and renamed the copy to MyApp2.exe and MyApp2.exe.config respectively. I ran it but it did not read from...
17
3245
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 production. I'm in the process of writing a site that will have lots of traffic so I'm trying to save resources everyplace that I can. My question is - do the web.config app settings get loaded once when the
0
1382
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 web application to use SQL Server to store the Membership database using aspnet_regsql.exe and have successfully opened the Web Config Tool. Then, I create a role, and go look in the SQL Server aspnet_roles table, and there is the role. All...
6
6841
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 does not copy the Application.Config file when it deploys. How can i be able to do it, Am i missing something in ClickOnce. Thanks
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.