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

GAC entries don't show up in References/.NET


Two c# dll's were compiled and added to the GAC.

They appear in the .NET Configuration tool.

However, when trying to add a reference to a new project, the dlls do
not appear in the .NET property sheet.

Why not?
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #1
12 1367
Confused? what .Net property sheet are you meaning here?

Nov 16 '05 #2
John Sun wrote:
Confused? what .Net property sheet are you meaning here?


John,

Take a VS.NET project.

Right click on references.

There are three property sheets:

..NET
COM
Projects

On the .NET property sheet, when you scroll through the list -- I would
expect to see every assembly that is in the GAC.

I see my two assemblies in the GAC.
But they do not show up in this list.

The real problem is that when I deploy my windows service, which calls a
DLL that references another DLL an error is thrown and the second DLL
cannot be found!

The first one can!

Both are in a folder in Program files and contained in the GAC.

The *.exe service resides in it's own folder on both the target server
and on my workstation.

I made the folder names and everything else exactly the same.

I cleaned up and deleted each and every other copy of the dlls ( debug
versions ).

My workstation is XP; the server is W2k.

On my workstation, the service can find the first dll, and then it can
find the second.

On the target server, the service can find the first dll, but it throws
an error saying it cannot find the second.

Very puzzling...
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #3
If you cant find them on the ".Net" tab, you should be able to click the
"browse" button and locate your component and then include it.

Ab.

"Ricola !" <se****************@tower.effeil> wrote in message
news:36*************@individual.net...

Two c# dll's were compiled and added to the GAC.

They appear in the .NET Configuration tool.

However, when trying to add a reference to a new project, the dlls do
not appear in the .NET property sheet.

Why not?
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #4
On the .NET property sheet, when you scroll through the list -- I would
expect to see every assembly that is in the GAC.
Well you shouldn't, the Add Refefence dialog doesn't list the content
of the GAC.

The real problem is that when I deploy my windows service, which calls a
DLL that references another DLL an error is thrown and the second DLL
cannot be found!


You can use the Fuslogvw.exe tool to diagnose binding errors.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #5
> There are three property sheets:
you can also call them "tabs"
Both are in a folder in Program files and contained in the GAC. when you deploy .net stuff(assemblies) to other machines these kind of
folder dependencies should not be a problem. Lets say dll1 needs dll2 to
run, then if the dll1 can find dll2 in its own dir than its fine and will
use it, but if its not there than the dll2 maybe a strongly typed assembly
and dll1 should be able to find it if dll2 is registered in the gac.
I made the folder names and everything else exactly the same. no need to do this
On the target server, the service can find the first dll, but it throws
an error saying it cannot find the second. I also maybe missing something as I havnt ever made a windows service and
deployed it. I cannot think of any other situation why your dlls are not
getting located. Maybe versioning would be a problem but I'm not sure about
that. But try a little exercise to be sure that what u r doing is right.
Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2. Now
create an exe (windows forms or console) and call some function of the dll1
(which calls dll2). now deploy these assemblies in your XP machine ( I
assume that you would be using that win2k machine as dev machine). Things
should work.

Ab.

"Ricola !" <se****************@tower.effeil> wrote in message
news:36*************@individual.net... John Sun wrote:
Confused? what .Net property sheet are you meaning here?


John,

Take a VS.NET project.

Right click on references.

There are three property sheets:

.NET
COM
Projects

On the .NET property sheet, when you scroll through the list -- I would
expect to see every assembly that is in the GAC.

I see my two assemblies in the GAC.
But they do not show up in this list.

The real problem is that when I deploy my windows service, which calls a
DLL that references another DLL an error is thrown and the second DLL
cannot be found!

The first one can!

Both are in a folder in Program files and contained in the GAC.

The *.exe service resides in it's own folder on both the target server
and on my workstation.

I made the folder names and everything else exactly the same.

I cleaned up and deleted each and every other copy of the dlls ( debug
versions ).

My workstation is XP; the server is W2k.

