예제 #1
0
        public void WhenSolutionIsOpened_ThenCanGetMsBuildProjectProperties()
        {
            base.OpenSolution("SampleSolution\\SampleSolution.sln");

            var explorer = base.ServiceLocator.GetInstance <ISolutionExplorer>();

            var lib = new ITreeNode[] { explorer.Solution }.Traverse(TraverseKind.BreadthFirst, node => node.Nodes)
            .OfType <IProjectNode>()
            .FirstOrDefault(node => node.DisplayName == "ClassLibrary");

            var msb = lib.As <MsBuild.Project>();

            Assert.NotNull(msb);

            //Console.WriteLine("IntermediateOutputPath                                      : {0}", lib.Properties.IntermediateOutputPath);
            //Console.WriteLine("DesignTimeIntermediateOutputPath                                      : {0}", lib.Properties.DesignTimeIntermediateOutputPath);
            //Console.WriteLine("BaseIntermediateOutputPath                                      : {0}", lib.Properties.BaseIntermediateOutputPath);
            //Console.WriteLine("MSBuildProjectDirectory                                      : {0}", lib.Properties.MSBuildProjectDirectory);

            //Console.WriteLine("OutputFileName: {0}", lib.Properties.OutputFileName);
            //Console.WriteLine("OutputPath: {0}", lib.Properties.OutputPath);
            //Console.WriteLine("TargetDir                                      : {0}", lib.Properties.TargetDir);
            //Console.WriteLine("TargetedFrameworkDir                           : {0}", lib.Properties.TargetedFrameworkDir);
            //Console.WriteLine("TargetedRuntimeVersion                         : {0}", lib.Properties.TargetedRuntimeVersion);
            //Console.WriteLine("TargetedSDKArchitecture                        : {0}", lib.Properties.TargetedSDKArchitecture);
            //Console.WriteLine("TargetedSDKConfiguration                       : {0}", lib.Properties.TargetedSDKConfiguration);
            //Console.WriteLine("TargetExt                                      : {0}", lib.Properties.TargetExt);
            //Console.WriteLine("TargetFileName                                 : {0}", lib.Properties.TargetFileName);
            //Console.WriteLine("TargetFramework                                : {0}", lib.Properties.TargetFramework);
            //Console.WriteLine("TargetFrameworkAsMSBuildRuntime                : {0}", lib.Properties.TargetFrameworkAsMSBuildRuntime);
            //Console.WriteLine("TargetFrameworkIdentifier                      : {0}", lib.Properties.TargetFrameworkIdentifier);
            //Console.WriteLine("TargetFrameworkMoniker                         : {0}", lib.Properties.TargetFrameworkMoniker);
            //Console.WriteLine("TargetFrameworkMonikerAssemblyAttributesPath   : {0}", lib.Properties.TargetFrameworkMonikerAssemblyAttributesPath);
            //Console.WriteLine("TargetFrameworkMonikerDisplayName              : {0}", lib.Properties.TargetFrameworkMonikerDisplayName);
            //Console.WriteLine("TargetFrameworkSDKToolsDirectory               : {0}", lib.Properties.TargetFrameworkSDKToolsDirectory);
            //Console.WriteLine("TargetFrameworkVersion                         : {0}", lib.Properties.TargetFrameworkVersion);
            //Console.WriteLine("TargetName                                     : {0}", lib.Properties.TargetName);
            //Console.WriteLine("TargetPath                                     : {0}", lib.Properties.TargetPath);
            //Console.WriteLine("TargetPlatformIdentifier                       : {0}", lib.Properties.TargetPlatformIdentifier);
            //Console.WriteLine("TargetPlatformMoniker                          : {0}", lib.Properties.TargetPlatformMoniker);
            //Console.WriteLine("TargetPlatformRegistryBase                     : {0}", lib.Properties.TargetPlatformRegistryBase);
            //Console.WriteLine("TargetPlatformSdkPath                          : {0}", lib.Properties.TargetPlatformSdkPath);
            //Console.WriteLine("TargetPlatformVersion                          : {0}", lib.Properties.TargetPlatformVersion);
            //Console.WriteLine("TargetRuntime                                  : {0}", lib.Properties.TargetRuntime);

            //((DynamicObject)lib.Properties).GetDynamicMemberNames()
            //    .ToList()
            //    .ForEach(prop => Console.WriteLine(prop));
        }
