Shipping a cross-platform MSBuild task in a NuGet package

MSBuild allows users to write and register their own tasks. Tasks, unlike targets, can be written in C# and can perform build operations that would be impossible to write in MSBuild’s XML dialect. In this post, I’m going walk through the key pieces of how to write an MSBuild task that works on both the .NET Core command line and in Visual Studio, and then how to bundle that task into a NuGet package so the task can be shared and installed automatically into projects.

Read full post...

Old csproj to new csproj: Visual Studio 2017 upgrade guide

The leaner csproj in VS 2017 can save you hundreds of lines of code. What to cut, keep, and change to upgrade to VS 2017

You may have heard the buzz: .NET Core went from the project.json to csproj file format, and the new csproj format is leaner, easier to read, and adds new features. But what about your .NET Framework VS 2015 (or 2013) project? How can you participate in the VS 2017 goodness? Keep reading: I’ll show you some of the major changes, and how to upgrade to VS 2017.

Read full post...

Part 2 - Caveats of project.json to MSBuild conversion

To convert is to change form, function, or beliefs. There will lots of this.

This upgrade is not only a matter changing JSON vs XML: it’s about learning and using a fundamentally different technology, MSBuild. Regardless of how big or small your .NET Core project is, you are likely to run into some subtle, big, and bewildering changes to how your build system as you convert. Here is a collection of obvious and not-so-obvious caveats to the MSBuild conversion process.

Read full post...

Project.json to MSBuild conversion guide

If you been given the unenviable task of migrating your .NET Core project from ‘project.json’ to MSBuild (csproj), you are likely to find your muscle memory disrupted and the documentation lacking. Automated upgrades in Visual Studio and .NET Core CLI may auto-generate a csproj file for you, but they won’t tell you how to do things you already know how to do in project.json. Here is the most exhaustive list I can create of all the project.json knobs as they exist in Microsoft.NET.Sdk.

Read full post...

.NET Core command-line file watcher (dotnet watch) for MSBuild

Basic usage and pro-tips for using dotnet-watch with MSBuild

The most recent preview (1.0.0-msbuild2-final) of dotnet-watch supports MSBuild projects, and is the most configurable, extensible version of the tool, yet. dotnet-watch is a file watcher for dotnet that restarts the specified application when changes in the source code are detected. This tool has been available since the days of DNX with support for project.json. dotnet-watch for MSBuild adds new features that were not available in the project.json versions.

Read full post...

MSBuild + .NET Core CLI Tools: Getting information about the project

Replacing project.json APIs with an MSBuild target

The .NET Core CLI 1.0.0 has a feature called “project tools extensions”, often called “CLI tools”. These are project-specific, command-line tools that extend the dotnet command with new verbs. For example, users can install Microsoft.DotNet.Watcher.Tools to add the dotnet watch command. This post will cover an advanced topic of how to implement these tools to get information about a user’s project.

Read full post...

NuGet 3: The Runtime ID Graph

If you have ever cracked open* a NuGet package such as .NET Core’s System.IO.Compression, you have may have noticed that the package includes a folder named “runtimes”. What is the folder and how is it used?

Read full post...

Intro to .NET Core: project.json

.NET Core introduces a new project model. A projects is defined by JSON file named “project.json”. This post will examine some of the options available to projects.

Read full post...

Entity Framework 7 and OS X

Back in early July, I recorded a walkthrough with @sethjuarez on using Entity Framework 7 and Visual Studio Code. The video was posted to Channel 9 today.

Read full post...

Hacking ASP.NET 5 and Mono

Tricks to help you develop ASP.NET 5 applications on OS X and Linux

First, it is important understand what happens when you execute dnx. Currently, the command for dnx on Linux and OS X is just a shortcut to this script file. If you inspect this 16-line file, you will see that, in most cases, dnx is just an abbreviation for mono $MONO_OPTIONS "$DIR/dnx.mono.managed.dll" "$@"

Read full post...

See all posts...

Subscribe via RSS