473,473 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Shared Assemblies and web.config config serctions

Hi all

I have a common shared assembly in intalled in the GAC: myco.myprod.common.dll

I have set a reference to this assembly in a asp.net web application. I have config sections in my web.config like the following:

<configSections>
<section name="Configuration" type="myco.myprod.common.Configuration, myco.myprod.common" />
</configSections>

<Configuration>
<add key="MyKey" value="MyKeyValue" />
</Configuration>

I now get the following error:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Exception creating section handler.

All works fine if I reference a local copy of the myco.myprod.common.dll. I imagine it must be something with the way I have defined the reference to the assembly in the <section>

Has anyone else had the same problem?

Thanks,

Sam
Nov 18 '05 #1
3 1793
I declare my assemblies in the system.web element:
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="<assembly name>, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=9ed54aaf75e356eb"/>
<add assembly="<assembly 2 name>, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=6019da3d2d8ab425"/>
<add assembly="etc., Version=1.0.0.0, Culture=neutral,
PublicKeyToken=8f6299a5dbc2b9ce"/>
</assemblies>
</compilation>

I specify the public key token because i strong name my assemblies.
Everything works great and I can reference types from within .ascx,
..aspx, or classs files without any issues.

Sam-I-Am wrote:
Hi all

I have a common shared assembly in intalled in the GAC:
myco.myprod.common.dll

I have set a reference to this assembly in a asp.net web application.
I have config sections in my web.config like the following:

<configSections>
<section name="Configuration"
type="myco.myprod.common.Configuration, myco.myprod.common" />
</configSections>

<Configuration>
<add key="MyKey" value="MyKeyValue" />
</Configuration>

I now get the following error:
Configuration Error

Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.

Parser Error Message: Exception creating section handler.
All works fine if I reference a local copy of the
myco.myprod.common.dll. I imagine it must be something with the way I
have defined the reference to the assembly in the <section>

Has anyone else had the same problem?

Thanks,

Sam


Nov 18 '05 #2
I have managed to find a solution. I needed to declare the assemblies using
the full assembly name including version, culuture and key like:

<configSections>
<section name="Configuration" type="myco.myprod.common.Configuration,
myco.myprod.common,, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=10633fbfa3fade6e " />
</configSections>
"Sam-I-Am" <sa****@3hgroup.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
Hi all

I have a common shared assembly in intalled in the GAC:
myco.myprod.common.dll

I have set a reference to this assembly in a asp.net web application. I have
config sections in my web.config like the following:

<configSections>
<section name="Configuration" type="myco.myprod.common.Configuration,
myco.myprod.common" />
</configSections>

<Configuration>
<add key="MyKey" value="MyKeyValue" />
</Configuration>

I now get the following error:
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: Exception creating section handler.

All works fine if I reference a local copy of the myco.myprod.common.dll. I
imagine it must be something with the way I have defined the reference to
the assembly in the <section>

Has anyone else had the same problem?

Thanks,

Sam
Nov 18 '05 #3
Hi Sam,

Yes, when you put an assemlby into GAC, it means that the Assembly must be
Strong-Named. And in .net we must use Full-qualified name to reference a
strong-named assembly , just the signature as

<assembly name>, <version number>, <culture>, <strong name>

You may find the detailed description in the following reference:
#Referencing a Strong-Named Assembly
http://msdn.microsoft.com/library/en...rencingstrongl
y-namedassembly.asp?frame=true

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

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

Similar topics

3
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of...
1
by: Dan | last post by:
Here's a scenario I'd like to discuss in order to setup my VS.NET IDE properly and be able to prepare a distribution: a) I have a windows forms C# app using 3 shared assemblies I developed to...
0
by: RadekP | last post by:
Hi Gurus .. I would really appreciate some insights for the problem that bugs me for quite some time. I keep my custom controls in their own shared (private/public key signed) assembly. I need...
9
by: Invalidlastname | last post by:
Hi, We developed some assemblies which use EnterpriseServices queued components. In order to use EnterpriseServices, these assemblies need to be installed into GAC. I used the pre-build and...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
9
by: Dwight | last post by:
I have several projects that use the same dlls. When deploying these projects, is there a way that I can have all the shared dlls in one subdirectory and the project specific files in another? ...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
3
by: Tony Johansson | last post by:
Hello! I just want to check with you if .NET assemblies consist of only shared assemblies ? It must be shared assemblies because you never copies these assemblies to the folder where your...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.