ConfigSections in ASP.Net 2.0

Discussion in 'ASP .Net' started by Stephen Woolhead, Aug 15, 2004.

  1. I have a web application that has several ConfigSection handlers defined,
    one in the web application it's self and several in external assemblies. I
    am using VS's built in web server

    My problem is that I can not get the section in the webapps assembly to
    load, i get the error:

    Parser Error Message: Exception creating section handler : File or assembly
    name 'MyWebApp', or one of its dependencies, was not found.

    <section name="FileLocationConfiguration"
    type="MyWebApp.ConfigHandlers.FileLocationConfiguration, MyWebApp"/>

    Now best I can tell is that this is to do with a change in the way ASP.Net
    compiles the assembly, in the 1.1 days you would actually get a MyWebApp.dll
    assembly from which I could load the config handler, but in 2.0 this file no
    longer seems to exist.

    If I drop the assebly name from the section element it complains that it can
    not be found in the system assembly.

    What I would appear to need to knowis what is the name of the generated
    assembly for the web project unless there is a better way to do this.

    Thanks for any help

    Stephen.
     
    Stephen Woolhead, Aug 15, 2004
    #1
    1. Advertising

  2. Hi Stephen,

    Is the type 'MyWebApp.ConfigHandlers.FileLocationConfiguration' in a file in
    the "code" directory? If so, then the assembly containing that type is named
    "Code.dll"

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    My profile: http://aspnet2.com/mvp.ashx?vga

    "Stephen Woolhead" <> wrote in message
    news:...
    > I have a web application that has several ConfigSection handlers defined,
    > one in the web application it's self and several in external assemblies.

    I
    > am using VS's built in web server
    >
    > My problem is that I can not get the section in the webapps assembly to
    > load, i get the error:
    >
    > Parser Error Message: Exception creating section handler : File or

    assembly
    > name 'MyWebApp', or one of its dependencies, was not found.
    >
    > <section name="FileLocationConfiguration"
    > type="MyWebApp.ConfigHandlers.FileLocationConfiguration, MyWebApp"/>
    >
    > Now best I can tell is that this is to do with a change in the way ASP.Net
    > compiles the assembly, in the 1.1 days you would actually get a

    MyWebApp.dll
    > assembly from which I could load the config handler, but in 2.0 this file

    no
    > longer seems to exist.
    >
    > If I drop the assebly name from the section element it complains that it

    can
    > not be found in the system assembly.
    >
    > What I would appear to need to knowis what is the name of the generated
    > assembly for the web project unless there is a better way to do this.
    >
    > Thanks for any help
    >
    > Stephen.
    >
    >
     
    Victor Garcia Aprea [MVP], Aug 15, 2004
    #2
    1. Advertising

  3. Yes it is, well it's in a sub folder under the code folder.

    Unfortunally this does not work, and I get the same assembly not found
    error. I changed the section element to
    <section name="FileLocationConfiguration"
    type="MyWebApp.Classes.FileLocationConfiguration, Code"/>

    If I remove the handler and run the project, I do not see Code.dll loaded,
    but I do see __codezunkgdyc.dll loaded, is this possibly what you are
    thinking of? If it is then there is a problem as the name changes every
    time the project compiles!

    Thanks

    Stephen.


    "Victor Garcia Aprea [MVP]" <> wrote in message
    news:...
    > Hi Stephen,
    >
    > Is the type 'MyWebApp.ConfigHandlers.FileLocationConfiguration' in a file
    > in
    > the "code" directory? If so, then the assembly containing that type is
    > named
    > "Code.dll"
    >
    > --
    > Victor Garcia Aprea
    > Microsoft MVP | ASP.NET
    > Looking for insights on ASP.NET? Read my blog:
    > http://obies.com/vga/blog.aspx
    > My profile: http://aspnet2.com/mvp.ashx?vga
    >
    > "Stephen Woolhead" <> wrote in message
    > news:...
    >> I have a web application that has several ConfigSection handlers defined,
    >> one in the web application it's self and several in external assemblies.

    > I
    >> am using VS's built in web server
    >>
    >> My problem is that I can not get the section in the webapps assembly to
    >> load, i get the error:
    >>
    >> Parser Error Message: Exception creating section handler : File or

    > assembly
    >> name 'MyWebApp', or one of its dependencies, was not found.
    >>
    >> <section name="FileLocationConfiguration"
    >> type="MyWebApp.ConfigHandlers.FileLocationConfiguration, MyWebApp"/>
    >>
    >> Now best I can tell is that this is to do with a change in the way
    >> ASP.Net
    >> compiles the assembly, in the 1.1 days you would actually get a

    > MyWebApp.dll
    >> assembly from which I could load the config handler, but in 2.0 this file

    > no
    >> longer seems to exist.
    >>
    >> If I drop the assebly name from the section element it complains that it

    > can
    >> not be found in the system assembly.
    >>
    >> What I would appear to need to knowis what is the name of the generated
    >> assembly for the web project unless there is a better way to do this.
    >>
    >> Thanks for any help
    >>
    >> Stephen.
    >>
    >>

    >
    >
     
    Stephen Woolhead, Aug 15, 2004
    #3
  4. I just did quick check and the latest bits are not always generating a
    'code.dll' assembly as earlier bits did. As you already discovered a
    'codexxxx.dll' is being generated in the latest bits which is really no
    useful at all if you need to specify the assembly qualified name of a type
    like you may need for config sections, personalization, etc.

    In previous bits I did coded some custom type converters for
    personalization, added them to 'Code' and then could use them because a
    'Code.dll' was always generated. I do remember also that a couple of bugs
    were submitted at that time (1 year from now) because of some weird locking
    issues on 'code.dll'. So this may be the cause to not generate a single
    code.dll now, but I dont really know.

    I will try some some testings tomorrow (after getting some sleep) and if I
    can't still figure out this I'll ping some team members to see how are you
    supposed now to know (at design-time) the assembly qualified name of a type
    living in the 'code' folder.

    Will let you know by posting here of any news,

    PS. As a temporal (and ugly) workaround you could compile the config section
    handling code into its own class library and deploy that assembly to the
    'bin' directory in order to know the type's assembly qualified name at
    design time.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    My profile: http://aspnet2.com/mvp.ashx?vga

    "Stephen Woolhead" <> wrote in message
    news:...
    > Yes it is, well it's in a sub folder under the code folder.
    >
    > Unfortunally this does not work, and I get the same assembly not found
    > error. I changed the section element to
    > <section name="FileLocationConfiguration"
    > type="MyWebApp.Classes.FileLocationConfiguration, Code"/>
    >
    > If I remove the handler and run the project, I do not see Code.dll loaded,
    > but I do see __codezunkgdyc.dll loaded, is this possibly what you are
    > thinking of? If it is then there is a problem as the name changes every
    > time the project compiles!
    >
    > Thanks
    >
    > Stephen.
    >
    >
    > "Victor Garcia Aprea [MVP]" <> wrote in message
    > news:...
    > > Hi Stephen,
    > >
    > > Is the type 'MyWebApp.ConfigHandlers.FileLocationConfiguration' in a

    file
    > > in
    > > the "code" directory? If so, then the assembly containing that type is
    > > named
    > > "Code.dll"
    > >
    > > --
    > > Victor Garcia Aprea
    > > Microsoft MVP | ASP.NET
    > > Looking for insights on ASP.NET? Read my blog:
    > > http://obies.com/vga/blog.aspx
    > > My profile: http://aspnet2.com/mvp.ashx?vga
    > >
    > > "Stephen Woolhead" <> wrote in message
    > > news:...
    > >> I have a web application that has several ConfigSection handlers

    defined,
    > >> one in the web application it's self and several in external

    assemblies.
    > > I
    > >> am using VS's built in web server
    > >>
    > >> My problem is that I can not get the section in the webapps assembly to
    > >> load, i get the error:
    > >>
    > >> Parser Error Message: Exception creating section handler : File or

    > > assembly
    > >> name 'MyWebApp', or one of its dependencies, was not found.
    > >>
    > >> <section name="FileLocationConfiguration"
    > >> type="MyWebApp.ConfigHandlers.FileLocationConfiguration, MyWebApp"/>
    > >>
    > >> Now best I can tell is that this is to do with a change in the way
    > >> ASP.Net
    > >> compiles the assembly, in the 1.1 days you would actually get a

    > > MyWebApp.dll
    > >> assembly from which I could load the config handler, but in 2.0 this

    file
    > > no
    > >> longer seems to exist.
    > >>
    > >> If I drop the assebly name from the section element it complains that

    it
    > > can
    > >> not be found in the system assembly.
    > >>
    > >> What I would appear to need to knowis what is the name of the generated
    > >> assembly for the web project unless there is a better way to do this.
    > >>
    > >> Thanks for any help
    > >>
    > >> Stephen.
    > >>
    > >>

    > >
    > >

    >
    >
     
    Victor Garcia Aprea [MVP], Aug 15, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jaco de Villiers

    configSections - .Net Bug - Please Help

    Jaco de Villiers, Jul 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    410
  2. WFB
    Replies:
    2
    Views:
    7,672
  3. eje
    Replies:
    1
    Views:
    934
    Karl Seguin
    Nov 29, 2004
  4. Andrea Moro

    Some questions on configsections

    Andrea Moro, Jan 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    320
    Karl Seguin
    Jan 27, 2005
  5. wolfgang wagner

    web.config "configSections" error in asp.net 2.0

    wolfgang wagner, Mar 23, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    4,915
    Juan T. Llibre
    Apr 4, 2006
Loading...

Share This Page