Big problem with GAC and local

Big problem with GAC and local

Post by RGF2aWQgVG » Thu, 09 Nov 2006 07:55:02


Hi;

We have another problem with GAC vs local.

We have a library that our users want to install with the libraries in the
GAC (as recomended by Microsoft). These are programmers only.

We have a Word Add-In where the libraries are installed locally with the
Add-In (as recomended by Microsoft). THis Add-In is used by both programmers
and non-programmers. This Add-In includes the same DLLs that are in the
library.

In the case of the programmers, then now have about 10 DLLs that are
identical in both the GAC and in the directory with the Add-In. And
sometimes, the DLLs are different versions between the two locations. All are
strongly named and signed.

What happens is when the Add-In runs, it cannot find some of the DLLs that
are in both places. How do we work around this?

--
thanks - dave
david_at_windward_dot_net
http://www.yqcomputer.com/

Cubicle Wars - http://www.yqcomputer.com/
 
 
 

Big problem with GAC and local

Post by v-phuan » Thu, 09 Nov 2006 11:28:08

Hi Dave,

Based on my understanding, I assume your scenario similar as below.
You have an Word Addin which will load a few Assemblies, A,B,C,D....
All of the assembly are strongnamed and signed.
And you put them into GAC, and put them in the same dir as Addin installed.

Now you find that sometime after the Addin load, it can not find the Addin
in both place.

If I misunderstand, please let me know.

Based on my knowledge, by design, the .NET FW will check the Assembly
binding request from the GAC first, that is to say, the Addin should always
load the DLL from the GAC.
Currently it will not load from both place, I wonder if you have rebuilt
the addin or assemblies.
Because once an dll is strong name, the .NET FW will check for its full
qualified name and load it. If any part of the full name did not match, it
will fail.
e.g. if the version changed, or signed key .....

Currently I think you may try to use the fuslogvw to log all the binding
process to see what is the Word addin is trying to bind, and how it is
failed.

Here are two articles for your reference.
Assembly Binding Log Viewer (Fuslogvw.exe) Legacy Documentation
http://www.yqcomputer.com/ (VS.80).aspx

How the Runtime Locates Assemblies
http://www.yqcomputer.com/ (VS.80).aspx

Best regards,

Perter Huang
Microsoft Online Partner Support

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

 
 
 

Big problem with GAC and local

Post by RGF2aWQgVG » Thu, 09 Nov 2006 15:23:01

I think that may be it - we have one version in the GAC and a different
version in the AddIn directory. How do I get it to look in the AddIn
directory first? These users need both installed on their system and the DLLs
in the GAC will be a different version sometimes.

--
thanks - dave
david_at_windward_dot_net
http://www.yqcomputer.com/

Cubicle Wars - http://www.yqcomputer.com/
 
 
 

Big problem with GAC and local

Post by Ben Voig » Fri, 10 Nov 2006 00:54:13


Change your add-in installer to put the DLLs in the GAC, it's required for
DLLs used by more than one product. Then the GAC will contain several
different versions, and you can bind to the one you need.

"Side-by-side" configuration would help too, but I don't think a plugin can
control it, only the main application.
 
 
 

Big problem with GAC and local

Post by RGF2aWQgVG » Fri, 10 Nov 2006 02:10:02

an't do that - the Word group at MS says you must not put Word AddIns and
their supporting DLLs in the GAC. (They also say you must not put anything in
word.exe.config. And you cannot have 1 Word AddIn using .NET 1.1 and another
using .NET 2.0. The Word group tends to not follow the .NET standard.)

Is there any other way to do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"Ben Voigt" wrote:

 
 
 

Big problem with GAC and local

Post by Ben Voig » Fri, 10 Nov 2006 05:37:59

"David Thielen" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...

Is this documented somewhere?

That restriction equates to forbidding managed addins, because "supporting
DLLs" would include the BCL (System.dll, System.Windows.Forms.dll,
System.Xml.dll, etc.) which are certainly in the GAC.

I would understand that to mean that your addin's entry point should not be
in the GAC, but that it is free to use any number of shared libraries, which
should be in the GAC whether provided by Microsoft, you, or any other party.



 
 
 

Big problem with GAC and local

Post by RGF2aWQgVG » Fri, 10 Nov 2006 05:45:02

've asked that group to get an answer. They absolutely don't want the .NET
dll that is the AddIn interface to Word in the GAC. CLearly the system
libraries are in the GAC. So for the libraries used only by us - not sure.

There is definitely a disconnect betwen .NET and the Word AddIn system.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"Ben Voigt" wrote:

 
 
 

Big problem with GAC and local

Post by v-phuan » Sat, 11 Nov 2006 14:12:53

Hi Dave,

Currently we can not control the assembly fusion policy to check the
private path first and then GAC unless we rebuild our own .NET Runtime.

Currently I just wonder why you need to keep multiple versions of addins,
one in GAC and the other in the private path?
Commonly I think once an addin is published, we can just maintain certain
version in the private path, once the addin is upgrade just replace the
existing version with a new one. Such an upgrade is applied.

If you have other concerns, please let me know.

Best regards,

Perter Huang
Microsoft Online Partner Support

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

Big problem with GAC and local

Post by Ben Voig » Sun, 12 Nov 2006 00:50:06

"David Thielen" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...

Word can tell you to put AddIns in a private directory if they like.

Reusable libraries belong in the GAC, regardless of what
application/service/addin/gremlin uses them.