ASP.NET web app using MS Word on Server 2003

I've got an ASP.NET 2.0 (C#) application running on Windows 2003 Server and at a particular point it tries to create an instance of Word (2003) on the server to run macros and some document conversions.
This works fine on our dev (XP) machines but once we deploy it to the live server this fails.

Now I know that it's neither recommended nor supported but we've got to do it this way so I'm looking for help with the security settings.

In IIS the anonymous user is set to a user that currently has admin rights to the machine and that we can log in as, which I have done and opened Word while I was logged in.
 Integrated windows authentication is also on.
The application pool it's in is being run under the Network Service account.

In the DCOM config I have gone into the Microsoft Word Document entry and allowed launch and activation permissions on it for the anonymous user we're using, the network service account and the aspnet account. Then I've set the identity being used to the anonymous user.

And I've also switched on impersonation on the application so it should use the anonymous account to access resources.

But none of it makes any difference, it still doesn't work.
Now I know we've done this for other servers before but they were and therefore IIS 5 and it doesn't seem to have the same problems at all.

Does anyone have any ideas on other stuff I could try?

Thanks,
C
capsoftukAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RejojohnyConnect With a Mentor Commented:
just want to confirm whether you have word installed on the server?

maybe you also want to look at this option too http://sandedus.blogspot.com/2006/03/using-microsoft-word-and-asp.html

where is the file resideing .. the .doc file that has the macros .. is it within the same path as the web application and what are the presmissions on that file??
0
 
JimBrandleyConnect With a Mentor Commented:
Any time there is an access error, the quickest way I have found  to pinpoint the problem is using two utilities you can get free from www.SysInternals.com called FileMon.exe and RegMon.exe. With them, you can trace the accesses and see precisely which access was denied.

Jim
0
 
capsoftukAuthor Commented:
Rejojohny,

Yes Word is definitely installed on the server, I opened it manually myself logged in at the IIS anonymous user that is also set as the identity user in the DCOM permissions.
There are no macros involved yet, what we're trying to do is to convert a .rtf to a .doc at the moment.
Down the line however there will be macros that need to be run on the documents on the server because we'll need to get into the guts of the document to convert strings to hyperlinks among other things.

I don't think what's discussed at that link really applies in this situation because I'm not actually going near the properties of the document.


Jim,

I'm in the process of using those two already, I haven't turned up anything yet but I'm still looking.

Thanks,
C
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
RejojohnyCommented:
instead of anonymous user, did you try the code using windows authentication with the user having all the permissions .. regardless of whether you were able to open the file after you manually signed into that machine, i would first try by adding the file to the virtual path and giving all permission .. i also rmember that word used to use some temp files for file and so you needed write permission on some directory .. not sure whether its still applicable for newer versions of office ..

Rejo
0
 
capsoftukAuthor Commented:
Someone else in my company has been working on this and changes they made (which I'm not fully aware of) plus a reboot have resolved the issue.
I'm splitting the points because both replies were resonable suggestions even though they the solution for me.
Thanks,
C
0
 
InteractiveLimitedCommented:
hi all,
i have the same problem but the previous solutions didn't help me.
i think that there is some settings or configurations with iis to execute Interop.Word code
i'm using vs 2008 and when my code run by virtual server there is no problem
but when run by iis raise error like word is busy

thanks in advance.
0
 
capsoftukAuthor Commented:
I can't remember exactly how we resolved this in the finish, I think the IWAM account that IIS runs under might also need permission to access Word in the DCOM settings. I think we gave Everyone full access in DCOM and then worked back from there, removing permissions and groups to narrow it down.
0
All Courses

From novice to tech pro — start learning today.