Word Automation - System.UnauthorizedAccessException on Winforms

L

Laks Srini

Hi,

I have written a word automation application in c#, using the 2003
word
object model 11.0. I have tested it on my system and it works fine.
When i copy the EXE and required dll's on to another system, I get a
System.UnauthorizedAccessException.

Considering that all I have written is a windows form, that attempts
to create a word object and open a document, this is pretty unexpected
(atleast to me). This exception occurs on creating the word
application object itself.

But when I add the user to the DCOMCNFG Default Access, then I am able
to create the word object. But on my own system the code works fine
without the settings. Can anyone help me out here!!

Thanks and Regards,
Laks
 
C

Chuck Hartman

Laks,

You need to check out "How to: Grant Permissions to Folders and Assemblies"
at
http://msdn.microsoft.com/library/d...tskgrantingpermissionstofoldersassemblies.asp
Using the .NET Framework 1.1 Configuration Tool

This was done automatically for you by the wizard when you created your
project, therefore you cannot "copy deploy" your solution.. You need to
perform manual steps to grant the proper security permissions or create an
installer project that is run by a user with Administrator privileges to
create the needed CAS permissions programmatically.

Chuck Hartman
 

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