Security Exception during interop with Word

P

Peter Sojan

Hi!

For my Office 2000 Installation I imported all three needed Typelibs for
Word (simple with tblimp):

Office.dll
VBIDE.dll
Word.dll

Then in a little test program (ComTest.cs) when I try the
following:

Word.Application wa = new Word.Application();

I get an Security Exception:

-----------------------------------
Unhandled Exception: System.Security.SecurityException:
System.Security.Permissions.SecurityPermission
at MainApp.Main() in
h:\daten\programming\dotnettest\helloworld\ComTest.cs:line 11

The state of the failed permission was:
<IPermission class="System.Security.Permissions.SecurityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Flags="UnmanagedCode"/>
-------------------------------------

Any hints? Is this a COM or Runtime permission thing? How could
I overcome the security restrictions?

Thx,
Peter
 
C

Cindy M -WordMVP-

Hi Peter,
For my Office 2000 Installation I imported all three needed Typelibs for
Word (simple with tblimp):

Office.dll
VBIDE.dll
Word.dll
About the other two I'm not sure, but for Word you need the *.olb file, not
a dll?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
P

Peter Sojan

Cindy said:
Hi Peter,



About the other two I'm not sure, but for Word you need the *.olb file, not
a dll?
These are the resulting wrapper assemblies. I used the *.olb libs for
input...

Thx
Peter
 
P

Peter Sojan

I develop on a network share, and if start my app from there it runs in
the LocalIntranet code-group which does not have the "FullTrust"
permission set (this is needed to execute unmanaged code). I just added
FullTrust to LocalIntranet code group (tool: "mscorcfg.msc") and it
works now. Don't know if this is the best solution tough :)

Peter
 

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

Similar Threads


Top