473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

ConfigSections in ASP.Net 2.0

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.
Nov 18 '05 #1
3 1383
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" <st*****@perfectphase.com> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
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.

Nov 18 '05 #2
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]" <vg*@NOobiesSPAM.com> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl...
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" <st*****@perfectphase.com> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
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.


Nov 18 '05 #3
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" <st*****@perfectphase.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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]" <vg*@NOobiesSPAM.com> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl...
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" <st*****@perfectphase.com> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
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.



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jaco De Villiers | last post by:
Hi, I have added the following group and section: <configSections> <section name="sampleSection" type="System.Configuration.SingleTagSectionHandler" /> <sectionGroup name="tilos.sdk">...
2
by: WFB | last post by:
Hi I have an application with a couple of referenced assemblies. The referenced assemblies and my application all share a few configuration settings with the same name but different values. Is...
1
by: eje | last post by:
I want to use configSections for applicationsettings but I get Exception creating section handler. My code in web.config: <configuration> <configSections> <sectionGroup...
1
by: Andrea Moro | last post by:
In web.config file I do as follow: <configsections> <sectiongroup name="Database"> <section name="Access" type=".... Ok problem is there in type. According to the help is only needed the...
2
by: Joseph Geretz | last post by:
Parser Error Message: Only one <configSections> element allowed. It must be the first child element of the root <configuration> element. OK, fine, easy enough to fix, I just need to copy and...
5
by: wolfgang wagner | last post by:
hi all! i'm trying to define a custom config section like described in the online help of VS2005: <configuration> <configSections> <section name="sampleSection"...
0
by: Jeffrey Hornby | last post by:
I'm getting "Exception in configuration section handler" when I start my web program and its indicating the opening tag of a custom configSection in my web.config. The relevant parts of the...
3
by: =?Utf-8?B?TUNN?= | last post by:
I have the following configSections in my web.config. Again, it's not clear to me what this is doing because I can delete the entire section and the application compiles and runs fine. Why do I...
7
by: =?Utf-8?B?RXZl?= | last post by:
I have the following sections defined in my app.config file: <configSections> <section name="1" type="System.Configuration.DictionarySectionHandler" /> <section name="2"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.