473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shared Assembly in GAC and its dependencies assemblies

MA
Hi,

We have added a shared assembly in GAC so that our multiple solutions
can use use it. We use the publisher policy to controls the different
versions of the assembly.

This shared assembly also has dependencies (some are .NET assembly
with strong name and some non .NET without strong name). How we will
manage the dependent assemblies? Does the dependent assemblies will
need to be added to the GAC?

Obviously we will not able to add the weak name assembly to the GAC.
How can we manage one copy of the weak named assembly so that we can
update in future?

We will prefer not make local references of the dependent assemblies
(i.e. assemblies will need to be exists in solution installation
folder) so that we can update the dependent assemblies if required
without updating each solution.
Example:
Assembly1: depend on Assembly2 (strong named) & Assembly3 (weak
named).
Assembly1 added to the GAC. Do we need to add the Assembly2 to the GAC
as well? The Assembly3 is not strong named, how we will manage the
Assembly3? Does each solution will need the local copy of the
Assembly3 or can we add to the "c:\program files\shared" and manage it
centrally?
Hope this make sense and thanks in advance for your suggestions.

Regards,
MA
Sep 3 '08 #1
16 3368
MA
Thanks for your response.

Btw, I have tried to create the wrapper assembly using the C#
compiler but without any success. The C# compiler (CSC) require a
target file (I am not sure what is the target file to enter). I want
to add the unmanaged.dll (written in Delphi) to the managed dll
(written in C#). Any suggestions?

Regards,
MA
Sep 4 '08 #2
MA
Just another thought....

Can we have the local copy of the dependent assembly to the solution
installation folder? For example,

We have a AssemblyA (written in C#) which we added to the GAC.
AssemblyA has the references of AssemblyB (written in Delphi) and
other interop assemblies (un-managed).

Can we have the local copy of these un-managed assmblies to the
solution installation folder? How the assembly loader will work where
the AssemblyA in GAC but the dependencies are in solution installation
folder.

Thanks for your advice.

Regards,
MA
Sep 4 '08 #3
"MA" <ma*******@gmail.comwrote in message
news:5b**********************************@s20g2000 prd.googlegroups.com...
Btw, I have tried to create the wrapper assembly using the C#
compiler but without any success. The C# compiler (CSC) require a
target file (I am not sure what is the target file to enter). I want
to add the unmanaged.dll (written in Delphi) to the managed dll
(written in C#). Any suggestions?
Why not just use /linkresource when you compile your managed .dll?
Sep 4 '08 #4
"MA" <ma*******@gmail.comwrote in message
news:e6**********************************@n33g2000 pri.googlegroups.com...
Just another thought....

Can we have the local copy of the dependent assembly to the solution
installation folder? For example,

We have a AssemblyA (written in C#) which we added to the GAC.
AssemblyA has the references of AssemblyB (written in Delphi) and
other interop assemblies (un-managed).

Can we have the local copy of these un-managed assmblies to the
solution installation folder? How the assembly loader will work where
the AssemblyA in GAC but the dependencies are in solution installation
folder.
I'm afraid it won't work that way.
Sep 4 '08 #5
MA
Thanks Pavel for your suggestions.

I have performed the steps below but seems the unmanaged.dll still
required by the solution. Any idea?

1. Compile the library.
Example: CSC /platform:x86 /errorreport:prompt /out:"D:\test\bin
\Debug\MySystem.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.Windows.Forms.dll" /LinkResource:"D:\test
\unmanaged.dll" /target:library "D:\test\CommonTypes.cs" "D:\test
\Condition.cs" "D:\test\ConditionStatus.cs" /keyfile:"D:\test\Key.snk"

2. Add the "MySystem.dll" to GAC

3. In my Tester solution, add the shared GAC - "MySystem.dll" as
reference.
When I use a specific option in the Test solution which require the
unmanaged.dll I get the error "Function _xxxx raised exception 'Unable
to load DLL 'unmanaged.dll': The specified module could not be
found...."

If I add the unmanaged.dll to solution executaion location then it
works fine. Btw, we have used the DllImport to use the unmanaged.dll
which is not COM enabled.

[DllImport("unmanaged.dll", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
Have we missed anything? Is there any other alternatives? Sorry to ask
many questions as new to this area of wrapped dlls. Thanks again for
your kind response.

Regards,
M.A
Sep 5 '08 #6
MA
Thanks Pavel for your suggestions.

I have performed the steps below but seems the unmanaged.dll still
required by the solution. Any idea?

1. Compile the library.
Example: CSC /platform:x86 /errorreport:prompt /out:"D:\test\bin
\Debug\MySystem.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.Windows.Forms.dll" /LinkResource:"D:\test
\unmanaged.dll" /target:library "D:\test\CommonTypes.cs" "D:\test
\Condition.cs" "D:\test\ConditionStatus.cs" /keyfile:"D:\test\Key.snk"

2. Add the "MySystem.dll" to GAC

3. In my Tester solution, add the shared GAC - "MySystem.dll" as
reference.
When I use a specific option in the Test solution which require the
unmanaged.dll I get the error "Function _xxxx raised exception 'Unable
to load DLL 'unmanaged.dll': The specified module could not be
found...."

If I add the unmanaged.dll to solution executaion location then it
works fine. Btw, we have used the DllImport to use the unmanaged.dll
which is not COM enabled.

[DllImport("unmanaged.dll", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
Have we missed anything? Is there any other alternatives? Sorry to ask
many questions as new to this area of wrapped dlls. Thanks again for
your kind response.

Regards,
M.A
Sep 5 '08 #7
MA
Thanks Pavel for your suggestions.

I have performed the steps below but seems the unmanaged.dll still
required by the solution. Any idea?

1. Compile the library.
Example: CSC /platform:x86 /errorreport:prompt /out:"D:\test\bin
\Debug\MySystem.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.Windows.Forms.dll" /LinkResource:"D:\test
\unmanaged.dll" /target:library "D:\test\CommonTypes.cs" "D:\test
\Condition.cs" "D:\test\ConditionStatus.cs" /keyfile:"D:\test\Key.snk"

2. Add the "MySystem.dll" to GAC

3. In my Tester solution, add the shared GAC - "MySystem.dll" as
reference.
When I use a specific option in the Test solution which require the
unmanaged.dll I get the error "Function _xxxx raised exception 'Unable
to load DLL 'unmanaged.dll': The specified module could not be
found...."

If I add the unmanaged.dll to solution executaion location then it
works fine. Btw, we have used the DllImport to use the unmanaged.dll
which is not COM enabled.

[DllImport("unmanaged.dll", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
Have we missed anything? Is there any other alternatives? Sorry to ask
many questions as new to this area of wrapped dlls. Thanks again for
your kind response.

Regards,
M.A
Sep 5 '08 #8
MA
Thanks Pavel for your suggestions.

I have performed the steps below but seems the unmanaged.dll still
required by the solution. Any idea?

1. Compile the library.
Example: CSC /platform:x86 /errorreport:prompt /out:"D:\test\bin
\Debug\MySystem.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.Windows.Forms.dll" /LinkResource:"D:\test
\unmanaged.dll" /target:library "D:\test\CommonTypes.cs" "D:\test
\Condition.cs" "D:\test\ConditionStatus.cs" /keyfile:"D:\test\Key.snk"

2. Add the "MySystem.dll" to GAC

3. In my Tester solution, add the shared GAC - "MySystem.dll" as
reference.
When I use a specific option in the Test solution which require the
unmanaged.dll I get the error "Function _xxxx raised exception 'Unable
to load DLL 'unmanaged.dll': The specified module could not be
found...."

If I add the unmanaged.dll to solution executaion location then it
works fine. Btw, we have used the DllImport to use the unmanaged.dll
which is not COM enabled.

[DllImport("unmanaged.dll", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.StdCall)]
Have we missed anything? Is there any other alternatives? Sorry to ask
many questions as new to this area of wrapped dlls. Thanks again for
your kind response.

Regards,
M.A
Sep 5 '08 #9
"MA" <ma*******@gmail.comwrote in message
news:0d**********************************@x16g2000 prn.googlegroups.com...
I have performed the steps below but seems the unmanaged.dll still
required by the solution. Any idea?

1. Compile the library.
Example: CSC /platform:x86 /errorreport:prompt /out:"D:\test\bin
\Debug\MySystem.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.Windows.Forms.dll" /LinkResource:"D:\test
\unmanaged.dll" /target:library "D:\test\CommonTypes.cs" "D:\test
\Condition.cs" "D:\test\ConditionStatus.cs" /keyfile:"D:\test\Key.snk"

2. Add the "MySystem.dll" to GAC
At this point, can you find unmanaged.dll in the same folder with
MySystem.dll in GAC?
3. In my Tester solution, add the shared GAC - "MySystem.dll" as
reference.
This is interesting, because you can't normally add references right from
the GAC. Or did you rather add reference to the original copy of the
assembly in its Debug folder?

Also, once the reference is added, check that you do _not_ have a copy of
MySystem.dll in the same directory as your Tester.exe when you run the
latter.
Sep 5 '08 #10
MA
Thanks "Pavel" for looking at my issue.
At this point, can you find unmanaged.dll in the same folder with
MySystem.dll in GAC?
I can see the MySystem.dll but can not see the unmanaged.dll in GAC. I
thought it is wrapped inside the MySystem.dll so we can not see it. Is
it true?

This is interesting, because you can't normally add references right from
the GAC. Or did you rather add reference to the original copy of the
assembly in its Debug folder?
Sorry, I should have more clear about the references. What I mean is
in VS - IDE "Add references" then select the "MySystem.dll" from
the .NET tab.
>Also, once the reference is added, check that you do _not_ have a copy of
MySystem.dll in the same directory as your Tester.exe when you run the latter.
No local copy of MySystem.dll exists in Tester.exe location.

Any suggestions.

Regards,
MA
Sep 5 '08 #11
MA
Thanks "Pavel" for looking at my issue.
At this point, can you find unmanaged.dll in the same folder with
MySystem.dll in GAC?
I can see the MySystem.dll but can not see the unmanaged.dll in GAC. I
thought it is wrapped inside the MySystem.dll so we can not see it. Is
it true?

This is interesting, because you can't normally add references right from
the GAC. Or did you rather add reference to the original copy of the
assembly in its Debug folder?
Sorry, I should have more clear about the references. What I mean is
in VS - IDE "Add references" then select the "MySystem.dll" from
the .NET tab.
>Also, once the reference is added, check that you do _not_ have a copy of
MySystem.dll in the same directory as your Tester.exe when you run the latter.
No local copy of MySystem.dll exists in Tester.exe location.

Any suggestions.

Regards,
MA
Sep 5 '08 #12
"MA" <ma*******@gmail.comwrote in message
news:cb**********************************@25g2000p rz.googlegroups.com...
Thanks "Pavel" for looking at my issue.
>At this point, can you find unmanaged.dll in the same folder with
MySystem.dll in GAC?

I can see the MySystem.dll but can not see the unmanaged.dll in GAC. I
thought it is wrapped inside the MySystem.dll so we can not see it. Is
it true?
No. The point of /linkresource is that you specify an _external_ file as a
dependency for your assembly. It still remains an external file after that.

Perhaps I'll need to clarify what I mean by "see in GAC". When you navigate
to GAC (that is, \WINDOWS\Assembly) in Windows Explorer, it doesn't show you
the true folder structure within - it just shows a flat list of asseblies
(not files/folders). You won't see the unmanaged DLL there. What you need to
do is to either use command line (and chdir & dir), or PowerShell, or some
third-party file manager such as Total Commander or Far to browse GAC, and
find the actual .dll for your assembly within it. And then see whether it'll
have the unmanaged .dll with it, or not.
Sep 5 '08 #13
MA
For the record, to view the physical file system sturcture of the
GAC...

GAC in Microsoft .NET framework is implemented via Fusion.dll, which
hides the actual structure of the GAC. To view the physical file
system sturcture of the GAC, create a DWORD entry by the name
DisableCacheViewer under the registry key, HKEY_LOCAL_MACHINE\Software
\Microsoft\Fusion, and set its value to 1. After making the above
modifications to the registry, if you try to open GAC folder, you will
now see the actual structure of GAC."

I have made some changes to the CSC parameters, now I can see in the
GAC the unmanaged.dll in the managed (MySystem.dll). But now my
Tester.exe unable to locate the assembly.

================================================== ========
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'MySystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8cxxxxf3'
or one of its dependencies. The system cannot find the file specified.
File name: 'MySystem, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=8c4fbxxxxxf3'
================================================== ========

Any suggestions?

Regards,
MA
Sep 5 '08 #14
MA
For the record, to view the physical file system sturcture of the
GAC...

GAC in Microsoft .NET framework is implemented via Fusion.dll, which
hides the actual structure of the GAC. To view the physical file
system sturcture of the GAC, create a DWORD entry by the name
DisableCacheViewer under the registry key, HKEY_LOCAL_MACHINE\Software
\Microsoft\Fusion, and set its value to 1. After making the above
modifications to the registry, if you try to open GAC folder, you will
now see the actual structure of GAC."

I have made some changes to the CSC parameters, now I can see in the
GAC the unmanaged.dll in the managed (MySystem.dll). But now my
Tester.exe unable to locate the assembly.

================================================== ========
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'MySystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8cxxxxf3'
or one of its dependencies. The system cannot find the file specified.
File name: 'MySystem, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=8c4fbxxxxxf3'
================================================== ========

Any suggestions?

Regards,
MA
Sep 5 '08 #15
MA
For the record, to view the physical file system sturcture of the
GAC...

GAC in Microsoft .NET framework is implemented via Fusion.dll, which
hides the actual structure of the GAC. To view the physical file
system sturcture of the GAC, create a DWORD entry by the name
DisableCacheViewer under the registry key, HKEY_LOCAL_MACHINE\Software
\Microsoft\Fusion, and set its value to 1. After making the above
modifications to the registry, if you try to open GAC folder, you will
now see the actual structure of GAC."

I have made some changes to the CSC parameters, now I can see in the
GAC the unmanaged.dll in the managed (MySystem.dll). But now my
Tester.exe unable to locate the assembly.

================================================== ========
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'MySystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8cxxxxf3'
or one of its dependencies. The system cannot find the file specified.
File name: 'MySystem, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=8c4fbxxxxxf3'
================================================== ========

Any suggestions?

Regards,
MA
Sep 5 '08 #16
MA
Please ignore my previous post about the unable to locate assmbly. It
was point to the wrong assembly in Tester.

It looks in the right track at this stage. I will do the testing
tomorrow morning and post the update in here. Thanks again for your
advice.

Regards,
MA
Sep 5 '08 #17

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

Similar topics

1
1646
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...
1
21045
by: Jon Davis | last post by:
I'm trying to access my application files for a plug-in I'm building for a third party application. I have an assembly with several dependency assemblies. The dependency assemblies are in the...
3
12159
by: Michael Bøcker-Larsen | last post by:
Hi I'v been stuck on this problem for ages now. I have found that I'm not the only one with this problem, by looking through the different newsgroups. Hope you can help me! I know there is a...
9
4163
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...
3
1812
by: Web Team | last post by:
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...
11
1897
by: Just Me | last post by:
I have a solution containing many usercontrol projects. When I wish to reference a usercontrol in another project I can select either the project or the assembly. Does it make a difference which...
2
568
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
7
10936
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
2
151628
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web...
0
7084
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
7278
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
7328
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
6991
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
5578
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
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
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
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.