473,713 Members | 2,743 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing a assembly from the GAC

I have created a class that implements IHttpModule and I want to use the
module on several of the web sites that exist on my server. The module works
great if I place the dll in a web applications bin directory. However, I
can’t get it to work at all from the GAC. If I remove the dll from the web
applications bin file, I get the following error: File or assembly name
RequestHandler, or one of its dependencies, was not found.

The assembly exists in the GAC. It seems like the web application isn’t
looking in the GAC.

Any help would be appreciated.
Apr 21 '06 #1
8 1382
Dale,

The application should automatically look in the GAC first. But it looks for
specific versions. Did you happen to rebuild it before placing it in the GAC
and maybe with an automatically incremented version number? If that's the
case you should manually set the version number and you may have to
re-reference the new build in each of your sites so that they will be
looking for the new version.

To state my guess slightly differently I think the version of your .dll in
the GAC is a newer version than the ones in your bin directories...

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dale" <da**@noemail.n ospam> wrote in message
news:F0******** *************** ***********@mic rosoft.com...
I have created a class that implements IHttpModule and I want to use the
module on several of the web sites that exist on my server. The module
works
great if I place the dll in a web applications bin directory. However, I
can't get it to work at all from the GAC. If I remove the dll from the web
applications bin file, I get the following error: File or assembly name
RequestHandler, or one of its dependencies, was not found.

The assembly exists in the GAC. It seems like the web application isn't
looking in the GAC.

Any help would be appreciated.

Apr 21 '06 #2
Hi Dale,

I agree with Justin that for strong-named assemblies, when we reference
them in ASP.NET web.config file for some custom component(httph andler or
httpmodule...), we must provide their full assembly name. The full name
include assembly filename, version, culture and publickeytoken. Have you
provided all these info for your strong-named assembly(whch contains the
httpmodule class) in GAC?

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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



Apr 24 '06 #3
Here is the exact tag that I am using in the web.config file:

<httpModules>
<add name="rh" type="Dashboard .RequestHandler , RequestHandler,
Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= bcd6707151635d0 7" />
</httpModules>

