ASP.NET AND Office Interop

P

Patrick

Hello all,
I'm writing an inhouse service to convert uploaded word files to pdf using
ASP.NET.
My assembly that interops with office 2007 and handles the format
conversions works fine when I reference it in a console application but
fails when used in an ASP.NET app. The website just "hangs" and eventually
states that the page cannot be found. I have Office 2007 installed on the
web server and I'm running the web app using impersonation with a user that
has administrative privledges....Any help is GREATLY appreciated.

Sincerely,
Patrick
 
S

SvenC

Hi Patrick
I'm writing an inhouse service to convert uploaded word files to pdf
using ASP.NET.
My assembly that interops with office 2007 and handles the format
conversions works fine when I reference it in a console application
but fails when used in an ASP.NET app. The website just "hangs" and
eventually states that the page cannot be found. I have Office 2007
installed on the web server and I'm running the web app using
impersonation with a user that has administrative privledges....Any
help is GREATLY appreciated.

Can you run that web app in a fixed user, no impersonation? Logon
interactively and start the office apps once. Typically the Office apps to a
one time initialization per user on a machine, so that the user profile is
initialized. Maybe something goes wrong when your process runs in a specific
account and you impersonate different users. Because these users will need
to access different parts in the profile of the user the process runs with.
Office is an interactive app so it was not designed as a server app.

Also be very carefull to call
System.Runtime.InteropServices.Marshal.ReleaseComObject on each and every
COM object you create or get, otherwise you will leave several COM objects
lying around until the next garbage collection.
 
P

Patrick

Man, what an awesome response time! You know, I've been racking my flippin
brain over this for several days know only to find out that the solution was
this simple...geeeeez. I've never run office logged in as the user I was
impersonating... What a relief. Thanks so much.
--Patrick
 
S

SvenC

Hi,
Man, what an awesome response time! You know, I've been racking my
flippin brain over this for several days know only to find out that
the solution was this simple...geeeeez. I've never run office logged
in as the user I was impersonating... What a relief. Thanks so much.

You're welcome,
SvenC
 

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