none
NotImplementedException for p.FullName RRS feed

  • Question

  • In the below code when I debug, it reports NotImplementedException for p.FullName, earlier it was running fine.

    Could some one explain what is happening????

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.VisualStudio.VCProject;
    using Microsoft.VisualStudio.VCProjectEngine;
    using EnvDTE;
    using EnvDTE80;
    using EnvDTE100;
    using System.IO;

    namespace ConsoleApplication2
    {
        class Program
        {
            static void Main(string[] args)
            {
                Type solutionType = Type.GetTypeFromProgID("VisualStudio.DTE.9.0", true);

                DTE myDte = (DTE)System.Activator.CreateInstance(solutionType);
                Solution mysol = (Solution)myDte.Solution;
                string target = @"C:\Users\aviral.bhatnagar\Documents\Visual Studio 2008\Projects\newProject\newProject.sln";
                string target2 = @"C:\Users\aviral.bhatnagar\Documents\Visual Studio 2010\Projects\newProject\newProject.sln";
                if (File.Exists(target))
                    System.Console.WriteLine("File exists");
                mysol.Open(target);

                foreach (Project p in mysol.Projects)
                {
                    System.Console.WriteLine("{0}", p.Name);
                    System.Console.WriteLine("{0}", p.FullName);

                }
                System.Console.Read();
            }

        }
    }

              
    Monday, August 20, 2012 10:12 AM

Answers

All replies