473,395 Members | 1,466 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,395 software developers and data experts.

error in config file

hi!

My Windows application is developed with VS 2003. It uses an app.config
file to read the path and name of my MS SQL Server database. It works fine
with .net framework 1.1, but...

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

When I try run my application on a computer with only .net framework 2.0 I
receive a message "error in config file".

Why is this and how do I solve this problem? I thought that an application
developed in .net framwork 1.0 environment also was able to run in a .net
2.0 environement.

Best regards
Hans Årsjö
Sep 13 '06 #1
5 1456
You only need the one <appSettingssection. You may also want to take a
look at the <connectionStringssection.

Glenn

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:15**********************************@microsof t.com...
hi!

My Windows application is developed with VS 2003. It uses an app.config
file to read the path and name of my MS SQL Server database. It works
fine
with .net framework 1.1, but...

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

When I try run my application on a computer with only .net framework 2.0
I
receive a message "error in config file".

Why is this and how do I solve this problem? I thought that an application
developed in .net framwork 1.0 environment also was able to run in a .net
2.0 environement.

Best regards
Hans Årsjö

Sep 13 '06 #2
This should actually be

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

Both in 1.1 and 2.0
On Wed, 13 Sep 2006 15:36:01 +0200, Hans - DiaGraphIT -
<Ha************@discussions.microsoft.comwrote:
<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>


--
Happy Coding!
Morten Wennevik [C# MVP]
Sep 13 '06 #3
Thank you Glenn!

I'm sorry for not replying earlier. Your solution helped a lot. My only
problem now is that I don't have the right version for "crystal reports
runtime .net" and "Crystal reports 9". (for redistribution in my MSI package).

Best regards Hans
"Glenn" wrote:
You only need the one <appSettingssection. You may also want to take a
look at the <connectionStringssection.

Glenn

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:15**********************************@microsof t.com...
hi!

My Windows application is developed with VS 2003. It uses an app.config
file to read the path and name of my MS SQL Server database. It works
fine
with .net framework 1.1, but...

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

When I try run my application on a computer with only .net framework 2.0
I
receive a message "error in config file".

Why is this and how do I solve this problem? I thought that an application
developed in .net framwork 1.0 environment also was able to run in a .net
2.0 environement.

Best regards
Hans Årsjö


Sep 27 '06 #4
Thank Morten for your reply!

The bad guy in my case is InstallShield Professional version 11. When I run
the MSI file build with InstallShield it creates a XML/config file during the
installation. If the file exists from before it only adds several
<appSettings></appSettingsand it doesn't overwrite existing values.

Best regards
Hans

"Morten Wennevik" wrote:
This should actually be

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

Both in 1.1 and 2.0
On Wed, 13 Sep 2006 15:36:01 +0200, Hans - DiaGraphIT -
<Ha************@discussions.microsoft.comwrote:
<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

--
Happy Coding!
Morten Wennevik [C# MVP]
Sep 27 '06 #5
I ment that my problem ixist if I want to run our application in an
evironement with only .NET framwork 2.0 installed

/Hans

"Glenn" wrote:
You only need the one <appSettingssection. You may also want to take a
look at the <connectionStringssection.

Glenn

"Hans - DiaGraphIT -" <Ha************@discussions.microsoft.comwrote in
message news:15**********************************@microsof t.com...
hi!

My Windows application is developed with VS 2003. It uses an app.config
file to read the path and name of my MS SQL Server database. It works
fine
with .net framework 1.1, but...

<?xml version=1.0">
<configuration>
<appSettings>
<add key="SERVER" value="127.0.01"/>
</appSettings>
<appSettings>
<add key="DATABASE" value="myDB"/>
</appSettings>
</configuration>

When I try run my application on a computer with only .net framework 2.0
I
receive a message "error in config file".

Why is this and how do I solve this problem? I thought that an application
developed in .net framwork 1.0 environment also was able to run in a .net
2.0 environement.

Best regards
Hans Årsjö


Sep 27 '06 #6

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

Similar topics

2
by: Wayne | last post by:
I have an application where I added a comment as the first line of my Config file, as I found out I can't do this. However, an entry was made in the event log about the error (Source = .net...
6
by: Javier Cortés Cortés | last post by:
i am getting this error when i am trying to access any file(with the ext. aspx) from my remote server. the error is : Server Error in '/' Application....
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
25
by: n3crius | last post by:
hi, i just got a web host with asp.net , seemed really cool. aspx with the c# or vb IN the actual main page run fine, but when i use codebehind and make another source file ( a .cs) to go with...
3
by: Sean | last post by:
HI There, I am having trouble deploying my .aspx pages to a remote server, I have made changes to the config file and it still returns an error. I have also contacted the server administrator to...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
2
by: Sam | last post by:
Inquiry? -------- I would like to authenticate all subdirectory via asp.net at Windows Server 2003 and IIS 6.0 but it prompt an error message as shown as below: Runtime Error? --------------...
23
by: deathtospam | last post by:
A day or two ago, I wrote a quick ASPX page with a CS codebehind using Visual Studio .NET 2005 -- it worked, I saved it and closed the project. Today, I came back to the project, reopened the...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
4
by: aSoundMind | last post by:
Hi there, I recieve this error Server Error in '/integrate' Application. -------------------------------------------------------------------------------- Configuration Error Description: An...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.