General VS.NET structure question

23/09/2003 - 03:14 por Jeff Johnson [MVP: VB] | Informe spam
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?

Preguntas similare

Leer las respuestas

#1 Jeff Johnson [MVP: VB]
23/09/2003 - 16:23 | Informe spam
"Jeff Johnson [MVP: VB]" wrote in message
news:elsKE$

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?
Respuesta Responder a este mensaje
#2 Jay B. Harlow [MVP - Outlook]
23/09/2003 - 17:04 | Informe spam
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]" wrote in message
news:

"Jeff Johnson [MVP: VB]" wrote in message
news:elsKE$

> 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?


Respuesta Responder a este mensaje
#3 Jeff Johnson [MVP: VB]
23/09/2003 - 20:06 | Informe spam
"Jay B. Harlow [MVP - Outlook]" wrote in message
news:

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.
Respuesta Responder a este mensaje
#4 Mattias Sjögren
23/09/2003 - 22:31 | Informe spam
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.
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida