I am currently working on a Management Pack for System Center Operations Manager (aka SCOM). I am using the System Center 2012 Visual Studio Authoring Extensions and during build of my project I suddenly got the following error: “MSB4018: The “MergeFragments” task failed unexpectedly“:

Visual Studio | System Center 2012 Visual Studio Authoring Extensions | C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(234,5) | error MSB4018: The "MergeFragments" task failed unexpectedly.

I searched on this error message but wasn’t able to find anything helpful. In order to get more detailed output from MSBuild I changed the MSBuild project build output verbosity. To do this go to the Tools menu in Visual Studio and select Options. Navigate to the “Build and Run” node under “Projects and Solutions” and set both options to “Diagnostic”:

Visual Studio | Tools | Options | Projects and Solutions | Build and Run | MSBuild project build output verbosity | Diagnostic

That gave a more detailed output in the Build window where I noticed that two References had the same Alias:

Build Output | Duplicate Reference

I then changed the Alias for one of those References in the Solution Explorer:

Visual Studio | Solution Explorer | References | Alias

That solved the error!