I got these values by looking at the assembly from the .NET Configuration
1.1 tool. I wish I could insert a screen shot :-(.

Is there any other reason that would prevent the application from searching
the GAC?

Thanks for your help.

"Steven Cheng[MSFT]" wrote:
Hi Dale,

I agree with Justin that for strong-named assemblies, when we reference
them in ASP.NET web.config file for some custom component(httph andler or
httpmodule...), we must provide their full assembly name. The full name
include assembly filename, version, culture and publickeytoken. Have you
provided all these info for your strong-named assembly(whch contains the
httpmodule class) in GAC?

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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



Apr 24 '06 #4
Thanks for your response Dale,

So far I haven't found any particular things which may prevent the GAC from
working. And for general troubleshooting , you can try using the Fusion Log
Viewer to trace the assembly binding processing in your application to see
which assembly is it looking for:

#Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn2.microsoft.com/en-us/library/e74a18c4.aspx

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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

Apr 25 '06 #5
Thanks Steven,

I have opened up the Fusion Log, and there is nothing there. It looks like
no logs have been created at all. Does this point me to a differnt problem?

Dale

"Steven Cheng[MSFT]" wrote:
Thanks for your response Dale,

So far I haven't found any particular things which may prevent the GAC from
working. And for general troubleshooting , you can try using the Fusion Log
Viewer to trace the assembly binding processing in your application to see
which assembly is it looking for:

#Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn2.microsoft.com/en-us/library/e74a18c4.aspx

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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


Apr 25 '06 #6
Does this stack trace help at all?
=== Pre-bind state information ===
LOG: DisplayName = RequestHandler, Culture=neutral
(Partial)
LOG: Appbase = file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: RequestHandler, Culture=neutral
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/mackvolvo/2bca50e6/cffb0f2f/RequestHandler. DLL.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/mackvolvo/2bca50e6/cffb0f2f/RequestHandler/RequestHandler. DLL.
LOG: Attempting download of new URL
file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main/bin/RequestHandler. DLL.
LOG: Attempting download of new URL
file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main/bin/RequestHandler/RequestHandler. DLL.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/mackvolvo/2bca50e6/cffb0f2f/RequestHandler. EXE.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/mackvolvo/2bca50e6/cffb0f2f/RequestHandler/RequestHandler. EXE.
LOG: Attempting download of new URL
file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main/bin/RequestHandler. EXE.
LOG: Attempting download of new URL
file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main/bin/RequestHandler/RequestHandler. EXE.

"Steven Cheng[MSFT]" wrote:
Thanks for your response Dale,

So far I haven't found any particular things which may prevent the GAC from
working. And for general troubleshooting , you can try using the Fusion Log
Viewer to trace the assembly binding processing in your application to see
which assembly is it looking for:

#Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn2.microsoft.com/en-us/library/e74a18c4.aspx

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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


Apr 25 '06 #7
I feel like a complete bone head right now. I removed the new line characters
from the tag in the web.config file and it works fine now.

In other words, I changed this:

<add name="rh" type="Dashboard .RequestHandler , RequestHandler,
Version=1.0.0.0 , Culture=neutral ,
PublicKeyToken= bcd6707151635d0 7" />

To this:

<add name="rh"
type="Dashboard .RequestHandler ,RequestHandler ,Version=1.0.0. 0,
Culture=neutral , PublicKeyToken= bcd6707151635d0 7" />

Thanks everyone for your help.
Apr 25 '06 #8
Thanks for your followup Dale,

Glad that you've finally figured out the problem.

BTW, from the former log you pasted
=============== ===
=== Pre-bind state information ===
LOG: DisplayName = RequestHandler, Culture=neutral
(Partial)
LOG: Appbase = file:///E:/Inetpub/wwwroot/BI_Reports/Mack/Main
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
=============== =====

the below line indicate that the runtime is looking for a partial named
assembly(not strong-named), so this is also a clues help us find there
should be something incorrect with the assembly reference configuration.

LOG: DisplayName = RequestHandler, Culture=neutral
(Partial)

So the fusion log viewer is quite useful for troubleshooting assembly
locating/referencing issue.

Have a good day!

Regards,

Steven Cheng
Microsoft Online Community Support
=============== =============== =============== =====

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

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

Apr 26 '06 #9

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

Similar topics

12
1959
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its associated classes of System.Runtime.Remoting are available, but certain ones are not. A reference to System.Runtime.Remoting needs to be added to make available all the unavailable ones. Now although I (think) understand the concept that an...
4
2286
by: Ron | last post by:
I need to write a custom textbox control that references an object located in the Global.asax class, but I can't compile the control into a DLL without including the reference to the project DLL that includes the Global.asax assembly. I've tried reflection, but I can't seem to make it work correctly. Does anyone have any ideas how I can make this happen? Thanks,
4
2510
by: caelis | last post by:
Hi, I've got a problem with referencing assemblies. I reference an assembly in my programm; this assembly defines a method "SayHello" in the class "Hello", namespace "MyNamespace". In my program I define a method called "SayHello" in a class called "Hello", namespace "MyNamespace", too. When I try to call the method "MyNamespace.Hello.SayHello();" the C#-compiler outputs a warning since it doesn't know whether to call the method...
9
1593
by: Brett Romero | last post by:
Say I have a library (A.dll) with a method that accepts a collection of a specific type. The type is defined in B.dll. In A.dll, I need to loop through this collection and reference fields of the type. For example, a Person type. It may have arm, leg, feet, and hands. Hands is a collection containing types of fingers. The only way to get at fingers is by accepting the parameter as its true type. This means I'll need a file...
0
1151
by: Demetri | last post by:
I have a performance question with regards to packaging assemblies and referencing them. First lets say you have created the following assemblies: Company.Framework.dll Company.Framework.IO.dll Company.Framework.Xml.dll Company.Framework.Data.dll Company.Framework.Web.dll
2
1644
by: Jan | last post by:
Regarding my post "CSharpCodeProvider: referencing other generated "InMemory" assembly" 4/27/2006 and the blog from Greg Young http://geekswithblogs.net/gyoung/archive/2006/04/27/76533.aspx I have now implemented a fine system with code semilar to Greg's example code. I have a warning/comment/question: When the generated main assembly is called for the first time (in my application a static initialize function) another instance of...
1
2369
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been installed into the GAC. We originally had this assembly without a strong-name and we were successfully using it by referencing it when it was NOT in the GAC. The assembly was built using the 1.0 framework and we were able to call it from both 1.0...
7
3492
by: Wiebe Tijsma | last post by:
Hi, I'm running a web application application using the Microsoft.Interop.Security.AzRoles version 1.2.0.0 in the GAC. After an upgrade to Vista, I also have a version 2.0.0.0 in the GAC. I seem to be absolutely unable to make the application load version 1.2. What I've tried:
2
6922
by: Andrus | last post by:
I need compile in-memory assembly which references to other in-memory assembly. Compiling second assembly fails with error Line: 0 - Metadata file 'eed7li9m, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' could not be found Saving assembly to Windows temp directory for referencing only creates huge amout of temporary
0
8701
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9068
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9009
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7942
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6621
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3155
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 we have to send another system
2
2510
muto222
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.