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

How to read a user setting in another project?

There are two projects in my solution, one is utility dll and the
other is the main executable. I have user settings in the exe project.
However I want to read the settings in the utility dll so that the
utility dll can be reused in other projects but generate project-
specified results. The scenario would be

namespace dll
{
static class StringGenerator
{
static public string ProjectSpecifiedString()
{
return String.Format("{0} is project specified.",
Assembly.GetExecutingAssembly()... /*The answer to my question!*/);
}
}
}
Jul 17 '08 #1
1 5915
On Jul 17, 6:38*pm, Wayne <wayne...@gmail.comwrote:
There are two projects in my solution, one is utility dll and the
other is the main executable. I have user settings in the exe project.
However I want to read the settings in the utility dll so that the
utility dll can be reused in other projects but generate project-
specified results. The scenario would be

namespace dll
{
* static class StringGenerator
* {
* * *static public string ProjectSpecifiedString()
* * *{
* * * *return String.Format("{0} is project specified.",
Assembly.GetExecutingAssembly()... /*The answer to my question!*/);
* * *}
* }

}- Hide quoted text -

- Show quoted text -
You can access the configuration and the settings from any project. it
can be only defined in the "main" project.
A little explanation.
The ConfigurationManager is a static class so it's available to ANY
class in the AppDomain and it will be the same isntance. As your dll
runs in the same AppDomain than the code that included and loaded the
configuration you can use it.
Jul 18 '08 #2

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

Similar topics

1
by: David Gagné | last post by:
Hello, My C# solution is composed of 2 projects, a class library project and a Windows application project. The window in one project calls the DLL in the other. That's ok. Now, to better test...
4
by: mg | last post by:
Is there a way to reference a user control in one project from within another project? <%@ Register TagPrefix="HDR" TagName="WebUserControl1" Src="http://localhost/App2/WebUserControl1.ascx" %>...
4
by: moondaddy | last post by:
I have a vb.net asp 1.1 project where when I step through the code behind of a page, a new codebehind with the same name appears in the IDE and executes. so now I have 2 classes open in the IDE...
3
by: Tee | last post by:
Hi Does anyone know how to run another project that inside the same solution ? The project that going to be run is a windows application project. If I don't want to run the EXE, do I have any...
3
by: blue_nirvana | last post by:
How do you access a form or code from another project in the same solution? I have a solution that has several projects and I want to be able to load a form or call code from say Project2 from...
10
by: Vik | last post by:
From a Web page, I need to open another page created in another project and pass some object (a database connetion) to that page. Looks like the second project has its own Application and Session...
4
by: Bill Nguyen | last post by:
I would like to include a module from another project. When I added existing item, VS copied the module to the current project's folder so that whatever I did to this module doesn't reflect in the...
2
by: Kevin | last post by:
Hi! It's possible load the code behind from another project in C# 1.1 ? I want to compile my website in one dll per page, like does Asp.Net 2.0 Thanks
0
by: Ramesh2006 | last post by:
Hi, The following error occurred when i programmatically compile another project from my present project. The Error: error CS0234:The type or namespace name 'Windows' does not exist in the...
3
by: skneife | last post by:
I have a Solution that contains a website and its web.config and another project named testWebSite. I need to access to the web.*config located in the website project from testWebSite like this:...
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: 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
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...

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.