none
TFS 2010 Build Definition for VS2005 solutions

    Question

  • I have 2 Visual Studio 2005 solutions which each contain multiple project components. The first solution contains Win32 API exe's and dll's written in 'C', the second solution (which is dependent upon the first) contains .Net 2.0 components written in C++/CLI and C#. I have imported both solutions into a TFS 2010 repository and can now retrieve the source from TFS to my local machine and open them/build them successfully using Visual Studio 2005 Team Edition for Software Developers. I now want to enable the formal TFS-managed build process for these two solutions, such that it uses VS2005 to build a Release|Win32 version of the latest set of sources held in TFS. I have been trying to enable this using both the VS2005 and VS2010 front-end to access the TFS repository, and either way the build seems to want to build the solutions using VS2010 - which throws out lots of compatibility warnings etc and causes the build to fail. The two solutions both contain a lot of projects and a huge amount of sourcecode, so I'd like to avoid the overhead of migrating to VS2010 for now, if possible. Is there any way to configure the TFS 2010 build process to use VS2005 to build these solutions, or a quick and easy way to minimise the VS2010 compatibility issues or get the build to ignore/suppress the warnings?
    Tuesday, August 27, 2013 11:03 AM

Answers

  • Hi Taci, 

    Thanks for your post.

    As we know that TFS 2010 invoke MSBuild v4.0 command to build solution on build agent machine by default. If your two solutions can’t be built using MSBuild v4.0(you can manually execute MSBuild command to build your two solutions on build agent machine to test that), you need to custom the build process template to invoke VS 2005(devenv.exe) to build your solutions during Team Build.

    There’s an example about how to invoke VS 2010(devenv.exe) in build process template, please refer to: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx. You can try follow the steps in this article to invoke VS 2005(devenv.exe).    


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by taci Wednesday, September 04, 2013 9:10 AM
    Wednesday, August 28, 2013 1:39 AM
    Moderator
  • Yes, now that I am saving, checking in and refreshing the build process my changes are being applied correctly, and I can confirm that if you create a custom build template based on the default one and replace the 'Run MSBuild for Project' step in the workflow with an 'InvokeProcess' operation to run devenv.exe instead (as described in detail @ http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx) and then set the FileName property of your new InvokeProcess op to point to VS 2005 devenv.exe (e.g.

    "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"), it will successfully build a VS2005 solution.

    Thanks for your help.

     

    • Marked as answer by taci Wednesday, September 04, 2013 9:10 AM
    Wednesday, September 04, 2013 9:08 AM