On my workstation, the service can find the first dll, and then it can
find the second.

On the target server, the service can find the first dll, but it throws
an error saying it cannot find the second.

Very puzzling...
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #6
Hi,

The contents of the "Add Reference" list of assemblies is populated from the
PublicAssemblies folder under the Visual Studio .NET's installation folder
(something like Common7\IDE\PublicAssemblies).

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Ricola !" <se****************@tower.effeil> wrote in message
news:36*************@individual.net...

Two c# dll's were compiled and added to the GAC.

They appear in the .NET Configuration tool.

However, when trying to add a reference to a new project, the dlls do not
appear in the .NET property sheet.

Why not?
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/


Nov 16 '05 #7
Dmitriy Lapshin [C# / .NET MVP] wrote:
Hi,

The contents of the "Add Reference" list of assemblies is populated from
the PublicAssemblies folder under the Visual Studio .NET's installation
folder (something like Common7\IDE\PublicAssemblies).


... and the assemblies found in the paths stored under teh following
registry hive:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramewor k\AssemblyFolders

Just add a folder there as a key, with a REG_SZ value as the default
value and that value is the full path.

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Nov 16 '05 #8
Abubakar wrote:
I also maybe missing something as I havnt ever made a windows service and
deployed it. I cannot think of any other situation why your dlls are not
getting located. Maybe versioning would be a problem but I'm not sure about
that. But try a little exercise to be sure that what u r doing is right.
Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2. Now
create an exe (windows forms or console) and call some function of the dll1
(which calls dll2). now deploy these assemblies in your XP machine ( I
assume that you would be using that win2k machine as dev machine). Things
should work.


That describes exactly what I'm doing.

The results are ( and I use your names for the sake of readability ):

On the <b>XP</b> machine ( development workstation ) it runs fine --
even if I completely shut down studio and run it normally.

myExe calls dll1 which calls dll2

myEexe is located in \program files\myExe

dll1 and dll2 are located in \program files\myDLLs

dll1 and dll2 have strong names and are registered in the GAC

However, when I move this structure to a target <b>w2k</b> server, dll1
fails to find dll2, generating the error:

2/8/2005 6:56:01 PM: CS0006: Metadata file 'dll2' could not be found
I have searched and deleted all extra copies of myExe, dll1 and dll2 on
both machines.

--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #9

Ok, I found a fix...I thought about it while riding my bicycle to
Tully's to get a coffee.

I put the 2nd dll in the \winnt\system32 directory.

So, for some reason, when a dll calls a 2nd dll.

My theory is that when a dll "runs", it's actually running in
\winnt\system32

And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)
Ricola ! wrote:
Abubakar wrote:
I also maybe missing something as I havnt ever made a windows service
and
deployed it. I cannot think of any other situation why your dlls are not
getting located. Maybe versioning would be a problem but I'm not sure
about
that. But try a little exercise to be sure that what u r doing is right.
Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2. Now
create an exe (windows forms or console) and call some function of the
dll1
(which calls dll2). now deploy these assemblies in your XP machine ( I
assume that you would be using that win2k machine as dev machine). Things
should work.

That describes exactly what I'm doing.

The results are ( and I use your names for the sake of readability ):

On the <b>XP</b> machine ( development workstation ) it runs fine --
even if I completely shut down studio and run it normally.

myExe calls dll1 which calls dll2

myEexe is located in \program files\myExe

dll1 and dll2 are located in \program files\myDLLs

dll1 and dll2 have strong names and are registered in the GAC

However, when I move this structure to a target <b>w2k</b> server, dll1
fails to find dll2, generating the error:

2/8/2005 6:56:01 PM: CS0006: Metadata file 'dll2' could not be found
I have searched and deleted all extra copies of myExe, dll1 and dll2 on
both machines.

