Strong name for Interop Assemblies

  • Thread starter Thread starter Binesh
  • Start date Start date
B

Binesh

Hi
I used Interop assemblies to read Excel data into DataSet. I am able
to run it successfully on my workstation(windows XP and VS .Net 7 and
MS Office XP) but when I port my code to server(Windows 2000,.Net
Framework 1.1,NO MS OFFICE) I get clsid not found. I believe this is
because I do not have MS Office installed on my server( I might be
wrong)

1. How do I get rid of this problem
2. If having strong names for the Interop assemblies help me..then
where do I get the assemblies with strong name( can I do it myself ).

Any Ideas?
I am working with .NET technologies for a year but never dealt with
dll and stuff...

Any help would be appriciated..

Thanks
Binny
 
Hi,

I beleive CLSIDs have nothing to do with strong names. If you are given an
error that CLSID is not found, that's most likely due to Office is not
installed in the server (and indeed, you say there's NO MS OFFICE there).

On the other hand, I think there's an ODBC driver capable of reading Excel
data... you could employ it and unbind your solution from MS Office itself.
 
Hi,
Thanks for your reponse Lapshin.
You mean do I have to Install Office On my Server? To me it doesnt make
sense to load office applications on my server. Am I bound to load MS
Office if I have to use PIA's? Cant I register Office PIA's on Server?

Using ODBC driver is the good if you tie your columns to single
Datatype. My Excel sheet is filled by different users and will be played
by many groups before I actually process it. So I cannot interpret the
Datatype untill runtime. ODBC looks at first 8 rows to determine the
datatype. Once it determines the datatype for the column for all those
other datatypes in the same column ODBC returns null...which sucks.

Thanks
Binesh
 
Binesh,

PIAs do not contain any functionality - they, to be brief, just tell the
framework which COM object(s) to create and how to direct managed code calls
to the created COM object(s). Therefore, PIAs cannot read your Excel files -
they can only ask MS Office automation to do so - and yes, if the ODBC
driver does not fit your needs, you will most likely have to end up with MS
Office installed on the server.
 
2. If having strong names for the Interop assemblies help me..then
where do I get the assemblies with strong name( can I do it myself ).

You can set the .snk file to be used for your imported COM wrappers in
the project options - go to "Common Properties / General", there's a
section "Wrapper Assembly for ActiveX/COM Objects", which contains two
entries, Wrapper Assembly Key File and Wrapper Assembly Key Name.

If you add your "mylibrary.snk" file as the wrapper assembly key file,
your imported COM object now has a .NET wrapper with a strong name
(the Interop.xxxxx.dll file), which you can e.g. install in the GAC.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Thanks Lapshin,

You made my life easier. I was wondering if I could get it work without
actually installing MS Office. I had gone through the PIA docs and
understood that they are just interfaces to COM Objects.

Is there a way to install the required office components(not visible to
the end user,only COM components and registrations) rather than
installing the whole Office applications?

Thanks Mark for your help...

Binesh
 
Binesh,

I'm afraid this is not possible, at least not that I know of.
 
Back
Top