Hi Sirs,
Could I use 2 config files in the same solution ? I have 2 projects in my
solution (Data - Class Library, MySite - Web Application)
But the funcking =/ problem happens because i want the connection string in
the Data Project (Class Library), How do i do ?
Could I access a config file in the Data project to get the connection
string through from (app settings) ?
Kind regards,
--
Daniel Andrade Groh
CTF Technologies 6 2117
I'm not sure I understand the problem specifically but the short answer is
that you definitely can have multiple app.config files - one for each
project for instance. YOu can also just create a centralized XML file
somewhere and use it.
--
W.G. Ryan, MVP www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:e3**************@TK2MSFTNGP15.phx.gbl... Hi Sirs, Could I use 2 config files in the same solution ? I have 2 projects in my solution (Data - Class Library, MySite - Web Application) But the funcking =/ problem happens because i want the connection string
in the Data Project (Class Library), How do i do ? Could I access a config file in the Data project to get the connection string through from (app settings) ?
Kind regards, --
Daniel Andrade Groh CTF Technologies
All of the the values you will store in the config should be in the
app.config of the executing assembly. There is no use in having an
app.config for a dll. I have remoted objects (class libraries) that
need connection strings. These strings are part stored in the
app.configs of the services hosting those remote objects. When I
deploy a remote object to a server, I add any info needed to the
service config at the same time.
When you read app settings from a class lib it will automatically open
the app config of the calling assembly.
HTH,
Dan
I tryed: Cinfiguration.AppSettings("MSSQL")
But it does not bring to me from the Data project but yes from the
WebApplication project...should i not make some especification to access thi
config file in the Data project ?
--
Daniel Andrade Groh
CTF Technologies
"W.G. Ryan eMVP" <Wi*********@gmail.com> escreveu na mensagem
news:uQ**************@TK2MSFTNGP09.phx.gbl... I'm not sure I understand the problem specifically but the short answer is that you definitely can have multiple app.config files - one for each project for instance. YOu can also just create a centralized XML file somewhere and use it.
-- W.G. Ryan, MVP
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com "Daniel Groh" <ne*********@gmail.com> wrote in message news:e3**************@TK2MSFTNGP15.phx.gbl... Hi Sirs, Could I use 2 config files in the same solution ? I have 2 projects in my solution (Data - Class Library, MySite - Web Application) But the funcking =/ problem happens because i want the connection string in the Data Project (Class Library), How do i do ? Could I access a config file in the Data project to get the connection string through from (app settings) ?
Kind regards, --
Daniel Andrade Groh CTF Technologies
No Dan, it doesnt...it opens from the WebApplication and not from the Class
Library Application...Should not specify something else ? for sure ? =/
--
Daniel Andrade Groh
CTF Technologies
"Dan" <da*************@yahoo.com> escreveu na mensagem
news:11*********************@z14g2000cwz.googlegro ups.com... All of the the values you will store in the config should be in the app.config of the executing assembly. There is no use in having an app.config for a dll. I have remoted objects (class libraries) that need connection strings. These strings are part stored in the app.configs of the services hosting those remote objects. When I deploy a remote object to a server, I add any info needed to the service config at the same time.
When you read app settings from a class lib it will automatically open the app config of the calling assembly.
HTH, Dan
I assume you mean if you put the MSSQL appsetting into the Web
Application .config file, you get a result, but if you put MSSQL in the
Class Library's .config file, you get nothing, right? If that's the
case, Dan's right - in this regard, the Web Application is the calling
assembly, not the Class Library. I might be mistaken, but I don't think
a class library can be a calling assembly for a .config file, as it's
never executed stand-alone - you need an EXE or some other process to
load it up.
Clint
Alright...so...the most usual and easily form to make that is: use the
web.config from you web application...hehehe right ?
Thank you all...Danke sehr!
Daniel
"Clint (cm******@online.nospam)" <cj*******@gmail.com> escreveu na mensagem
news:11*********************@g14g2000cwa.googlegro ups.com... I assume you mean if you put the MSSQL appsetting into the Web Application .config file, you get a result, but if you put MSSQL in the Class Library's .config file, you get nothing, right? If that's the case, Dan's right - in this regard, the Web Application is the calling assembly, not the Class Library. I might be mistaken, but I don't think a class library can be a calling assembly for a .config file, as it's never executed stand-alone - you need an EXE or some other process to load it up.
Clint This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Billy Jacobs |
last post by:
I have a website which has both secure and non-secure
pages. I want to uses forms authentication. How do I
accomplish this?
Originally I had my web.config file in the root with Forms...
|
by: John M |
last post by:
Hello,
On Microsoft Visual Studio .NET 2003,
I want to use some global elements,
that can be used in each one of my pages.
i.e I put a oleDBConnection on global.asax.vb
How can I use it...
|
by: Frank Chapman |
last post by:
I fully admit to being a true nubie, so be kind.
I've somehow screwed up my IIS 5.1 after installing ASP 2.0.50215 and
testing some basic ASP pages. I receive a Forbidden message which
appears...
|
by: Ron Gliane |
last post by:
From the documentation I could find, it seems that reading “appSettings” from
the app.config file is now done through ConfigurationManager.AppSettings for
..NET 2.0, instead of the obsolete...
|
by: Jim Andersen |
last post by:
Hi,
I would appreciate if someone could explain this behaviour, and maybe offer
a better solution.
I have been working with the GridView control. And SqlDataSource. It works
great if I do:...
|
by: hazz |
last post by:
I want to load Service.exe.config into a DataGrid, change the timer interval
value from 10000 to 555555, then update the original exe.config.
The code below shows the code at step 1 and 2 before...
|
by: mrquan83 |
last post by:
I'm using Nini from http://nini.sourceforge.net to read and write XML
files. I'm having trouble creating nested 'configs' (Sections)
however.
This is a sample of my code....
----- vb.net...
|
by: TS |
last post by:
I cannot get this to work. I added an app.config to a project i reference
from my web application project (vs 05) but can see no way to access the
settings within it.
the other thing is that I...
|
by: Man4ish |
last post by:
I have created Graph object without vertex and edge property.It is working fine.
#include <boost/config.hpp>
#include <iostream>
#include <vector>
#include <string>
#include...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |