By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,163 Members | 1,417 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,163 IT Pros & Developers. It's quick & easy.

General VS.NET structure question

P: n/a
Pardon the crosspost, but I couldn't find a generic .NET group for VS.NET.

I was wondering about the directory structure that the IDE creates when
making a project. What's the point of the bin and obj subfolders? I ask for
two reasons. One, knowledge is a good thing and I'd just like to know. Two,
I'm writing a service and I'm using the ExceptionPublisher Application
block, but I can't seem to get my custom publisher to work. I thought it was
because I had my App.config file in the top-level folder instead of in the
bin folder where the program was actually executing. However, moving the
file there (and no, I didn't actually name it "App.config") didn't work
either.

When I say "didn't work," what I mean is that the ExceptionManager class
doesn't find the ConfigSettings block in the file. I followed the directions
from the help file to the letter but this line:

if (ConfigurationSettings.GetConfig(EXCEPTIONMANAGEME NT_CONFIG_SECTION) ==
null)

is always true.

So I guess my second question is: has anyone gotten a custom publisher to
work with a service?
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:el**************@TK2MSFTNGP09.phx.gbl...
So I guess my second question is: has anyone gotten a custom publisher to
work with a service?


Okay, experiment and learn. It seems that every time I build my solution, my
<App>.config is wiped out of the bin folder. So I try to figure out why it's
not going into the folder with all the other items in my project. I hit on
the build action property and read about it. Hmmm, perhaps I should set it
to Content instead of None? I have two text files in the project whose build
action in Content and they're getting put in the bin folder, so, along with
the infomation in MSDN, I figure this will solve the problem. Bzzzzztt!! My
<App>.config file STILL isn't copied to the bin folder. I can copy it there
manually and my custom publisher works just fine (I got my exceptions via
email!), but I'd still like to know what I need to do to make this file an
"integral" part of my app.

Before sending this, I took a look at my project's properties, and under
Configuration Properties | Deployment I found a dropdown for an override
file! My <App>.config file was available in the dropdown, so I selected it
and rebuilt the project. This has to work, right? Nope....

Help?
Nov 20 '05 #2

P: n/a
Jeff,
Not sure about the custom publisher stuff.

Microsoft fixed a 'feature' of VS.NET 2002 in VS.NET 2003. :-|

You need to add your config file to your VS.NET project's root folder as
app.config, it needs to be named "app.config" without the quotes. When you
build your project VS.NET (both 2002 & 2003) will copy the app.config file
from the project root to your output folder and name it appropriately
(myproject.exe.config).

Be certain to put the custom publisher information in the app.config in your
project, as any app.config else where will be overwritten.

Hope this helps
Jay

"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:uo**************@TK2MSFTNGP11.phx.gbl...

"Jeff Johnson [MVP: VB]" <i.***@enough.spam> wrote in message
news:el**************@TK2MSFTNGP09.phx.gbl...
So I guess my second question is: has anyone gotten a custom publisher to work with a service?
Okay, experiment and learn. It seems that every time I build my solution,

my <App>.config is wiped out of the bin folder. So I try to figure out why it's not going into the folder with all the other items in my project. I hit on
the build action property and read about it. Hmmm, perhaps I should set it
to Content instead of None? I have two text files in the project whose build action in Content and they're getting put in the bin folder, so, along with the infomation in MSDN, I figure this will solve the problem. Bzzzzztt!! My <App>.config file STILL isn't copied to the bin folder. I can copy it there manually and my custom publisher works just fine (I got my exceptions via
email!), but I'd still like to know what I need to do to make this file an
"integral" part of my app.

Before sending this, I took a look at my project's properties, and under
Configuration Properties | Deployment I found a dropdown for an override
file! My <App>.config file was available in the dropdown, so I selected it
and rebuilt the project. This has to work, right? Nope....

Help?

Nov 20 '05 #3

P: n/a

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
You need to add your config file to your VS.NET project's root folder as
app.config, it needs to be named "app.config" without the quotes. When you
build your project VS.NET (both 2002 & 2003) will copy the app.config file
from the project root to your output folder and name it appropriately
(myproject.exe.config).


Yeah, that was it. I was trying to do the IDE's job for it.... Many thanks.
Nov 20 '05 #4

P: n/a
Jeff,
Pardon the crosspost, but I couldn't find a generic .NET group for VS.NET.


There's microsoft.public.vsnet.general

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.