General VS.NET structure question

  • Thread starter Thread starter Jeff Johnson [MVP: VB]
  • Start date Start date
J

Jeff Johnson [MVP: VB]

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(EXCEPTIONMANAGEMENT_CONFIG_SECTION) ==
null)

is always true.

So I guess my second question is: has anyone gotten a custom publisher to
work with a service?
 
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?
 
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
 
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.
 
Back
Top