예제 #2
0
        public void WhenSolutionIsOpened_ThenCanGetMsBuildProjectProperties()
        {
            base.OpenSolution("SampleSolution\\SampleSolution.sln");

            var explorer = base.ServiceLocator.GetInstance<ISolutionExplorer>();

            var lib = new ITreeNode[] { explorer.Solution }.Traverse(TraverseKind.BreadthFirst, node => node.Nodes)
                .OfType<IProjectNode>()
                .FirstOrDefault(node => node.DisplayName == "ClassLibrary");

            var msb = lib.As<MsBuild.Project>();

            Assert.NotNull(msb);

            //Console.WriteLine("IntermediateOutputPath                                      : {0}", lib.Properties.IntermediateOutputPath);
            //Console.WriteLine("DesignTimeIntermediateOutputPath                                      : {0}", lib.Properties.DesignTimeIntermediateOutputPath);
            //Console.WriteLine("BaseIntermediateOutputPath                                      : {0}", lib.Properties.BaseIntermediateOutputPath);
            //Console.WriteLine("MSBuildProjectDirectory                                      : {0}", lib.Properties.MSBuildProjectDirectory);
            
            //Console.WriteLine("OutputFileName: {0}", lib.Properties.OutputFileName);
            //Console.WriteLine("OutputPath: {0}", lib.Properties.OutputPath);
            //Console.WriteLine("TargetDir                                      : {0}", lib.Properties.TargetDir);
            //Console.WriteLine("TargetedFrameworkDir                           : {0}", lib.Properties.TargetedFrameworkDir);
            //Console.WriteLine("TargetedRuntimeVersion                         : {0}", lib.Properties.TargetedRuntimeVersion);
            //Console.WriteLine("TargetedSDKArchitecture                        : {0}", lib.Properties.TargetedSDKArchitecture);
            //Console.WriteLine("TargetedSDKConfiguration                       : {0}", lib.Properties.TargetedSDKConfiguration);
            //Console.WriteLine("TargetExt                                      : {0}", lib.Properties.TargetExt);
            //Console.WriteLine("TargetFileName                                 : {0}", lib.Properties.TargetFileName);
            //Console.WriteLine("TargetFramework                                : {0}", lib.Properties.TargetFramework);
            //Console.WriteLine("TargetFrameworkAsMSBuildRuntime                : {0}", lib.Properties.TargetFrameworkAsMSBuildRuntime);
            //Console.WriteLine("TargetFrameworkIdentifier                      : {0}", lib.Properties.TargetFrameworkIdentifier);
            //Console.WriteLine("TargetFrameworkMoniker                         : {0}", lib.Properties.TargetFrameworkMoniker);
            //Console.WriteLine("TargetFrameworkMonikerAssemblyAttributesPath   : {0}", lib.Properties.TargetFrameworkMonikerAssemblyAttributesPath);
            //Console.WriteLine("TargetFrameworkMonikerDisplayName              : {0}", lib.Properties.TargetFrameworkMonikerDisplayName);
            //Console.WriteLine("TargetFrameworkSDKToolsDirectory               : {0}", lib.Properties.TargetFrameworkSDKToolsDirectory);
            //Console.WriteLine("TargetFrameworkVersion                         : {0}", lib.Properties.TargetFrameworkVersion);
            //Console.WriteLine("TargetName                                     : {0}", lib.Properties.TargetName);
            //Console.WriteLine("TargetPath                                     : {0}", lib.Properties.TargetPath);
            //Console.WriteLine("TargetPlatformIdentifier                       : {0}", lib.Properties.TargetPlatformIdentifier);
            //Console.WriteLine("TargetPlatformMoniker                          : {0}", lib.Properties.TargetPlatformMoniker);
            //Console.WriteLine("TargetPlatformRegistryBase                     : {0}", lib.Properties.TargetPlatformRegistryBase);
            //Console.WriteLine("TargetPlatformSdkPath                          : {0}", lib.Properties.TargetPlatformSdkPath);
            //Console.WriteLine("TargetPlatformVersion                          : {0}", lib.Properties.TargetPlatformVersion);
            //Console.WriteLine("TargetRuntime                                  : {0}", lib.Properties.TargetRuntime);

            //((DynamicObject)lib.Properties).GetDynamicMemberNames()
            //    .ToList()
            //    .ForEach(prop => Console.WriteLine(prop));
        }