473,403 Members | 2,366 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,403 software developers and data experts.

Unable to read from my App.config

I have a windows app in a virtual folder which works great on my test server.
However, when I move the application to a production server I get the
following error :

An unhandled error has occured in your application. Object not set to an
instance of an object.

This only occurs when I try to read my connection string from my app.config
file :
lconnstr='System.Configuration.ConfigurationSettin gs.AppSettings("MyConnString").ToString

Any ideas why I cannot read from my app.confog on one server but not on the
other server ?
Dec 22 '05 #1
3 2223
"poppy" <po***@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
I have a windows app in a virtual folder which works great on my test
server.
However, when I move the application to a production server I get the
following error :

An unhandled error has occured in your application. Object not set to an
instance of an object.

This only occurs when I try to read my connection string from my
app.config
file :
lconnstr='System.Configuration.ConfigurationSettin gs.AppSettings("MyConnString").ToString

Any ideas why I cannot read from my app.confog on one server but not on
the
other server ?


Visual Studio copies your App.config file to the build output directory and
renames it to YourAppName.exe.config. Do you have a file with the correct
name on your production server?
Dec 22 '05 #2
My App.Config has the same name as my Application.

Does changing the folder name that the application resides in cause problems
? I dont see why.

"John Vottero" wrote:
"poppy" <po***@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
I have a windows app in a virtual folder which works great on my test
server.
However, when I move the application to a production server I get the
following error :

An unhandled error has occured in your application. Object not set to an
instance of an object.

This only occurs when I try to read my connection string from my
app.config
file :
lconnstr='System.Configuration.ConfigurationSettin gs.AppSettings("MyConnString").ToString

Any ideas why I cannot read from my app.confog on one server but not on
the
other server ?


Visual Studio copies your App.config file to the build output directory and
renames it to YourAppName.exe.config. Do you have a file with the correct
name on your production server?

Dec 22 '05 #3
"poppy" <po***@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
My App.Config has the same name as my Application.

Does changing the folder name that the application resides in cause
problems
? I dont see why.
I've never seen a problem caused by moving the executable and config file.
Do you have an appSetting with a key of "MyConnString"? Can you post your
config file?

"John Vottero" wrote:
"poppy" <po***@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
>I have a windows app in a virtual folder which works great on my test
>server.
> However, when I move the application to a production server I get the
> following error :
>
> An unhandled error has occured in your application. Object not set to
> an
> instance of an object.
>
> This only occurs when I try to read my connection string from my
> app.config
> file :
> lconnstr='System.Configuration.ConfigurationSettin gs.AppSettings("MyConnString").ToString
>
> Any ideas why I cannot read from my app.confog on one server but not on
> the
> other server ?


Visual Studio copies your App.config file to the build output directory
and
renames it to YourAppName.exe.config. Do you have a file with the
correct
name on your production server?

Dec 22 '05 #4

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

Similar topics

19
by: Nancy | last post by:
Hi, When I start my PC(winXP Pro), it always says: Unknown(): Unable toload dynamic library './php_msql.dll' - The specified module could not be found. Then my Apache servre starts, load php...
2
by: TM | last post by:
When I run an ASP.Net application I am getting the following error: "Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged."...
0
by: Yogesh Pancholi | last post by:
For some unexplained reason, I am suddenly unable to browse to a virtual directory on my laptop. I have a number of sample websites to which I could happliy browse up until last week. As of Monday,...
1
by: vivek sinha | last post by:
Hi, I am using the UnitTest Framework provided in Visual Studio 2005. I have created a seprate project/test assembly which contains all my unit tests for testing all the methods of another...
4
by: Josema | last post by:
Hi to all, Im searching a hand to solve an Exception that i get when i try to give the user to a gmail account... Any help would be appreciated.. Thanks in advance This is a piece of my...
0
by: quocvuong2005 | last post by:
Hi all ! I have a webservice that contains a Helloworld() method (This return a string type ) and a asp.net application . I call Helloworld method from webservice , it works fine . but when i call...
8
by: =?Utf-8?B?RGFuTQ==?= | last post by:
Can someone help with the following problem. I am sending an encrypted SOAP message to a .NET 2.0 + WSE 3.0 web service. When .NET attempts to decrypt the message it cannot read the private key...
1
by: =?Utf-8?B?U2NvdHQ=?= | last post by:
Hello, Using VS2008 in a C# web service application, a class has been created that inherits from the ConfigurationSelection. This class file has been placed in the App_Code folder. The...
0
by: =?Utf-8?B?dG9t?= | last post by:
Hi, I have a .net 2.0 windows client that connects to webservices. In most cases it works fine. However I have one client that gets 'Unable to connect to the remote server'. If on that client...
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?
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.