Tips & Tricks: Extending MSBuild with Tasks, Loggers, and Targets Faisal Mohamood TLNL01 Program Manager - MSBuild Microsoft Corporation.

Slides:



Advertisements
Similar presentations
© 2014 Blackboard Inc. All rights reserved.. Learn about the different types of content you can add to your course. Add items and tools to content areas.
Advertisements

Web Deployment Projects Targeting your Development, Staging and Production Environments. Eli Robillard, Knowledge Systems Practice Lead.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Visual Studio 2005 C# IDE Enhancements Luca Bolognese C# Program Manager Microsoft Corporation.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Future Directions for Leveraging Advanced XML Tools and Building Custom XML Solutions Denise Draper DAT321 Microsoft Corporation.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
A First Program Using C#
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
Introduction to VB.NET Tonga Institute of Higher Education.
Future Directions: Building Customizable Applications using.NET Eric Schnepp TLN205 Lead Program Manager Microsoft Corporation.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Exploiting New Capabilities for Search And Organization Kerem Karatal DAT307 Lead Program Manager Microsoft Corporation.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
MSBuild: Architecting a Customized Build System Rajeev Goel, TLN402 Software Development Engineer MSBuild Microsoft Corporation.
1 Introducing MSBuild: Build Engine for "Whidbey" and "Longhorn" Alex Kipman Program Manager Alex Kipman
Name Microsoft Student Partner Overview of the Visual Studio 2005 Express Products.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
DEV330 Visual Studio.NET IDE Tips and Tricks Billy Hollis Author / consultant.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Using Visual Studio C++ Express Ron Gross A current copy of this can be found at or this direct linkhttp://tinyurl.com/2ucarothis.
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
MSBuild Unveiled Peter Schneider MVP Visual Developer – Visual C# MCT, MCSD.NET, MCAD.NET, MCDBA
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
The 2007 Microsoft Office System Servers Enterprise Content Management, Workflow and Forms Martin Parry Developer and Platform Group, Microsoft Ltd
Workflow in Microsoft Office SharePoint Server Jessica Gruber Consultant Microsoft Corporation.
Performance Testing Using VSTS Saravana Kumar Microsoft MVP, VSTS Hewlett Packard Saravana Kumar Microsoft MVP, VSTS Hewlett Packard.
Building More Powerful ASP.NET Applications with IIS7 Michael Volodarsky COM303 Program Manager Microsoft Corporation.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Building Complete Web Application Using ASP.NET 3.5 & Visual Studio 2008 Omar Khan Group Program Manager Visual Studio.
Building Enterprise Applications Using Visual Studio®
Mike Harsh PRSL001 Program Manager Microsoft Corporation
C# and VB code-focused development with Visual Studio
Chapter 2: The Visual Studio .NET Development Environment
Visual C# 2005: IDE Enhancements
Jim Nakashima Program Manager – Cloud Tools Microsoft Corporation
Jeff Hollan / Kevin Lam Program Manager / Principal Program Manager- Microsoft Bringing Logic Apps into DevOps with Visual Studio and monitoring.
Visual Studio Tools for Office 2005
SQL Server Data Tools for Visual Studio Part I: Core SQL Server Tools
Azure API Management Jothi Prakash A
Searching Business Data with MOSS 2007 Enterprise Search
Microsoft Dynamics.
Microsoft Ignite NZ October 2016 SKYCITY, Auckland.
Module 1: Getting Started
Searching Business Data with MOSS 2007 Enterprise Search
Microsoft Build /10/2018 1:35 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
11/21/2018 4:27 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Using Visual Studio and VS Code for Embedded C/C++ Development
Microsoft Connect /26/2018 6:08 PM
Tooling and Diagnostics
Microsoft Visual Studio 2010 for Web Deployment
Microsoft Connect /17/2019 9:04 AM
Jochen Seemann Program Manager Enterprise Tools Microsoft Corporation
Microsoft Connect /23/ :38 AM
DEV354 Visual Studio 2005: New Enhancements For Debugging Applications
Delivering great hardware solutions for Windows
DEV322 Visual Studio 2005 C# IDE Enhancements
Martin MSBuild Martin
ADO.NET Entity Framework
5/25/2019 2:40 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Introduction to ASP.NET Parts 1 & 2
TechEd /12/ :12 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Visual Studio 2005 IDE Features
Presentation transcript:

Tips & Tricks: Extending MSBuild with Tasks, Loggers, and Targets Faisal Mohamood TLNL01 Program Manager - MSBuild Microsoft Corporation

