By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

Installing to GAC using Deployment Project

P: n/a
Hi,

I have written an App in vb.Net (2003) which references Excel 2000. This
creates a Interop_Excel.dll which I need to reference in my project. All OK
so far.
I had to modify the Interop_Excel.dll and renamed it tm_Interop_Excel.dll
after modification. This new dll has a strong name and all the correct
attributes.

If I create a deployment project for my app, the tm_Interop_excel.dll is
placed in my application folder.

However I need this dll to be installed in the GAC. I can do this manullay
using GACUTIL, and all is OK.

When I create an installer, using VS 2003, I drag the dll form my
application folder into the Global assembly folder. (file system on target
machine).

When the installer is run, the tm_Interop_Excel.dll is placed into the GAC
but without a codebase entry and my app does not work. If I then run the
GACUTIL -i the codebase entry is added and all is ok.

I have found the GACUTIL is missing on some target computers so I cannot
relie on it being there.

So my question is, How do I create an installer which will automatically
place my tm_Interop_Excel.dll into the GAC correctly without using the
GACUTIL.exe.

Thanks in advance
--
Tim Marsden
Nov 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You're doing the right thing, but where is this codebase value you are
referring too? Codebase is usually referred to in the context of Regasm.exe
or a config file. Gacutil just puts assemblies in the GAC, like the
deployment project does.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Tim Marsden" <TM***@newsgroup.nospam> wrote in message
news:8E**********************************@microsof t.com...
Hi,

I have written an App in vb.Net (2003) which references Excel 2000. This
creates a Interop_Excel.dll which I need to reference in my project. All
OK
so far.
I had to modify the Interop_Excel.dll and renamed it tm_Interop_Excel.dll
after modification. This new dll has a strong name and all the correct
attributes.

If I create a deployment project for my app, the tm_Interop_excel.dll is
placed in my application folder.

However I need this dll to be installed in the GAC. I can do this manullay
using GACUTIL, and all is OK.

When I create an installer, using VS 2003, I drag the dll form my
application folder into the Global assembly folder. (file system on target
machine).

When the installer is run, the tm_Interop_Excel.dll is placed into the GAC
but without a codebase entry and my app does not work. If I then run the
GACUTIL -i the codebase entry is added and all is ok.

I have found the GACUTIL is missing on some target computers so I cannot
relie on it being there.

So my question is, How do I create an installer which will automatically
place my tm_Interop_Excel.dll into the GAC correctly without using the
GACUTIL.exe.

Thanks in advance
--
Tim Marsden

Nov 22 '05 #2

P: n/a

Phil,
Many thanks for the swift reply.

When I use the GACUTIL, then find the entry in he GAC, right click and
look at properties, the is an entry for Codebase, which references the
location of the dll I installed using the GACUTIL.

If I check the GAC after I use the installer there is no entry for the
codebase on the dll's properties.

Do I need to do anything special because it is a interop dll?

Regards
Tim
On Mon, 14 Nov 2005 07:28:22 -0800, "Phil Wilson"
<pd*******@nospam.cox.net> wrote:
You're doing the right thing, but where is this codebase value you are
referring too? Codebase is usually referred to in the context of Regasm.exe
or a config file. Gacutil just puts assemblies in the GAC, like the
deployment project does.

Nov 22 '05 #3

P: n/a
Hi Tim,

If you need to mimic the process of 'gacutil' and/or 'regasm' because
they may be not in the target machine, you can use:
[C#]
using System.EnterpriseServices.Internal;
....
Publish p = new Publish();
// for GAC Installation
p.GacInstall(file); // for gac installation
....
p.GacRemove(file); // for gac removing
....
p.RegisterAssembly(file); // for registering assembly for interop
....
p.UnRegisterAssembly(file); // to unregister assembly
[/C#]
Regards,
Sebastian Wain
--
http://www.nektra.com

Tim Marsden wrote:
Phil,
Many thanks for the swift reply.

When I use the GACUTIL, then find the entry in he GAC, right click and
look at properties, the is an entry for Codebase, which references the
location of the dll I installed using the GACUTIL.

If I check the GAC after I use the installer there is no entry for the
codebase on the dll's properties.

Do I need to do anything special because it is a interop dll?

Regards
Tim
On Mon, 14 Nov 2005 07:28:22 -0800, "Phil Wilson"
<pd*******@nospam.cox.net> wrote:
You're doing the right thing, but where is this codebase value you are
referring too? Codebase is usually referred to in the context of Regasm.exe
or a config file. Gacutil just puts assemblies in the GAC, like the
deployment project does.


Nov 22 '05 #4

P: n/a
Thanks Sebastian

I will try this out as an alternative, many thanks

Tim

On 14 Nov 2005 11:21:28 -0800, "Sebastian Wain"
<se************@gmail.com> wrote:
Hi Tim,

If you need to mimic the process of 'gacutil' and/or 'regasm' because
they may be not in the target machine, you can use:
[C#]
using System.EnterpriseServices.Internal;
...
Publish p = new Publish();
// for GAC Installation
p.GacInstall(file); // for gac installation
...
p.GacRemove(file); // for gac removing
...
p.RegisterAssembly(file); // for registering assembly for interop
...
p.UnRegisterAssembly(file); // to unregister assembly
[/C#]
Regards,
Sebastian Wain

Nov 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.