--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #10
> I put the 2nd dll in the \winnt\system32 directory.
this is another location where the search is done
And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!) ok so now i had to do an experiment, prepare a code and upload it for your
convenience. I'll give u a simple experiment to do now with assemblies built
by me.
Download the files from here http://www.geocities.com/abubakar021/help.zip.
Extract the files and you'll find a folder named "runfromGAC". It has a
ConsoleApplication1.exe and 2 folders named d1 and d2. Check this:
ConsoleApplication1.exe calls dll1 which calls dll2. Now notice this that
you only have ConsoleApplication1.exe in the root folder and there is no dll
there, so ConsoleApplication1.exe does NOT know where its dependencies are
located which I'm going to demo you. Open a command prompt and browse to the
dir where your ConsoleApplication1.exe is and run it by typing
"ConsoleApplication1.exe" on the command prompt (without quotes of course).
You'll receieve the following error:

+++++++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
ClassLibrary1, or one of its dependenci
es, was not found.
File name: "ClassLibrary1"
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary1, Version=1.0.1867.29218, Culture=neutral,
PublicKeyToken=59c3da0b75007a93
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ConsoleApplication1, Version=1.0.1867.29219,
Culture=neutral, PublicKeyToken=null.
===

LOG: Application configuration file does not exist.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary1, Version=1.0.1867.29218,
Culture=neutral, PublicKeyToken=59c3da0b75007a93

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.DL
L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.EX
E.
+++++++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be diff
on yours.

Read the error, its clear that the class lib 1 is missing. If we register it
this error should go away right? So thats what we r going to do. Now goto
your Control Panel->Administrative Tools. Double click the "Microsoft .NET
Framework 1.1 Configuration". Right click the "Assembly Cache" node and
click "Add ...". Locate the dll1 from "d1" folder and click "Open" and now
the ClassLibrary1.dll is in gac. Now back to command prompt. run the
ConsoleApplication1.exe again. Now you see a similar error as before but its
not the same. Notice now its the following:
+++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
ClassLibrary2, or one of its dependenci
es, was not found.
File name: "ClassLibrary2"
at ClassLibrary1.Class1.getCL2data()
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary2, Version=1.0.1867.29085, Culture=neutral,
PublicKeyToken=3727e4d9d6b9561c
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ClassLibrary1, Version=1.0.1867.29218, Culture=neutral,
PublicKeyToken=59c3da0b75007a93.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary2, Version=1.0.1867.29085,
Culture=neutral, PublicKeyToken=3727e4d9d6b9561c

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.DLL.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.DL
L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.EXE.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.EX
E.
+++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be diff
on yours.

The situation now is that the ClassLibrary1.dll has been located by
ConsoleApplication1 (thanks to gac), but now the ClassLibrary1.dll cannot
locate its dependency which is ClassLibrary2.dll. So now if we just register
the ClassLibrary2.dll this error should also go away and execution of
ConsoleApplication1 should be smooth. So go ahead and register the
ClassLibrary2.dll (which u'll find inside the d2 folder) the same way you
did ClassLibrary1.dll. Once u r done registering the ClassLibrary2.dll with
the "Microsoft .NET Framework 1.1 Configuration", you can now run
ConsoleApplication1 and it'll give the following output:

value is dll2 value.

One of the files inside the zip file that you'll download is in "rar" format
and you can open it using the WinRar which you can get from
www.downloads.com.

I really hope that helps :-)

Ab.
http://joehacker.blogspot.com.
"Ricola !" <se****************@tower.effeil> wrote in message
news:42************@tower.effeil...
Ok, I found a fix...I thought about it while riding my bicycle to
Tully's to get a coffee.

I put the 2nd dll in the \winnt\system32 directory.

So, for some reason, when a dll calls a 2nd dll.

My theory is that when a dll "runs", it's actually running in
\winnt\system32

And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)
Ricola ! wrote:
Abubakar wrote:
I also maybe missing something as I havnt ever made a windows service
and
deployed it. I cannot think of any other situation why your dlls are not getting located. Maybe versioning would be a problem but I'm not sure
about
that. But try a little exercise to be sure that what u r doing is right. Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2. Now create an exe (windows forms or console) and call some function of the
dll1
(which calls dll2). now deploy these assemblies in your XP machine ( I
assume that you would be using that win2k machine as dev machine). Things should work.

