Home All Groups Group Topic Archive Search About

Impossible to set security policy for VSTO Excel?

Author
24 Aug 2005 1:57 AM
Michi Henning
Hi,

I just installed Office 2003 and VSTO 2003. I cannot get *any* Excel
project to run at all. Error is:

The current .NET security policy does not permit ExcelProject1 to run from the
folder .\ExcelProject1_bin\. Do not change the security policy in your computer...

I've read every KB article and blog I could find, and none of the advice resolves
the problem.

Here is the sequence of steps I took:

- Full install of VS 2003
- Full install of Office 2003
- Install of VSTO 2003

- Start new Excel project in Visual Studio, accept all the defaults.
   The project builds fine.

- When I launch the Excel spreadsheet, I get the above error.

Checking the security settings, I can see that VS adds the code group
for the project, and all the path names and permissions look good.

I've also tried to temporarily add a code group that gives full trust
to the entire C drive, but that doesn't change anything.

The exact same thing happens when I create a Word project, so this isn't
specific to Excel.

I can't debug the application either. Even when I configure VS to break
into the debugger for all exceptions, I simply see Excel start up and
close again.

Changing the value of the _AssemblyLocation0 property in Excel to use
a full path name instead of a relative path name makes no difference.

I'd very much appreciate any hints as to how to debug this. Right now,
I can't get *any* Excel or Word project to work at all.

Thanks,

Michi.

Author
25 Aug 2005 9:57 PM
John R. Durant [MSFT]
Michi,
I'm sorry you are having trouble. Did you nuke any instances of the app that
running and then restart? Your problem sounds a lot like the issue in this
kb:

http://support.microsoft.com/default.aspx?scid=kb;en-us;q824002

HTH

--
John R. Durant [MSFT]
blog: http://blogs.msdn.com/johnrdurant
This posting is provided "AS IS" with no warranties, and confers no rights.
Show quoteHide quote
"Michi Henning" <mi***@zeroc.com> wrote in message
news:%231Lvz8EqFHA.3744@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> I just installed Office 2003 and VSTO 2003. I cannot get *any* Excel
> project to run at all. Error is:
>
> The current .NET security policy does not permit ExcelProject1 to run from
> the
> folder .\ExcelProject1_bin\. Do not change the security policy in your
> computer...
>
> I've read every KB article and blog I could find, and none of the advice
> resolves
> the problem.
>
> Here is the sequence of steps I took:
>
> - Full install of VS 2003
> - Full install of Office 2003
> - Install of VSTO 2003
>
> - Start new Excel project in Visual Studio, accept all the defaults.
>   The project builds fine.
>
> - When I launch the Excel spreadsheet, I get the above error.
>
> Checking the security settings, I can see that VS adds the code group
> for the project, and all the path names and permissions look good.
>
> I've also tried to temporarily add a code group that gives full trust
> to the entire C drive, but that doesn't change anything.
>
> The exact same thing happens when I create a Word project, so this isn't
> specific to Excel.
>
> I can't debug the application either. Even when I configure VS to break
> into the debugger for all exceptions, I simply see Excel start up and
> close again.
>
> Changing the value of the _AssemblyLocation0 property in Excel to use
> a full path name instead of a relative path name makes no difference.
>
> I'd very much appreciate any hints as to how to debug this. Right now,
> I can't get *any* Excel or Word project to work at all.
>
> Thanks,
>
> Michi.
Author
25 Aug 2005 10:10 PM
Michi Henning
John R. Durant [MSFT] wrote:
> Michi,
> I'm sorry you are having trouble. Did you nuke any instances of the app that
> running and then restart? Your problem sounds a lot like the issue in this
> kb:
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;q824002
>

No that's not it. I found that article too, but even after a reboot,
it's still not working.

It would be *really* nice if there would be a way to find out *why*
the security check failed, but I don't know of any.

For what it's worth, I ended up installing Office and VSTO on a
laptop, just to see what would happen and, lo and behold, it worked
first time on the laptop.

The only other difference between the two machines is that I didn't
apply all the patches for Office on the laptop, whereas I did on
the other machine.

So, it looks like there is a problem with the config on the desktop
machine. But how do I find out what it is?

Cheers,

Michi.
Author
30 Aug 2005 5:56 PM
Ariel Raunstien
I'm guessing that your excel application is cached your dlls somewhere, and
tries to run it from there. Try killing all Office apps, and running "gacutil
/cdl". Then try creating a new VSTO project and run it.

I know it's a long shot, but WTH.


Ariel

Show quoteHide quote
"Michi Henning" wrote:

> John R. Durant [MSFT] wrote:
> > Michi,
> > I'm sorry you are having trouble. Did you nuke any instances of the app that
> > running and then restart? Your problem sounds a lot like the issue in this
> > kb:
> >
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;q824002
> >
>
> No that's not it. I found that article too, but even after a reboot,
> it's still not working.
>
> It would be *really* nice if there would be a way to find out *why*
> the security check failed, but I don't know of any.
>
> For what it's worth, I ended up installing Office and VSTO on a
> laptop, just to see what would happen and, lo and behold, it worked
> first time on the laptop.
>
> The only other difference between the two machines is that I didn't
> apply all the patches for Office on the laptop, whereas I did on
> the other machine.
>
> So, it looks like there is a problem with the config on the desktop
> machine. But how do I find out what it is?
>
> Cheers,
>
> Michi.
>