Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Can read but can't set certain project configuration properties using the EnvDTE object model - keep getting DISP_E_EXCEPTION

$
0
0

Using Visual Studio 2010, Windows Server 2008

When I try the following example, I get "Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION))", when executing the last line

        private static void ConfigureExistingProject(EnvDTE.Solution soln)
        {
            EnvDTE.Project proj = GetProject(soln, "Test");
            EnvDTE.Configuration config = proj.ConfigurationManager.ActiveConfiguration;
            EnvDTE.Properties props = config.Properties;
            VSLangProj.VSProject vsPrj = (VSLangProj.VSProject)proj.Object;

            
            //Can read fine
            Console.WriteLine(vsPrj.Project.Properties.Item("AssemblyName").Value);
            //but can't set - get the exception here:
            vsPrj.Project.Properties.Item("AssemblyName").Value = "blahblah";


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>