ConfigSections in ASP.Net 2.0

S

Stephen Woolhead

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.
 
S

Stephen Woolhead

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.
 
V

Victor Garcia Aprea [MVP]

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top