473,385 Members | 2,004 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.

Global Assembly Cache for exporting COM interface

Hello Gurus,

I wrote a .NET application using C# and exported some interface for COM usage.
I did register my application COM interface using the REGASM.exe and some
more code in application.
It all looks fine when looking in the OLE View utility and by looking in the
registry. But when I try to instantiate the COM object using C++ or VB I'm
getting the error "The system cannot find the file specified" (Run-time error
-2147024894 (80070002)).
So I googled it and found that I need also to:
1. Give the assembly a Strong Name.
2. Place the assembly in the Global Assembly Cache (GAC).

My questions are:
(A) How do I vive the assembly a Strong Name and place it in the GAC?
(B) This same application did work using COM to instantiate the object in
earlier .NET Framework version (I think version 1.1). Can it be that it has
been changed for .NET Framework version 2.0?
-------
Thanks
Sharon
Nov 18 '07 #1
3 1956
Hello Sharon,

SMy questions are:
S(A) How do I vive the assembly a Strong Name and place it in the GAC?

http://support.microsoft.com/kb/815808

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
Nov 18 '07 #2
Thanks Michael,

I tried to as the article says but I'm getting some errors when building the
application saying "Assembly generation failed -- Referenced assembly
'AxSMHTMLFormContainer' does not have a strong name Process3"
(I have several of this errors, each for every COM interop I'm using)

'AxSMHTMLFormContainer' is an interop wrapper for COM dll my .NET
application uses.
Process3 is my .NET application.

Please not that my application is a .NET EXE and not a DLL (Process3.exe).

What do I need to do with all COM interop I'm using in my application? or I
how can I fix that?
---------
Thanks
Sharon
"Michael Nemtsev [MVP]" wrote:
Hello Sharon,

SMy questions are:
S(A) How do I give the assembly a Strong Name and place it in the GAC?

http://support.microsoft.com/kb/815808

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
Nov 18 '07 #3
Hello again,

I'm here again because a new problem arouse concerning this issue.

My C# application is referencing a COM exe (lo.exe) that export an Interface
from another COM dll (lo.dll), and this COM DLL uses the iobjsafe.tlb.

After I gave my application the strong name key, it forces me to assign
strong name key for all the references I'm using.
doing that cause me an error that I can not recover from...

When I generate an interop for the lo.exe it also generate interops for the
lo.dll and for the iobjsafe.tlb. But they two do not contain strong name key,
so I deleted them and generated an interop manually with strong name key form
this two as well using the TlbImp.exe.

After adding all this new interops to my project, I'm getting an error at
run time when trying to access an interface at the lo.dll via the lo.exe like
that:

// This line produces the error below
LanguageObject.CLanguageObject LangObj=
(LanguageObject.CLanguageObject)LW.LOInterface;

LanguageObject is the interop for the lo.dll.
and LW is the interop for lo.exe (LODLLWRAPPER LW= new LODLLWRAPPER();)
The error I'm getting for this line:

Could not load file or assembly 'IObjectSafetyTLB, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=8270d3e194c15991' or one of its dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)

I have generated a different key file for each COM object I'm referencing
and generated the interop using the TlbImp.exe. for example:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\TlbImp.exe" LO.dll
/keyfile:C:\GACKey\lo.snk /verbose

I managed to get rid of this error only after removing the key file from my
C# application AssemblyInfo.cs.
How can use the strong key name for my C# application in this case as
described above?
--
Thanks
Sharon
Dec 18 '07 #4

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

Similar topics

3
by: DDE | last post by:
Hi everybody, I developed an assembly common to all my Web Services, so I registered it and put it in the Global Assembly Cache. Now, I modified this assembly, but cannot succed to have this new...
7
by: JerryW | last post by:
I just reinstalled .NET 2003 (after repeated attempts to get ASP.NET Web Applications to work). I first did a complete uninstall of .NET 2003, .NET Framework 1.1, and IIS. I also completely deleted...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
1
by: Ray | last post by:
Dear all, Now, I am using Global Assembly Cache to share assembly between server and clients. However, it seems that the server and clients use individual Global Assembly Cache. For example, the...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.