For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > October 2006 > Access denied...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Access denied...
Kagamoto@gmail.com

2006-10-31, 7:06 pm

Hello everybody!

I'm developing an ASP.NET (v1.1) web application which includes a
reference to the "Microsoft Word 11.0 Object Library".

When I try the following code:

....
....
Microsoft.Office.Interop.Word.Application app = new
Word.ApplicationClass();
....
....

I get an ASP.NET Error "System.UnauthorizedAccessException: Access
denied"

What can be the problem?

Thanks in advance!
Bye

Aidy

2006-10-31, 7:06 pm

When Word starts for the first time for a user it pops up a message box
asking your name and initials. When you start Word via your anonymous user
it will probably be popping the box up. The web service doesn't have access
to the desktop so you'll be getting the permission denied error.

You could temporarily allow the WWW service and the anon user access to the
desktop to allow you to complete the Word start-up process. However ideally
you shouldn't use Word (or any Office App) from asp.net as they are not
coded to be web suitable.

<Kagamoto@gmail.com> wrote in message
news:1162292779.532853.181440@h48g2000cwc.googlegroups.com...
> Hello everybody!
>
> I'm developing an ASP.NET (v1.1) web application which includes a
> reference to the "Microsoft Word 11.0 Object Library".
>
> When I try the following code:
>
> ...
> ...
> Microsoft.Office.Interop.Word.Application app = new
> Word.ApplicationClass();
> ...
> ...
>
> I get an ASP.NET Error "System.UnauthorizedAccessException: Access
> denied"
>
> What can be the problem?
>
> Thanks in advance!
> Bye
>



Kagamoto@gmail.com

2006-10-31, 7:06 pm

Ok, I've solved.

a)
Run DCOMCNFG.EXE , select Word Application - Properties - select
Security and add ASPNET to the Launch and Access permissions list.

or

b)
add <identity impersonate="true"/> to web.config


Thanks!

Kagamoto@gmail.com wrote:
> Hello everybody!
>
> I'm developing an ASP.NET (v1.1) web application which includes a
> reference to the "Microsoft Word 11.0 Object Library".
>
> When I try the following code:
>
> ...
> ...
> Microsoft.Office.Interop.Word.Application app = new
> Word.ApplicationClass();
> ...
> ...
>
> I get an ASP.NET Error "System.UnauthorizedAccessException: Access
> denied"
>
> What can be the problem?
>
> Thanks in advance!
> Bye


Mark Rae

2006-10-31, 7:06 pm

<Kagamoto@gmail.com> wrote in message
news:1162292779.532853.181440@h48g2000cwc.googlegroups.com...

> I'm developing an ASP.NET (v1.1) web application which includes a
> reference to the "Microsoft Word 11.0 Object Library".


You'd be well advised not to even try to do this. Server-side instatiation
of Microsoft Office is to be avoided if at all possible - even Microsoft
strongly advise against it to the extent where they won't actually support
any solution which uses it...
http://support.microsoft.com/defaul...-US;q257757#kb2

Use this instead:
http://www.aspose.com/Products/Aspo...ds/Default.aspx

And have a read of this too:
http://www.aspose.com/wiki/default....Automation.html


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com