상속: Microsoft.VisualStudio.Shell.Flavor.FlavoredProjectFactoryBase
예제 #1
0
 protected virtual void SetMsbuildEngine(ProjectFactory factory)
 {
     FieldInfo buildEngine = typeof(ProjectFactory).GetField("buildEngine", BindingFlags.Instance | BindingFlags.NonPublic);
     buildEngine.SetValue(factory, Engine.GlobalEngine);
     Microsoft.Build.BuildEngine.Project msbuildproject = Engine.GlobalEngine.CreateNewProject();
     FieldInfo buildProject = typeof(ProjectFactory).GetField("buildProject", BindingFlags.Instance | BindingFlags.NonPublic);
     buildProject.SetValue(factory, msbuildproject);
 }
예제 #2
0
        protected virtual void SetMsbuildEngine(ProjectFactory factory)
        {
            ProjectCollection.GlobalProjectCollection.UnloadAllProjects();

            FieldInfo buildEngine = typeof(ProjectFactory).GetField("buildEngine", BindingFlags.Instance | BindingFlags.NonPublic);
            buildEngine.SetValue(factory, ProjectCollection.GlobalProjectCollection);

            Microsoft.Build.Evaluation.Project msbuildproject = ProjectCollection.GlobalProjectCollection.LoadProject(projectFile);
            FieldInfo buildProject = typeof(ProjectFactory).GetField("buildProject", BindingFlags.Instance | BindingFlags.NonPublic);
            buildProject.SetValue(factory, msbuildproject);
        }