Deploy Office PIA to ASP.NET Server

G

Guest

I'm trying to use the Office XP PIA in an ASP.NET application. It's working
fine on my workstation and I can manipulate a Workbook using
Microsoft.Office.Interop.Excel.

When I try to deploy the application to a server, I get:
"System.Runtime.InteropServices.COMException (0x80040154): COM object with
CLSID {00024500-0000-0000-C000-000000000046} is either not valid or not
registered."

I've seen several articles that mention ways to deploy these PIA's,
especially the following:
"2: Place the required Office XP PIAs in the same directory as your
solution and distribute your solution and the Office XP PIAs as a
single unit. This option is only recommended for simple solution
deployments, such as copying solutions from one file directory folder
to another across a computer network. The main disadvantage with this
option is that multiple copies of the same Office XP PIAs may be
installed on end users' computers, which reduces these computers'
available hard disk space."

I tried to copy the DLL files into a folder within my project and have the
References point at these copies of the dll files. No luck.

Someone else mentioned copying the DLL's to the Bin folder, also without any
luck.

Please advise as to how what I need to do on the ASP.NET server to deploy
code there that can use the Microsoft.Office.Interop.Excel classes.

Thanks,

Chris Frohlich
 
D

David Browne

ChrisFrohlich said:
I'm trying to use the Office XP PIA in an ASP.NET application. It's
working
fine on my workstation and I can manipulate a Workbook using
Microsoft.Office.Interop.Excel.

When I try to deploy the application to a server, I get:
"System.Runtime.InteropServices.COMException (0x80040154): COM object with
CLSID {00024500-0000-0000-C000-000000000046} is either not valid or not
registered."

I've seen several articles that mention ways to deploy these PIA's,
especially the following:
"2: Place the required Office XP PIAs in the same directory as your
solution and distribute your solution and the Office XP PIAs as a
single unit. This option is only recommended for simple solution
deployments, such as copying solutions from one file directory folder
to another across a computer network. The main disadvantage with this
option is that multiple copies of the same Office XP PIAs may be
installed on end users' computers, which reduces these computers'
available hard disk space."

I tried to copy the DLL files into a folder within my project and have the
References point at these copies of the dll files. No luck.

Someone else mentioned copying the DLL's to the Bin folder, also without
any
luck.

Please advise as to how what I need to do on the ASP.NET server to deploy
code there that can use the Microsoft.Office.Interop.Excel classes.

That sounds like the PIA's are loading fine. They are .NET assemblies. It
looks like a failure loading Excel's com components.

COM will look at the following registry key

HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}

To find out how to load the component that supports the COM interface
identified by that CLSID.

So, is Excel installed on the server?

David
 
G

Guest

Excel is not installed. Forgive my ignorance, but is this necessary, and if
so why?

Thanks in advance,

Chris
 
D

David Browne

ChrisFrohlich said:
Excel is not installed. Forgive my ignorance, but is this necessary, and
if
so why?

The Office PIA's allow .NET code to interoperate with the components of the
Office suite.

The PIA or Primary Interop Assembly is a .NET assembly that serves as a
brige between .NET code and a COM component. It does not include the COM
component itself. You call into the PIA, the PIA in turn loads the
requested COM component and marshalls data back and forth from the COM
component to .NET.



David
 

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

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top