Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ConfigSections in ASP.Net 2.0

Reply
Thread Tools

ConfigSections in ASP.Net 2.0

 
 
Stephen Woolhead
Guest
Posts: n/a
 
      08-15-2004
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.FileLocationConfigur ation, 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.


 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      08-15-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.FileLocationConfigur ation, 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.
>
>



 
Reply With Quote
 
 
 
 
Stephen Woolhead
Guest
Posts: n/a
 
      08-15-2004
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.FileLocationConfigur ation, 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.
>>
>>

>
>



 
Reply With Quote
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      08-15-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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.FileLocationConfigur ation, 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.
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why must <configSections> be 1st element of <configuration> ? Joseph Geretz ASP .Net 2 09-30-2005 07:49 PM
Some questions on configsections Andrea Moro ASP .Net 1 01-27-2005 07:32 PM
ConfigSections. Exception creating handler eje ASP .Net 1 11-29-2004 04:03 PM
configSections in Web.config file WFB ASP .Net 2 11-05-2003 08:14 PM
configSections - .Net Bug - Please Help Jaco de Villiers ASP .Net 1 08-06-2003 10:43 PM



Advertisments