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

ConfigurationManager question

ok, here's my question. I have a class ConfigServer that has the
following method:

public string FindByKey(string key)
{
try
{
return ConfigurationManager.AppSettings[key].ToString();
}
catch (Exception ex)
{
return ex.Message;
}
}

I also have a config file named MyAppName.dll.config (same as the output
dll).

I have this dll installed in the gac and located in a specific folder on
my machine with the config file.

I want this application to basically be used by various other
applications to read in settings. When I reference the dll from an a
different solution, I get and call this method, I get "Object reference
not set to an instance of an object".

Any thoughts?

Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Dec 5 '05 #1
2 994
Hi,

This might be a stupid question but are you sure 'your various other
applications' are referencing your dll properly.

It also might be an issue of cross communication between app domains.

Happy Coding,

Stefan
C# GURU
www.DotNETovation.com

"You always have to look beyond the horizon and can never be complacent
-- God forbid we become complacent."

Jozef Straus

*** Sent via Developersdex http://www.developersdex.com ***
Dec 6 '05 #2

Yes, I am referencing the dll properly. It is in only one spot on my
machine. Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Dec 6 '05 #3

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

Similar topics

4
by: Michael Debus | last post by:
Hi, I try to read a value from app.config file using this code: string s=System.Configuration.ConfigurationManager.AppSettings.ToString(); I got the compiler error: Error 1 The type or...
2
by: Myo Zaw | last post by:
hi, can i use configurationmanager in .net 2.0 windows form. cause i have an app.config file and i couldn't extract the data from there by using configurationmanager nor 1.1 feature. do u have any...
1
by: shapper | last post by:
Hello, I create a few VB classes under app_code of a web site. Now I am trying to create a library project. Something strange is going on. I have the following line: Dim connectionString As...
3
by: Mark | last post by:
I am trying to read the appsettings section of a configuration file using the ConfigurationManager object (ASP.NET application) with the following three lines but for some reason the...
4
by: Jim in Arizona | last post by:
I've been using VB 2005 for a few years now. My entire coding history is VB related. This weekend I decided to start learning C#. I'm at work now and decided to do some coding in C# that I would...
2
by: remya1000 | last post by:
i'm using VB.NET 2003. Last time while i did a program in Vb.Net 2005, i use "Configuration". and i could read and write to that XML configuration file like the example below. CODES:...
2
by: pantagruel | last post by:
Hi, I have a Visual studio 2005 project that runs as a Windows Service. In it I have declared that I am using System.Configuration. I have set one application setting for the service using the...
2
by: Thomas Bauer | last post by:
Hello, I have a config file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="Directory" value="C:\_Database\" /> <add key="CloseApplication" value="0" />...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.