That describes exactly what I'm doing.

The results are ( and I use your names for the sake of readability ):

On the <b>XP</b> machine ( development workstation ) it runs fine --
even if I completely shut down studio and run it normally.

myExe calls dll1 which calls dll2

myEexe is located in \program files\myExe

dll1 and dll2 are located in \program files\myDLLs

dll1 and dll2 have strong names and are registered in the GAC

However, when I move this structure to a target <b>w2k</b> server, dll1
fails to find dll2, generating the error:

2/8/2005 6:56:01 PM: CS0006: Metadata file 'dll2' could not be found
I have searched and deleted all extra copies of myExe, dll1 and dll2 on
both machines.

--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/

Nov 16 '05 #11

Abubakar,

That's a very thorough test!

However, there is one more consideration.

This has always worked for me in XP.

The problem is with w2k! (Which OS do you use ?)

When I get to work today, I will download and try this in w2k to see if I
can replication my/your results.

BTW -- I am seeing a lot of other .net/COM interop problems starting after
this weekend -- so I'm wondering if recent security patches have not caused
problems in general for w2k...
Abubakar wrote:
I put the 2nd dll in the \winnt\system32 directory. this is another location where the search is done
And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)

ok so now i had to do an experiment, prepare a code and upload it for your
convenience. I'll give u a simple experiment to do now with assemblies
built by me.
Download the files from here
http://www.geocities.com/abubakar021/help.zip. Extract the files and
you'll find a folder named "runfromGAC". It has a ConsoleApplication1.exe
and 2 folders named d1 and d2. Check this: ConsoleApplication1.exe calls
dll1 which calls dll2. Now notice this that you only have
ConsoleApplication1.exe in the root folder and there is no dll there, so
ConsoleApplication1.exe does NOT know where its dependencies are located
which I'm going to demo you. Open a command prompt and browse to the dir
where your ConsoleApplication1.exe is and run it by typing
"ConsoleApplication1.exe" on the command prompt (without quotes of
course). You'll receieve the following error:

+++++++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name ClassLibrary1, or one of its dependenci
es, was not found.
File name: "ClassLibrary1"
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary1, Version=1.0.1867.29218, Culture=neutral,
PublicKeyToken=59c3da0b75007a93
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ConsoleApplication1, Version=1.0.1867.29219,
Culture=neutral, PublicKeyToken=null.
===

LOG: Application configuration file does not exist.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary1, Version=1.0.1867.29218,
Culture=neutral, PublicKeyToken=59c3da0b75007a93

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.DLL.
LOG: Attempting download of new URL

file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.DL L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.EX E.
+++++++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be
diff on yours.

Read the error, its clear that the class lib 1 is missing. If we register
it this error should go away right? So thats what we r going to do. Now
goto your Control Panel->Administrative Tools. Double click the "Microsoft
.NET Framework 1.1 Configuration". Right click the "Assembly Cache" node
and click "Add ...". Locate the dll1 from "d1" folder and click "Open" and
now the ClassLibrary1.dll is in gac. Now back to command prompt. run the
ConsoleApplication1.exe again. Now you see a similar error as before but
its not the same. Notice now its the following:
+++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name ClassLibrary2, or one of its dependenci
es, was not found.
File name: "ClassLibrary2"
at ClassLibrary1.Class1.getCL2data()
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary2, Version=1.0.1867.29085, Culture=neutral,
PublicKeyToken=3727e4d9d6b9561c
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ClassLibrary1, Version=1.0.1867.29218, Culture=neutral,
PublicKeyToken=59c3da0b75007a93.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary2, Version=1.0.1867.29085,
Culture=neutral, PublicKeyToken=3727e4d9d6b9561c

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.DLL.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.DL L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.EXE.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.EX E.
+++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be
diff on yours.

