GAC Not So Simple

O

Olie

I find the comments by Microsoft about the GAC slightly amusing
stating the the GAC was created to simplify sharing of assemblies. I
have found it less than simple.

I have a solution with three projects ProjectA, ProjectB and
ProjectC.

ProjectB references ProjectC
ProjectA references ProjectB and ProjectC

As ProjectA has to run with a root path where it is impossible to
install Projects B and C I have no choice but to put B and C in the
GAC.

So I created a setup project that installs these libraries to the GAC
but when I then run ProjectA it does not find the assemblies. I assume
that is because the references in ProjectA are to the file as local.
It does not pickup the assemblies from the GAC even though I can
verify they have been installed in the GAC correctly.

I can not figure out how to reference a project in the same solution
as a GAC reference. There seem to be loads of posts on this but none
seem to aspire to a good solution. The best solution I can find is to
reference the GAC copy that is already installed which would not allow
me to change the assembly in the solution, plus I can not get this to
work either.

Surely this is not such a difficult thing to want to do!
 
M

Mattias Sjögren

So I created a setup project that installs these libraries to the GAC
but when I then run ProjectA it does not find the assemblies. I assume
that is because the references in ProjectA are to the file as local.

That doesn't matter at runtime. No file path is stored for a
reference.

It does not pickup the assemblies from the GAC even though I can
verify they have been installed in the GAC correctly.

Then I recommend you use Fuslogvw.exe to figure out why.



Mattias
 
O

Olie

Thanks for your reply, I figured out what was happening. I was trying
to test the installer on my dev machine. It appears though that when
you add the assemblies to the GAC Visual Studio gets confused about
where it is supposed to be getting the assemblies from so it will not
compile. You then also seem to get in a circular position where the
installer no longer thinks it needs to install the assemblies because
they are in the GAC.

Once I gave up trying the installer on my dev pc and installed it on
another machine everything was happy :)

Sorry for the tangle!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top