ChrisMarlow

Hi,

I have tried to set the properties (using VS 2005) from external code, but the properties are not saved. The value is set, but when I get a new instance, the values are back to how they were. Is there a save step I need to call

Here is the code I am running:

Code Snippet

EnvDTE.DTE myDTE = (EnvDTE.DTE)Microsoft.VisualBasic.Interaction.CreateObject("VisualStudio.DTE.8.0", "");

Properties envGenTab = myDTE.get_Properties("Projects", "VCDirectories");

EnvDTE.Properties vcDirectories = myDTE.get_Properties("Projects", "VCDirectories");

EnvDTE.Property libraryFilesProperty = vcDirectories.Item("LibraryDirectories");

string dirsToAdd = @"c:\NewDirectory";

string libDirs = libraryFilesProperty.Value.ToString();

libDirs = libDirs.Replace("Win32|", "Win32|" + dirsToAdd +";");

libraryFilesProperty.Value = libDirs;

By the end of this, the libraryFilesProperty.Value is correctly modified, but if I run it again, or drag back to the top, the new libraryFilesProperty.Value is back to its original value.

Any help would be greatfully appreciated.

Thanks,

Chris.