The situation now is that the ClassLibrary1.dll has been located by
ConsoleApplication1 (thanks to gac), but now the ClassLibrary1.dll cannot
locate its dependency which is ClassLibrary2.dll. So now if we just
register the ClassLibrary2.dll this error should also go away and
execution of ConsoleApplication1 should be smooth. So go ahead and
register the ClassLibrary2.dll (which u'll find inside the d2 folder) the
same way you did ClassLibrary1.dll. Once u r done registering the
ClassLibrary2.dll with the "Microsoft .NET Framework 1.1 Configuration",
you can now run ConsoleApplication1 and it'll give the following output:

value is dll2 value.

One of the files inside the zip file that you'll download is in "rar"
format and you can open it using the WinRar which you can get from
www.downloads.com.

I really hope that helps :-)

Ab.
http://joehacker.blogspot.com.
"Ricola !" <se****************@tower.effeil> wrote in message
news:42************@tower.effeil...

Ok, I found a fix...I thought about it while riding my bicycle to
Tully's to get a coffee.

I put the 2nd dll in the \winnt\system32 directory.

So, for some reason, when a dll calls a 2nd dll.

My theory is that when a dll "runs", it's actually running in
\winnt\system32

And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)
Ricola ! wrote:
> Abubakar wrote:
>
>> I also maybe missing something as I havnt ever made a windows service
>> and
>> deployed it. I cannot think of any other situation why your dlls are not >> getting located. Maybe versioning would be a problem but I'm not sure
>> about
>> that. But try a little exercise to be sure that what u r doing is right. >> Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2. Now >> create an exe (windows forms or console) and call some function of the
>> dll1
>> (which calls dll2). now deploy these assemblies in your XP machine ( I
>> assume that you would be using that win2k machine as dev machine). Things >> should work.
>
>
> That describes exactly what I'm doing.
>
> The results are ( and I use your names for the sake of readability ):
>
> On the <b>XP</b> machine ( development workstation ) it runs fine --
> even if I completely shut down studio and run it normally.
>
> myExe calls dll1 which calls dll2
>
> myEexe is located in \program files\myExe
>
> dll1 and dll2 are located in \program files\myDLLs
>
> dll1 and dll2 have strong names and are registered in the GAC
>
> However, when I move this structure to a target <b>w2k</b> server, dll1
> fails to find dll2, generating the error:
>
> 2/8/2005 6:56:01 PM: CS0006: Metadata file 'dll2' could not be
> found
>
>
> I have searched and deleted all extra copies of myExe, dll1 and dll2 on
> both machines.
>

--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/


--
Texeme
http://texeme.com

Nov 16 '05 #12
> This has always worked for me in XP.

The problem is with w2k! (Which OS do you use ?) oops, I'm also using Windows XP. But just now I tested everything I wrote on
a friend's pc who is running Windows 2000 Pro SP4. Every thing was
absolutely as it was in XP. So its running just fine after gac
registrations. So I hope it goes fine on your win2k machine also.

Ab.

"Lance Boyle" <in****@propaganda.1984> wrote in message
news:VQ*****************@newsread3.news.pas.earthl ink.net...
Abubakar,

That's a very thorough test!

However, there is one more consideration.

This has always worked for me in XP.

The problem is with w2k! (Which OS do you use ?)

When I get to work today, I will download and try this in w2k to see if I
can replication my/your results.

BTW -- I am seeing a lot of other .net/COM interop problems starting after
this weekend -- so I'm wondering if recent security patches have not caused problems in general for w2k...
Abubakar wrote:
I put the 2nd dll in the \winnt\system32 directory.

this is another location where the search is done
And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)

