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

How to get the right “Output path” from EnvDTE.Project by code if “Show advanced build configuration” option is unchecked.

$
0
0

I find that the check box “Show advanced build configuration” itself affects the result.

Here is my test code:

        staticstring GetAssemblyPath(EnvDTE.Project vsProject)

        {

            string fullPath = vsProject.Properties.Item("FullPath").Value.ToString();

            string outputPath = vsProject.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value.ToString();

            string outputDir = Path.Combine(fullPath, outputPath);

            string outputFileName = vsProject.Properties.Item("OutputFileName").Value.ToString();

            string assemblyPath = Path.Combine(outputDir, outputFileName);

            return assemblyPath;

        }

 

        staticbool IsReliableDebug(EnvDTE.Project vsProject)

        {

            string DefineConstants = vsProject.ConfigurationManager.ActiveConfiguration.Properties.Item("DefineConstants").Value.ToString();

            bool bReliableIsDebug = (DefineConstants.IndexOf("DEBUG") >= 0);

            return bReliableIsDebug;

        }

 

The output path retrieved by code is not same with the output path checked on UI.

 


Viewing all articles
Browse latest Browse all 4410

Trending Articles



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