MSBuild – Tips & Tricks 2 MSBuild in 5 minutes The underlying build engine in Visual Studio 2005 Fully open and published XML file format for describing build Visual Studio 2005 build is fully customizable You extend the build by writing managed code (tasks and loggers) You don’t need the IDE to build Visual Studio projects

MSBuild – Tips & Tricks 3 MSBuild in 5 minutes MyCoolApp true $(AppName).exe <Csc EmitDebugInformation=“$(DebugSymbols)” OutputAssembly=“$(OutputAssembly)”/>

MSBuild – Tips & Tricks 4 #1: Editing a project using Visual Studio 2005 Opening a project file for edit is 4 clicks away from within Visual Studio! When editing, you get full Intellisense based on the Project File Format Schema  Right Click on the project name in Solution Explorer and “Unload Project”  Right Click on the unloaded project in Solution Explorer and “Edit Project”

MSBuild – Tips & Tricks 5 #2: Customizing the Build <MakeDir /> <Copy SourceFiles=“$(TargetPath)” /> How do I run pre-build and post-build steps using built-in MSBuild features?

MSBuild – Tips & Tricks 6 #3: Customizing with more granularity How do I run custom steps during arbitrary points in the build process – for example, what if I wanted to delete all files from c:\temp\publish as a part of Clean target? $(CleanDependsOn);MyClean

MSBuild – Tips & Tricks 7 #4: Using built-in metadata %(FullPath)%(RootDir)%(Filename)%(Extension)%(RelativeDir)%(Directory) %(RecursiveDir) %(Identity) %(ModifiedTime) %(CreationTime) %(AccessedTime) <Copy DestinationFiles=“%(Compile.Filename).bak” />

MSBuild – Tips & Tricks 8 #5: Copying files recursively How can I use MSBuild constructs to copy all the contents of a folder from one directory to another? <Copy DestinationFolder=“C:\foocopy\%(RecursiveDir)” />

MSBuild – Tips & Tricks 9 #6: Building Incrementally How can I run the target only to transform those XML files that have been added (or changed) since the last build?

MSBuild – Tips & Tricks 10 #6: Building Incrementally <TargetName=“TransformXmlToHtml” For items that have a 1:1 mapping between inputs and outputs, you can use Target Level Dependency Analysis by explicitly defining your inputs and outputs

MSBuild – Tips & Tricks 11 #7: Invoking one target from another A target that has built once will not build again during the same build session <MSBuild Projects=“myproject.proj” Targets=“RunUnitTests” />

MSBuild – Tips & Tricks 12 #8: Executing the same target multiple times How can I invoke the same target more than once?

MSBuild – Tips & Tricks 13 #8: Executing the same target multiple times Invoke the target using the MSBuild task but with different “properties” <MSBuild Projects=“$(MSBuildProjectFile)” Targets=“CalculateUnitTestCoverage” Properties=“Stage=BeforeBuild” /> <MSBuild Projects=“$(MSBuildProjectFile)” Targets=“CalculateUnitTestCoverage” Properties=“Stage=AfterBuild” />

MSBuild – Tips & Tricks 14 #9: Gathering performance summary “Somehow, my build has slowed down tremendously. I need to find out what’s going on!” C:\project> msbuild build.proj /ConsoleLoggerParameters:PerformanceSummary C:\project> msbuild build.proj /verbosity:Diagnostic Use the /ConsoleLoggerParameters switch or the Diagnostic verbosity to gather performance statistics.

MSBuild – Tips & Tricks 15 How do I do this? I’ve got a bunch of code that I’d like to open in Visual Studio, but all I have is a ton of source code with no Visual Studio project or solution I’d like to open for edit and browse using Visual Studio Is this possible?

MSBuild – Tips & Tricks 16 #10: Coolest trick of the day! Simply create a.csproj or.vbproj file that recursively adds all files to a Compile item, and additionally imports Microsoft.CSharp.targets or Microsoft.VisualBasic.targets

MSBuild – Tips & Tricks 17 Additional Resources Go to the Advanced MSBuild Breakout Session by Rajeev Goel – Stop by the MSBuild table at Ask the Experts – Thursday The Big Room Visit the Tools & Languages Track Lounge (Big Room) Try out the MSBuild Hands On Lab here at the PDC if you are new to MSBuild Visit the MSBuild Wiki Post a question on the MSDN Forums – Send mail to

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.