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

Assembly not found when in GAC

Hi All,

I recently moved our assembly which stores our 'common' code into the
GAC. I then moved all copies of this assembly out of the /bin folders,
restarted IIS. I get the error below.

This is the first time I have put something into the GAC, from what I
read, the GAC is probed first, before looking to application folders,
so surely my code should load from the GAC, if its not in the app
folders? Or, is the error due to the way we have referenced the
libraries when building (Referenced by project).

Any help/advice on this will be appreciated.

Thanks,

Simon.

Server Error in '/netapps' Application.
--------------------------------------------------------------------------------

File or assembly name OldInfra, or one of its dependencies, was not
found.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: File or assembly
name OldInfra, or one of its dependencies, was not found.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'OldInfra' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = OldInfra, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/Introot/netapps
LOG: Initial PrivatePath = bin
Calling assembly : EmpPhotos, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: OldInfra, Version=1.0.2056.26999,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.EXE.

Stack Trace:
[FileNotFoundException: File or assembly name OldInfra, or one of its
dependencies, was not found.]
EmpPhotos.stats.Page_Load(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

Nov 19 '05 #1
3 1806
Hey,

Is your DLL dependent on another assemly (not in the GAC)?

Dennis
Hi All,

I recently moved our assembly which stores our 'common' code into the
GAC. I then moved all copies of this assembly out of the /bin folders,
restarted IIS. I get the error below.

This is the first time I have put something into the GAC, from what I
read, the GAC is probed first, before looking to application folders,
so surely my code should load from the GAC, if its not in the app
folders? Or, is the error due to the way we have referenced the
libraries when building (Referenced by project).

Any help/advice on this will be appreciated.

Thanks,

Simon.

Server Error in '/netapps' Application.
----------------------------------------------------------------------
----------
File or assembly name OldInfra, or one of its dependencies, was not
found.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: File or assembly
name OldInfra, or one of its dependencies, was not found.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to
determine why the assembly 'OldInfra' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = OldInfra, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/Introot/netapps
LOG: Initial PrivatePath = bin
Calling assembly : EmpPhotos, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null.
===
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: OldInfra, Version=1.0.2056.26999,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.EXE.
Stack Trace:

[FileNotFoundException: File or assembly name OldInfra, or one of its
dependencies, was not found.]
EmpPhotos.stats.Page_Load(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
----------------------------------------------------------------------
----------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

Nov 19 '05 #2

You need to tell ASP.NET explicitly to look for assemblies in the GAC.
Unlike WinForms application which automatically look in the GAC, ASP.NET
applications do not.

You can do this by adding something like this:

<compilation defaultLanguage="c#" debug="true">

<assemblies>

<add assembly="MyAssembly.MyClass, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>

</assemblies>

</compilation>
to web.config. You need to use the strong name for the assembly.
Hope this helps,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog

"Web Team @ Borough of Poole" <we*********@poole.gov.uk> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi All,

I recently moved our assembly which stores our 'common' code into the
GAC. I then moved all copies of this assembly out of the /bin folders,
restarted IIS. I get the error below.

This is the first time I have put something into the GAC, from what I
read, the GAC is probed first, before looking to application folders,
so surely my code should load from the GAC, if its not in the app
folders? Or, is the error due to the way we have referenced the
libraries when building (Referenced by project).

Any help/advice on this will be appreciated.

Thanks,

Simon.

Server Error in '/netapps' Application.
--------------------------------------------------------------------------------

File or assembly name OldInfra, or one of its dependencies, was not
found.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: File or assembly
name OldInfra, or one of its dependencies, was not found.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'OldInfra' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = OldInfra, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///D:/Introot/netapps
LOG: Initial PrivatePath = bin
Calling assembly : EmpPhotos, Version=1.0.2056.26999, Culture=neutral,
PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: OldInfra, Version=1.0.2056.26999,
Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.DLL.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra.EXE.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/netapps/54285709/c2671f29/OldInfra/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra.EXE.
LOG: Attempting download of new URL
file:///D:/Introot/netapps/bin/OldInfra/OldInfra.EXE.

Stack Trace:
[FileNotFoundException: File or assembly name OldInfra, or one of its
dependencies, was not found.]
EmpPhotos.stats.Page_Load(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET Version:1.1.4322.2032

Nov 19 '05 #3
Hi Rick,

Thanks for your reply. Couple of questions if you don't mind...

- Do I do this in the web.config for each application?
- I take it I would then have to rebuild all my apps?
- Where do I get the value for the PublicKeyToken attribute?

Cheers!

Simon.
Rick Strahl [MVP] wrote:
You need to tell ASP.NET explicitly to look for assemblies in the GAC.
Unlike WinForms application which automatically look in the GAC, ASP.NET
applications do not.

You can do this by adding something like this:

<compilation defaultLanguage="c#" debug="true">

<assemblies>

<add assembly="MyAssembly.MyClass, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>

</assemblies>

</compilation>
to web.config. You need to use the strong name for the assembly.
Hope this helps,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog


Nov 19 '05 #4

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

Similar topics

5
by: Edward Diener | last post by:
This has occurred in MC++, but since there is very little response on that NG, I am also reporting it here in the hope that someone can find me a workaround, and report it to MS. If a __value...
3
by: Karl Hungus | last post by:
A cs file I compiled into an assembly dll is in my bin directory. In the cs file I have a using statement for System.Xml I compiled it using this command: csc /out:XmlContent.dll /t:library...
18
by: Praveen Ramesh | last post by:
Hi, Is there any way to add the @Assembly reference to the aspx files programmatically from inside a custom control (when it gets dropped on to the page from the toolbox)? I have a custom...
3
by: Jim | last post by:
Hi, I have an assembly and it's satellite in my GAC. I have referenced the DLLs in my project (from the same location where I added it to the GAC). CopyLocal is set false. When I run the...
2
by: Andrew Jocelyn | last post by:
Hi I get this error when I change something in the web.config file. When I build the VS projects and load the first web page the application runs fine. If I then make a save the web.config file...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
0
by: jason_cuteboy | last post by:
Hi all, Completely new to Vb.net and trying to create a simple VB Office Excel application/spreadsheet. When I built the project, and excel opens up an error comes up.... Customization assembly...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
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...
0
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...

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.