开发者

Build/Rebuild Project VS 2008 using DTE

How can I Build and Rebuild a Project csproj using DTE.ExecuteCommand ?

Any reference of all commands of DTE ?

For solution, I use this:

 Logica.BuildTracking.IniciarBuildTrack();
                    proyecto.DTE.ExecuteCommand("Build.RebuildSolution", "");
                    while (!Logica.BuildTracking.BuildFinalizado)
                    {
                        Application.DoEvents();
   开发者_JAVA技巧                     //System.Threading.Thread.Sleep(1000);
                    }

I try use this:

 // TODO !!!
                    proyecto.DTE.ExecuteCommand("Build.BuildOnlyProject", "");

but I get error: "Command \"Build.BuildOnlyProject\" is not available."


This should help you get started

//gets build obj
var sb = proyecto.DTE.Solution.SolutionBuild as SolutionBuild;
//sets the object to build; still figuring out what can be done with this one...
sb.SolutionConfigurations.Item(1).Activate();
//optional arg for if you want to wait for the build to finish
sb.Build(true);

I'm still playing with the method you were using ExecuteCommand but you can use the default param and write it like this: proyecto.DTE.ExecuteCommand("SomeCommand");

because the second parameter is set by default to an empty string.
For more info take a look at this
http://msdn.microsoft.com/en-us/library/aa301352%28v=VS.71%29.aspx


Take a look at this msdn documentation for the Build command in DTE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