{"id":2233,"date":"2007-07-13T09:27:26","date_gmt":"2007-07-13T09:27:26","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/buckh\/2007\/07\/13\/how-to-build-projects-in-team-build-that-only-visual-studio-can-build\/"},"modified":"2007-07-13T09:27:26","modified_gmt":"2007-07-13T09:27:26","slug":"how-to-build-projects-in-team-build-that-only-visual-studio-can-build","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/buckh\/how-to-build-projects-in-team-build-that-only-visual-studio-can-build\/","title":{"rendered":"How to build projects in Team Build that only Visual Studio can build"},"content":{"rendered":"<p><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\">Aaron<\/a> has written a great post on using Visual Studio (devenv)&nbsp;from within Team Build as part of the build process.&nbsp; If that sounds strange, it&#8217;s necessary because there are projects that Visual Studio can build, but msbuild cannot.&nbsp; Projects in this category include Visual Studio setup projects (.vdproj), SQL Reporting Services (SRS), and BizTalk.&nbsp; Some projects may never be supported outside of msbuild, as is the case with the setup projects (<a href=\"http:\/\/wix.sourceforge.net\/\">WiX<\/a>&nbsp;works msbuild, if you want a setup technology that doesn&#8217;t rely on Visual Studio).<\/p>\n<p>We have documentation, such as this <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms404859(VS.80).aspx\">walkthrough on building setup projects<\/a>,&nbsp;showing you how to run devenv by using the Exec task in msbuild, but&nbsp;this approach&nbsp;has shortcomings.&nbsp; You don&#8217;t get any details in the build report.&nbsp; The syntax is confusing to read with all of the quotation marks, some of which must be escaped.&nbsp; But the most subtle aspect, and Aaron discovered this in the course of writing is his post, devenv rebuilds the whole solution to another directory, resulting in a different set of binaries being packaged in your setup output.<\/p>\n<p>To address this, he has written a custom msbuild task that wraps devenv.&nbsp; In the post he shows you how to use it, and for those who are interested, he describes how it works.&nbsp; Both the compiled assembly and the source code are attached to the post.&nbsp; Note that this task only works for TFS 2008 (Orcas) and not TFS 2005 (v1).<\/p>\n<blockquote>\n<h4><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2007\/07\/12\/team-build-devenv-task.aspx\">Team Build DevEnv Task<\/a><\/h4>\n<p> Because many Visual Studio project types are not supported in MSBuild, many Team Build users end up needing to invoke DevEnv directly.&nbsp; There is a fair amount of confusion about how to do this best \/ simplest &#8211; I&#8217;ve written two posts (<a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2007\/06\/29\/building-from-the-command-line-with-devenv.aspx\">here<\/a> and <a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2007\/03\/30\/building-non-msbuild-projects-with-team-build.aspx\">here<\/a>) on the issue already!&nbsp;  <\/p>\n<p>As such, I thought it would be helpful to write a DevEnv task that could be used to invoke DevEnv from MSBuild during the course of a Team Build build, along with some guidance on how to use it best.&nbsp; I&#8217;ll go through how to use the attached DLL for those who just want to use the task,&nbsp;go into&nbsp;a few chunks of the source code for those interested in how the task works, and then go through an example of how to use the task to build a setup project (*.vdproj).&nbsp; A note for the lawyers: I can make no guarantees as to the awesomeness of this task or lack thereof &#8211; it is provided &#8220;as is&#8221; with no warranties and confers no rights.&nbsp;  <\/p>\n<p><a href=\"http:\/\/blogs.msdn.com\/aaronhallberg\/archive\/2007\/07\/12\/team-build-devenv-task.aspx\">more&#8230;<\/a><\/p>\n<\/blockquote>\n<p>While this task isn&#8217;t going to be part of Orcas (TFS 2008), we&#8217;ll add it to the <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/vstudio\/aa718351.aspx\">TFS power tools<\/a> once we get some feedback. <\/p>\n<p>Enjoy and let us know what you think! <\/p>\n<p>tags: <a href=\"http:\/\/technorati.com\/tag\/tfs\" rel=\"tag\">tfs<\/a>, <a href=\"http:\/\/technorati.com\/tag\/team+foundation\" rel=\"tag\">team foundation<\/a>, <a href=\"http:\/\/technorati.com\/tag\/team+build\" rel=\"tag\">team build<\/a>, <a href=\"http:\/\/technorati.com\/tag\/orcas\" rel=\"tag\">orcas<\/a>, <a href=\"http:\/\/technorati.com\/tag\/tfs+2008\" rel=\"tag\">tfs 2008<\/a>, <a href=\"http:\/\/technorati.com\/tag\/msbuild\" rel=\"tag\">msbuild<\/a>, <a href=\"http:\/\/technorati.com\/tag\/devenv\" rel=\"tag\">devenv<\/a>, <a href=\"http:\/\/technorati.com\/tag\/setup+projects\" rel=\"tag\">setup projects<\/a>, <a href=\"http:\/\/technorati.com\/tag\/vdproj\" rel=\"tag\">vdproj<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aaron has written a great post on using Visual Studio (devenv)&nbsp;from within Team Build as part of the build process.&nbsp; If that sounds strange, it&#8217;s necessary because there are projects that Visual Studio can build, but msbuild cannot.&nbsp; Projects in this category include Visual Studio setup projects (.vdproj), SQL Reporting Services (SRS), and BizTalk.&nbsp; Some [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":10268,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"blog_post_summary":"<p>Aaron has written a great post on using Visual Studio (devenv)&nbsp;from within Team Build as part of the build process.&nbsp; If that sounds strange, it&#8217;s necessary because there are projects that Visual Studio can build, but msbuild cannot.&nbsp; Projects in this category include Visual Studio setup projects (.vdproj), SQL Reporting Services (SRS), and BizTalk.&nbsp; Some [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/2233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/comments?post=2233"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/posts\/2233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media\/10268"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/media?parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/categories?post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/buckh\/wp-json\/wp\/v2\/tags?post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}