ok so now i had to do an experiment, prepare a code and upload it for your convenience. I'll give u a simple experiment to do now with assemblies
built by me.
Download the files from here
http://www.geocities.com/abubakar021/help.zip. Extract the files and
you'll find a folder named "runfromGAC". It has a ConsoleApplication1.exe and 2 folders named d1 and d2. Check this: ConsoleApplication1.exe calls
dll1 which calls dll2. Now notice this that you only have
ConsoleApplication1.exe in the root folder and there is no dll there, so
ConsoleApplication1.exe does NOT know where its dependencies are located
which I'm going to demo you. Open a command prompt and browse to the dir
where your ConsoleApplication1.exe is and run it by typing
"ConsoleApplication1.exe" on the command prompt (without quotes of
course). You'll receieve the following error:

+++++++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name ClassLibrary1, or one of its dependenci
es, was not found.
File name: "ClassLibrary1"
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary1, Version=1.0.1867.29218, Culture=neutral, PublicKeyToken=59c3da0b75007a93
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ConsoleApplication1, Version=1.0.1867.29219,
Culture=neutral, PublicKeyToken=null.
===

LOG: Application configuration file does not exist.
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary1, Version=1.0.1867.29218,
Culture=neutral, PublicKeyToken=59c3da0b75007a93

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.DLL.
LOG: Attempting download of new URL

file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.DL
L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1.EXE.
LOG: Attempting download of new URL

file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary1/ClassLibrary1.EX
E.
+++++++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be
diff on yours.

Read the error, its clear that the class lib 1 is missing. If we register it this error should go away right? So thats what we r going to do. Now
goto your Control Panel->Administrative Tools. Double click the "Microsoft .NET Framework 1.1 Configuration". Right click the "Assembly Cache" node
and click "Add ...". Locate the dll1 from "d1" folder and click "Open" and now the ClassLibrary1.dll is in gac. Now back to command prompt. run the
ConsoleApplication1.exe again. Now you see a similar error as before but
its not the same. Notice now its the following:
+++++++++++++++
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name ClassLibrary2, or one of its dependenci
es, was not found.
File name: "ClassLibrary2"
at ClassLibrary1.Class1.getCL2data()
at ConsoleApplication1.Class1.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary2, Version=1.0.1867.29085, Culture=neutral, PublicKeyToken=3727e4d9d6b9561c
(Fully-specified)
LOG: Appbase = D:\tempcode\experiment\Run\runfromGAC\
LOG: Initial PrivatePath = NULL
Calling assembly : ClassLibrary1, Version=1.0.1867.29218, Culture=neutral, PublicKeyToken=59c3da0b75007a93.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: ClassLibrary2, Version=1.0.1867.29085,
Culture=neutral, PublicKeyToken=3727e4d9d6b9561c

LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.DLL.
LOG: Attempting download of new URL

file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.DL
L.
LOG: Attempting download of new URL
file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2.EXE.
LOG: Attempting download of new URL

file:///D:/tempcode/experiment/Run/runfromGAC/ClassLibrary2/ClassLibrary2.EX
E.
+++++++++++++++
NOTE: the paths before "runfromGAC" are my machine specific, they'll be
diff on yours.

The situation now is that the ClassLibrary1.dll has been located by
ConsoleApplication1 (thanks to gac), but now the ClassLibrary1.dll cannot locate its dependency which is ClassLibrary2.dll. So now if we just
register the ClassLibrary2.dll this error should also go away and
execution of ConsoleApplication1 should be smooth. So go ahead and
register the ClassLibrary2.dll (which u'll find inside the d2 folder) the same way you did ClassLibrary1.dll. Once u r done registering the
ClassLibrary2.dll with the "Microsoft .NET Framework 1.1 Configuration",
you can now run ConsoleApplication1 and it'll give the following output:

value is dll2 value.

One of the files inside the zip file that you'll download is in "rar"
format and you can open it using the WinRar which you can get from
www.downloads.com.

I really hope that helps :-)

Ab.
http://joehacker.blogspot.com.
"Ricola !" <se****************@tower.effeil> wrote in message
news:42************@tower.effeil...

Ok, I found a fix...I thought about it while riding my bicycle to
Tully's to get a coffee.

I put the 2nd dll in the \winnt\system32 directory.

