Herman Solberg


I've got a problem that has been haunting me for a couple of days now. I'm developing a VSTO 2005 SE add-in for Word 2003. When I'm trying to install it on my development machine the assembly that sets the security policy throws an exception that is not described anywhere as far as I have read. The error message is the following:

Cannot set the security policy. The specified target directory is not valid.

I'm running Win XP SP2 with Word 2003 Professional SP2 (including all the latest updates), Office 2007 Primary Interop Assemlies, Visual Studio 2005 Team Edition for Developers with SP1, VSTO 2005 SE.

I ran the PSS VSTO 2005 Client Troubleshooter to make sure that all the necessary components are present, which they are according to the result. I've followed the latest walkthroughs on how to create an Installer Package for VSTO 2005, I believe those are from March this year. I've searched this forum and the rest of the web aswell, for related problems but come up with nothing helpful.

Of course the add-in works fine when I'm debuggging but as soon as click install on the setup project I receive the error message written above, then the installation rolls back. I tried rebooting my computer aswell just to make sure.

I should probably add that my development environment is running on Virtual PC 2007 and that I'm logged in with my Active Directory account which has local administrator priviligies.

I think I given you all the details but if anything is missing just ask.

Some help would be greatly appreciated.


Re: Visual Studio Tools for Office Problem installing VSTO 2005 SE Word 2003 add-in on the development machine

Misha Shneerson - MSFT

Here is my guess:

When SetSecurity custom action is invoked - one of the parameters that is passed in is a target directory where add-in is installed. The code in SetSecurity.cs checks whether this target directory is not empty and, if it is, it will throw an exception with the text you are quoting above. You probably need to double check the parameters you are passing to the custom action - there is quite a few so it is easy to mistype something.

Re: Visual Studio Tools for Office Problem installing VSTO 2005 SE Word 2003 add-in on the development machine

Herman S

Thanks Misha!

Problem solved. As you suggested I made a mistake when setting the parameters for the Custom Action when installing. I had written:


when it should have been:


of course. Next time I'll use copy and paste.