General VS.NET structure question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Johnson [MVP: VB]

    #1

    General VS.NET structure question

    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 ExceptionPublis her 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 ExceptionManage r 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 (ConfigurationS ettings.GetConf ig(EXCEPTIONMAN AGEMENT_CONFIG_ SECTION) ==
    null)

    is always true.

    So I guess my second question is: has anyone gotten a custom publisher to
    work with a service?


  • Jeff Johnson [MVP: VB]

    #2
    Re: General VS.NET structure question


    "Jeff Johnson [MVP: VB]" <i.get@enough.s pam> wrote in message
    news:elsKE$WgDH A.1764@TK2MSFTN GP09.phx.gbl...
    [color=blue]
    > So I guess my second question is: has anyone gotten a custom publisher to
    > work with a service?[/color]

    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?


    Comment

    • Jay B. Harlow [MVP - Outlook]

      #3
      Re: General VS.NET structure question

      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.get@enough.s pam> wrote in message
      news:uoLZQ5dgDH A.2400@TK2MSFTN GP11.phx.gbl...[color=blue]
      >
      > "Jeff Johnson [MVP: VB]" <i.get@enough.s pam> wrote in message
      > news:elsKE$WgDH A.1764@TK2MSFTN GP09.phx.gbl...
      >[color=green]
      > > So I guess my second question is: has anyone gotten a custom publisher[/color][/color]
      to[color=blue][color=green]
      > > work with a service?[/color]
      >
      > Okay, experiment and learn. It seems that every time I build my solution,[/color]
      my[color=blue]
      > <App>.config is wiped out of the bin folder. So I try to figure out why[/color]
      it's[color=blue]
      > 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[/color]
      build[color=blue]
      > action in Content and they're getting put in the bin folder, so, along[/color]
      with[color=blue]
      > the infomation in MSDN, I figure this will solve the problem. Bzzzzztt!![/color]
      My[color=blue]
      > <App>.config file STILL isn't copied to the bin folder. I can copy it[/color]
      there[color=blue]
      > 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?
      >
      >[/color]


      Comment

      • Jeff Johnson [MVP: VB]

        #4
        Re: General VS.NET structure question


        "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in message
        news:eoqgVQegDH A.2352@TK2MSFTN GP09.phx.gbl...
        [color=blue]
        > 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).[/color]

        Yeah, that was it. I was trying to do the IDE's job for it.... Many thanks.


        Comment

        • Mattias Sjögren

          #5
          Re: General VS.NET structure question

          Jeff,
          [color=blue]
          >Pardon the crosspost, but I couldn't find a generic .NET group for VS.NET.[/color]

          There's microsoft.publi c.vsnet.general



          Mattias

          --
          Mattias Sjögren [MVP] mattias @ mvps.org

          Please reply only to the newsgroup.

          Comment

          Working...