So, for some reason, when a dll calls a 2nd dll.

My theory is that when a dll "runs", it's actually running in
\winnt\system32

And also, it would mean that a strongly named dll, registered in the
GAC, cannot be called by another dll.

I'd really like someone from Microsoft to prove me wrong on this, as I
suspect is a very major bug in the .NET assembly configuration
management(!)
Ricola ! wrote:
> Abubakar wrote:
>
>> I also maybe missing something as I havnt ever made a windows service >> and
>> deployed it. I cannot think of any other situation why your dlls are

not
>> getting located. Maybe versioning would be a problem but I'm not sure >> about
>> that. But try a little exercise to be sure that what u r doing is

right.
>> Simply make 2 dlls (.net dlls) where dll1 uses some function of dll2.
Now
>> create an exe (windows forms or console) and call some function of

the >> dll1
>> (which calls dll2). now deploy these assemblies in your XP machine ( I >> assume that you would be using that win2k machine as dev machine).

Things
>> should work.
>
>
> That describes exactly what I'm doing.
>
> The results are ( and I use your names for the sake of readability ):
>
> On the <b>XP</b> machine ( development workstation ) it runs fine --
> even if I completely shut down studio and run it normally.
>
> myExe calls dll1 which calls dll2
>
> myEexe is located in \program files\myExe
>
> dll1 and dll2 are located in \program files\myDLLs
>
> dll1 and dll2 have strong names and are registered in the GAC
>
> However, when I move this structure to a target <b>w2k</b> server, dll1 > fails to find dll2, generating the error:
>
> 2/8/2005 6:56:01 PM: CS0006: Metadata file 'dll2' could not be
> found
>
>
> I have searched and deleted all extra copies of myExe, dll1 and dll2 on > both machines.
>
--
Texeme Textcasting Technology
http://texeme.com

Indie Pop Rocks @ SomaFM
http://somafm.com/


--
Texeme
http://texeme.com

Nov 16 '05 #13

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

Similar topics

2
by: Thomas Miller | last post by:
Hello, I have built a c# class library (I will call it "Assembly1"), and built an installer that installs it. It is working well. I created a new asp.net application, right-clicked on references...
10
by: Ricola ! | last post by:
Two c# dll's were compiled and added to the GAC. They appear in the .NET Configuration tool. However, when trying to add a reference to a new project, the dlls do not appear in the .NET...
35
by: .:mmac:. | last post by:
I have a bunch of files (Playlist files for media player) and I am trying to create an automatically generated web page that includes the last 20 or 30 of these files. The files are created every...
12
by: levent | last post by:
What is an elegant way (using std::stream's) to extract number of white-space separated entries in a given line of a formatted text file? e.g.: Take this section of a file, 1 2.78 4 5 -0.003...
14
by: ss.wisch | last post by:
Ok here's the thing... I have a vBulletin forum database... there is a table in there called "post" which has all of my forums posts in it. What I have are many posts with regular titles like "Oh...
10
by: Baldur Norddahl | last post by:
Hi, I just noticed something bad in our database: webshop=# select oid,* from content_loc where id=20488; oid | id | locale | name ---------+-------+--------+-------------- 9781056...
2
by: Stephen Poley | last post by:
I have added a combo-box to a form but it frequently fails to display all entries in the table it is based on. There are 43 entries in the table; the control initially displayed only the first 12. ...
0
by: Ken Allen | last post by:
I have some experience with the use of the Event Log with older applications, and even writing kernel components, where we create our custom MSG file for the messages associated with the Event Log...
1
by: David Laub | last post by:
Visual Studio .net 2003 automatically creates resx files with three entries in them. What I don't understand is: 1) sometimes additional entries are automatically placed in the resx file, and I...
0
by: Randy Smith | last post by:
Hi, For some reason, I am unable to get the child entries to work in a horizontal Menu control. Is there a property that I've failed to set? The menu entries are supposed to look like this:...
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: 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: 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
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?
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.