This project is read-only.

Failed to add reference to 'System.ServiceModel.Activation'. Please make sure that it is in the Global Assembly Cache.

Topics: Web Api
Nov 16, 2011 at 5:04 PM

I am trying to write a quickie test client for the WCF Web API REST "Getting Started: Building a simple Web API" ( ) project/service because while this test client thingie used to test the 'simple web api' is great and all, I need to get my head around writing my own actual REST service client.  So, I'm trying to install the WebAPI.all NuGet package into the client project so that I can use HttpClient and I'm getting the following in the NuGet dialog; 

Install failed. Rolling back...
Failed to add reference to 'System.ServiceModel.Activation'. Please make sure that it is in the Global Assembly Cache.

What I don't understand is, I've installed this package at least once, but probably a couple of times and never had this issue.

Anyone have any ideas as to what's REALLY going on here?


Cmdr. B.  ;) 

Nov 16, 2011 at 9:03 PM

Here is what the GACUtil app tells me;

C:\Program Files (x86)\Microsoft...10.0\VC>gacutil.exe /l System.ServiceModel.Activation

Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.1 Copyright (c) Microsoft Corporation.  All rights reserved.
The Global Assembly Cache contains the following assemblies:  System.ServiceModel.Activation, Version=, Culture=neutral, PublicKeyTok en=31bf3856ad364e35, processorArchitecture=MSIL
Number of items = 1

The error I get when trying to install the WebAPI.all NuGet package;

Install failed. Rolling back...
Failed to add reference to 'System.ServiceModel.Activation'. Please make sure that it is in the Global Assembly Cache.

No version information is presented, thus I can't compare what's in my GAC to what the NuGet package wants/expects.



Nov 16, 2011 at 9:12 PM

Oops!!  Apparently if you're trying to install the Web API's webapi.all NuGet package into a console app, you MUST make sure it's not set to use the 'client profile.'  </Blush>