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

app.config xml file and application blocks

grs
Can a class library have a app.config file. Reason for asking is that the
microsoft application blocks all read from myApp.exe.config. How can you use
the application blocks if you do not have an app.config file.

Wish someone from microsoft would answer this, I am at a loss.

thanks
grs
Nov 12 '05 #1
4 7853
Yes, a class library can have .config file, but you have to do the
copying and naming by hand. Visual Studio only renames and copies
app.config files automatically for you.

As you already found, that behavior is not really documented and the
expected usage is to add settings for the application blocks to the
app.config/web.config file of your application. As a developer/vendor of
a class library, you need to document these expectations when you only
ship a library, which is what Microsoft does with WSE for example.

What exactly are you looking to do?

HTH,
Christoph Schittko
MS MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: grs [mailto:gs****@budgetext.com]
Posted At: Monday, November 15, 2004 1:57 PM
Posted To: microsoft.public.dotnet.xml
Conversation: app.config xml file and application blocks
Subject: app.config xml file and application blocks

Can a class library have a app.config file. Reason for asking is that the microsoft application blocks all read from myApp.exe.config. How can you use
the application blocks if you do not have an app.config file.

Wish someone from microsoft would answer this, I am at a loss.

thanks
grs

Nov 12 '05 #2
grs
Christoph,
thanks for reply. "What exactly are you looking to do?" = I wish to use the
exception management application block in a class library. Would the
application block read the config settings - what would I name the config
file ?? Any example would really would be appreciated.

thanks
grs

"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...
Yes, a class library can have .config file, but you have to do the
copying and naming by hand. Visual Studio only renames and copies
app.config files automatically for you.

As you already found, that behavior is not really documented and the
expected usage is to add settings for the application blocks to the
app.config/web.config file of your application. As a developer/vendor of
a class library, you need to document these expectations when you only
ship a library, which is what Microsoft does with WSE for example.

What exactly are you looking to do?

HTH,
Christoph Schittko
MS MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: grs [mailto:gs****@budgetext.com]
Posted At: Monday, November 15, 2004 1:57 PM
Posted To: microsoft.public.dotnet.xml
Conversation: app.config xml file and application blocks
Subject: app.config xml file and application blocks

Can a class library have a app.config file. Reason for asking is that

the
microsoft application blocks all read from myApp.exe.config. How can

you
use
the application blocks if you do not have an app.config file.

Wish someone from microsoft would answer this, I am at a loss.

thanks
grs


Nov 12 '05 #3

I swear I loaded .dll.config files before for assemblies back in the
..net 1.0 days but I guess it wasn't intended behavior and it's no longer
working.

To use the exception management block you need to add the required
configuration elements in the app.config or the web.config file of the
executing application or web service.

If you don't build that app.config file because you're using the
exception management block in a class library assembly, not in an
application, then you need to document that requirement for the
developers that consume your class library.

I apologize for any confusion.

Christoph
-----Original Message-----
From: grs [mailto:gs****@budgetext.com]
Posted At: Monday, November 15, 2004 3:43 PM
Posted To: microsoft.public.dotnet.xml
Conversation: app.config xml file and application blocks
Subject: Re: app.config xml file and application blocks

Christoph,
thanks for reply. "What exactly are you looking to do?" = I wish to use the
exception management application block in a class library. Would the
application block read the config settings - what would I name the config file ?? Any example would really would be appreciated.

thanks
grs

"Christoph Schittko [MVP]" <IN**********@austin.rr.com> wrote in message news:O9**************@TK2MSFTNGP14.phx.gbl...
Yes, a class library can have .config file, but you have to do the
copying and naming by hand. Visual Studio only renames and copies
app.config files automatically for you.

As you already found, that behavior is not really documented and the
expected usage is to add settings for the application blocks to the
app.config/web.config file of your application. As a developer/vendor of a class library, you need to document these expectations when you only ship a library, which is what Microsoft does with WSE for example.

What exactly are you looking to do?

HTH,
Christoph Schittko
MS MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: grs [mailto:gs****@budgetext.com]
Posted At: Monday, November 15, 2004 1:57 PM
Posted To: microsoft.public.dotnet.xml
Conversation: app.config xml file and application blocks
Subject: app.config xml file and application blocks

Can a class library have a app.config file. Reason for asking is
that the
microsoft application blocks all read from myApp.exe.config. How
can you
use
the application blocks if you do not have an app.config file.

Wish someone from microsoft would answer this, I am at a loss.

thanks
grs


Nov 12 '05 #4
>Yes, a class library can have .config file,

Well, sort of - but the basic ConfigurationSettings object will *NOT*
look at an class library's "app.config" file - it will only ever look
at the app's "myapp.exe.config" file.

So if you want to use a config file for a DLL or something like that,
you have to do all the evaluation of the XML config file yourself.

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 12 '05 #5

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

Similar topics

0
by: Mike | last post by:
Hi I am using one of the Microsoft building blocks called User Interface Process what this block basically does it control the flow/state of your application. This block works great with...
0
by: Mani | last post by:
Problem Scenario: I have copied the Microsoft Cache Application Block (MCAB) dll to GAC to make that available to other applications. The MCAB uses few configuration settings which will be set in...
0
by: keyway | last post by:
We have recently implemented (enterprise library) data application blocks to VB.NET console applications - very nice. The console apps read an app.config file, which in turn communicates w/ a...
3
by: grs | last post by:
Can a class library have a app.config file. Reason for asking is that the microsoft application blocks all read from myApp.exe.config. How can you use the application blocks if you do not have an...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
2
by: Asela Gunawardena | last post by:
we have a web site which operates as a seperate application that can be integrated with other webs site developped to use other platforms such as php, jsp, etc. so obivously we have our own...
0
by: SFM | last post by:
Connection to several connection string from the app.config file I am trying to find a why to get the providerMappings settings from the app.config. For my data access I am using Data access...
1
by: Harold Howe | last post by:
When .NET loads an app.config at runtime (myapp.exe.config), will it honor an entity declaration? Based on what I am seeing, the answer is no, but I think, or hope, that I am doing something wrong....
1
by: =?Utf-8?B?RXZl?= | last post by:
Here's my App.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="customers"> <section name="test1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.