473,379 Members | 1,539 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,379 software developers and data experts.

Can't reference Assemblies in GAC?

I've just created a simple class library, gave it a strong name using
sn.exe, then copied it to c:\winnt\assembly directory. I then created an
ASP client that reference that assembly. The client works only works if I
have the assembly under the ASP client's \bin directory, even though it's
also in GAC. Does anyone know what the problem is?

I got the following error:

File or assembly name <xxxx>, or one of its dependencies, was not found.

The assembly load trace does not seem to include the directory
"c:\winnt\assembly". Does it not always look for the assembly in GAC?

Thanks in advance.
Nick
Jul 19 '05 #1
3 5821
SR
Hi

Try this out

a) Use th GACUtil utility to register in the GAC

b) more important(and believe me, many have had this
problem), is the way u are referrring to the GAC Assembly
in ur aspx. If u are just giving the assembly name, then
u need to have a copy of that assembly in ur bin dir. If
u want to access the GAC based assembly, then u need to
give the full identity(Name+Version+Culture+Public Key).

For example, while using Microsoft IE Web Controls,
If u refer it in ur aspx as
<%@ register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls" Assembly
="Microsoft.Web.UI.WebControls" %>
and it forced me to have a local copy

U change it to
<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

and it will pick up perfectly from the GAC.

The reason is that to use any GAC based assembly u need to
provide the full identity

hope this helps

regards,

sr
-----Original Message-----
I've just created a simple class library, gave it a strong name usingsn.exe, then copied it to c:\winnt\assembly directory. I then created anASP client that reference that assembly. The client works only works if Ihave the assembly under the ASP client's \bin directory, even though it'salso in GAC. Does anyone know what the problem is?

I got the following error:

File or assembly name <xxxx>, or one of its dependencies, was not found.
The assembly load trace does not seem to include the directory"c:\winnt\assembly". Does it not always look for the assembly in GAC?
Thanks in advance.
Nick
.

Jul 19 '05 #2
Fixed. Thanks.

It looks like I had to copy the dll within the production server to GAC.
What I did before was coping the dll across the network.

Thank for the response.
Nick

"SR" <rs*****@yahoo.com> wrote in message
news:04****************************@phx.gbl...
Hi

Try this out

a) Use th GACUtil utility to register in the GAC

b) more important(and believe me, many have had this
problem), is the way u are referrring to the GAC Assembly
in ur aspx. If u are just giving the assembly name, then
u need to have a copy of that assembly in ur bin dir. If
u want to access the GAC based assembly, then u need to
give the full identity(Name+Version+Culture+Public Key).

For example, while using Microsoft IE Web Controls,
If u refer it in ur aspx as
<%@ register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls" Assembly
="Microsoft.Web.UI.WebControls" %>
and it forced me to have a local copy

U change it to
<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

and it will pick up perfectly from the GAC.

The reason is that to use any GAC based assembly u need to
provide the full identity

hope this helps

regards,

sr
-----Original Message-----
I've just created a simple class library, gave it a

strong name using
sn.exe, then copied it to c:\winnt\assembly directory. I

then created an
ASP client that reference that assembly. The client

works only works if I
have the assembly under the ASP client's \bin directory,

even though it's
also in GAC. Does anyone know what the problem is?

I got the following error:

File or assembly name <xxxx>, or one of its dependencies,

was not found.

The assembly load trace does not seem to include the

directory
"c:\winnt\assembly". Does it not always look for the

assembly in GAC?

Thanks in advance.
Nick
.

Jul 19 '05 #3
Not sure if you got a response elsewhere. Anyways, an attempt will be made
to look in the GAC, only if you reference the assembly by the full name -
like so "MyCo.MyAssembly, Version=1.0.1175.28478,
Culture=neutral,PublicKeyToken=5378d68701e60agd"
If you have partial references and don't (cannot) want to change, you can
use qualifyAssembly element in Web.Config to redirect partial-name assembly
requests to full-name requests which then get redirected to GAC.

"Nick" <ni****@hotmail.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
I've just created a simple class library, gave it a strong name using
sn.exe, then copied it to c:\winnt\assembly directory. I then created an
ASP client that reference that assembly. The client works only works if I
have the assembly under the ASP client's \bin directory, even though it's
also in GAC. Does anyone know what the problem is?

I got the following error:

File or assembly name <xxxx>, or one of its dependencies, was not found.

The assembly load trace does not seem to include the directory
"c:\winnt\assembly". Does it not always look for the assembly in GAC?

Thanks in advance.
Nick

Jul 19 '05 #4

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

Similar topics

8
by: Dave | last post by:
This may be a simple question, but I'm new to .NET and not having much luck finding out the answer. I'm writing a Windows Service and want to develop a separate program that provides a user...
4
by: WM Chung | last post by:
Hi all, I meet a problem in building my .Net Solution and I would like to seek help. After I have added a dll to reference in one of my project in my solution, when I re-build the solution, I...
3
by: Vadym Stetsyak | last post by:
Hi there I am building an assembly Asm1, and it has references to Asm2 and Asm3. (/reference: Asm2.dll Asm3.dll) In Asm1 I am using types only from Asm2. The question is will CLR loader load...
3
by: bill joyce | last post by:
I have installed an assembly in the GAC ( a DAL), now I want to make a reference to it in my Business Obj. This is one way I found out how to do it is there another way? <system.web>...
1
by: Adam Getchell | last post by:
I'd like to reference the SQLHelper.dll from the Microsoft Application Data Block. I've created an installer which installs it into the GAC. From reading articles, I've noted that the GAC...
16
by: Kent | last post by:
We have created several Assemblies that we add to the GAC on our web servers. In an ASP.NET app in VS2003, Adding a reference to strong named GAC'd Assembly meant that the web app would use...
7
by: Oldman | last post by:
How do you conditionally reference an assembly based off of the build configuration? Imagine a scenario where I want to have an Sql Release Server build and an Oracle Release Build and the only...
11
by: Mark Olbert | last post by:
I'm running into some oddball behavior that I hope is not by design. When I add a reference (via Add Reference) to the bin folder, some, but not all, of the assemblies referenced by the assembly...
27
by: HKSHK | last post by:
Hello, I have this problem: I wrote some DLLs with VB.Net 2003 which I use with my programs. But I want to avoid that I have to go down to "DLL hell" and to copy all used dlls into each program...
14
by: Monty | last post by:
Hello, I have created a solution which has both a web UI and a winform UI, the latter is just for administrators. The Web UI (a Web Application Project) and the winform project both...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.