All replies

  • Hi Taci, 

    Thanks for your post.

    As we know that TFS 2010 invoke MSBuild v4.0 command to build solution on build agent machine by default. If your two solutions can’t be built using MSBuild v4.0(you can manually execute MSBuild command to build your two solutions on build agent machine to test that), you need to custom the build process template to invoke VS 2005(devenv.exe) to build your solutions during Team Build.

    There’s an example about how to invoke VS 2010(devenv.exe) in build process template, please refer to: http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx. You can try follow the steps in this article to invoke VS 2005(devenv.exe).    


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by taci Wednesday, September 04, 2013 9:10 AM
    Wednesday, August 28, 2013 1:39 AM
    Moderator
  • Thankyou John, this certainly looks very useful, but I'm having problems getting my custom template working.

    I have replaced the 'Run MSBuild for Project' activity with an 'InvokeProcess' activity as described in your link, and set its FileName property to the path to VS 2005 Team Edition devenv.exe. But the result is that the 'Run MS Build for Project' step in the log is referencing

    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe\MSBuild.exe

    , so it seems to be using the InvokeProcess' FileName as a directory and appending 'MSBuild.exe' to it. Where is it getting the 'MSBuild.exe' token from?
    Wednesday, August 28, 2013 4:28 PM
  • Hi Taci, 

    Thanks for your reply.

    What’s the VS 2005(devenv.exe) path on your build agent machine?

    And you specific which detailed path as the FileName value in InvokeProcess activity?

    No, as far as I know we can use InvokeProcess to invoke other compilers to build solution/project if these compilers support run command line to invoke it. And can use InvokeProcess to execute any other command lines which can manually execute on build agent machine.

    For more information about InvokeProcess build activity, please refer to: http://msdn.microsoft.com/en-us/library/gg265783(v=vs.100).aspx#Activity_InvokeProcess.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, August 29, 2013 1:52 AM
    Moderator
  • Hi John

    I set the FileName property on the InvokeProcess to

    "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"

    because the VS 2005 devenv.exe path on the build agent is C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\. But when I run it the build fails, and the error log looks like it has tried to use the InvokeProcess.FileName as a directory path and appended the MSBuild.exe filename to the end of it; so it looks like it has tried to run "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe\MSBuild.exe", which is obviously wrong.

    Thursday, August 29, 2013 3:50 PM
  • Hi Taci,  

    Thanks for your reply.

    Sorry for that I missed one thing. 

    As we know that when we build solution/project using VS, in fact it will invoke MSBuild command to build most of our solutions/projects, only for some types of projects(like setup project) it will invoke devenv.exe to build the setup project(because MSBuild can’t build setup project).

    So I want to confirm with you that when you build your that two projects using VS 2005, it will invoke MSBuild or invoke devenv.exe to build your projects? Please view the detailed VS build log to check that. If it invoke MSBuild to build your two projects, which version of MSBuild be invoked and invoke it from which path? Then should set the InvokeProcess to run that version of MSbuild from that path to build your VS 2005 project.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Friday, August 30, 2013 2:44 AM
    Moderator
  • I'm not sure what you mean by the detailed VS build log. When I open either of the two solutions in VS 2005 TE and choose to Rebuild the solution, there are no references to MSBuild anywhere in the build output in the output window, nor in any of the individual logs generated for each project in the solution referenced in the output. Neither is there an MSBuild.exe in the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE directory, so if MSBuild is being used to build the solution I don't know where the VS 2005 TE IDE would be supposed to get it from.
    Friday, August 30, 2013 8:57 AM
  • Hi Taci, 

    Thanks for your reply.

    In your VS 2005>>TOOLS>>Options>>Project and Solutions>>Build and Run, in the right panel, set MSBuild project build output verbosity and MSBuild project build log file verbosity both to Diagnostic, and click OK button. Then rebuild your solutions using VS 2005 again, and check the detail build log in Output window. Try to search C:\Windows\Microsoft.NET\Framework64\v2.0…..\ in that build log, I think the MSBuild.exe will be invoke from this C:\Windows\Microsoft.NET\Framework64\v2.0…..\ path.   


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 02, 2013 3:07 AM
    Moderator
  • Hi John

    I did the steps you described but there's still nothing to indicate MSBuild is being run in the log text.

    Also, I don't have the C:\Windows\Microsoft.NET\Framework64\v2.0…..\  directory you mentioned. I have C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 (without the '64' - maybe because I'm running Windows 2003 R2?) dir and it does contain a copy of MSBuild.exe. If I run this against one of the solutions the build succeeds.


    • Edited by taci Monday, September 02, 2013 1:33 PM
    Monday, September 02, 2013 1:28 PM
  • Hi Taci, 

    Thanks for your reply.

    What’s the bit-version of your build agent machine OS? Without the ‘64’ maybe because the 32-bit version.

    You mean that you can find the MSBuild.exe under path “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727” on your build agent machine? And you can invoke MSBuild command from that path to build your solution manually? If yes, try set the FileName value to “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727” in your InvokeProcess activity, then save the build process template and refresh the build template in your build definition, queue your build definition and check result.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 03, 2013 3:02 AM
    Moderator
  • Yes, I think the build machine is 32-bit. Is that significant - I notice you put the 'Framework64' part of the path in italics?

    Ok, I *think* the problem previously was that I wasn't checking in and refreshing the editted build process completely and that meant it wasn't being properly updated with my changes when I tried to run it.

    I have created a new build process based on the default build template, and changed the ToolPath property of the 'Run MSBuild for Project' step in the workflow to point to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727'. But running this throws out an error because the .Net 2.0 version of MSBuild doesn't recognise the '/m:' argument that is passed to MSBuild.exe. Is it possible to edit the actual processing code inside the 'Run MSBuild for Project' step in the custom build process?

    Tuesday, September 03, 2013 11:08 AM
  • Hi Taci,

    Thanks for your reply.

    Yes, it’s italics in my reply. As I use MSBuild v4.0 on a 64-bit version OS, so my MSBuild.exe under that Framework64\v4.0… path.

    As far as I know there’s no default way to remove this /m argument from default Run MSBuild for Project activity. I suggest you add the InvokeProcess activity to execute your MSBuild v2.0 command to build your solutions. (you can use your InvokeProcess activity instead of the default Run MSBuild for Project activity in default build process template)


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 04, 2013 2:30 AM
    Moderator
  • Yes, now that I am saving, checking in and refreshing the build process my changes are being applied correctly, and I can confirm that if you create a custom build template based on the default one and replace the 'Run MSBuild for Project' step in the workflow with an 'InvokeProcess' operation to run devenv.exe instead (as described in detail @ http://geekswithblogs.net/jakob/archive/2010/05/14/building-visual-studio-setup-projects-with-tfs-2010-team-build.aspx) and then set the FileName property of your new InvokeProcess op to point to VS 2005 devenv.exe (e.g.

    "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"), it will successfully build a VS2005 solution.

    Thanks for your help.

     

    • Marked as answer by taci Wednesday, September 04, 2013 9:10 AM
    Wednesday, September 04, 2013 9:08 AM
  • Hi Taci,

    Thanks for your reply.

    That’s nice.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 04, 2013 9:10 AM
    Moderator