The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Adding the WCF Web API to a project

Warning: This post is based on a prerelease version of the WCF Web API

 

In my previous blog post I showed how to get started with the new WCF Web API but one thing I skipped is how to install and add it to your project first. So in post I am going to add that information.

 

The easiest way to get started is to use NuGet and add the WCF Web API package to your project. There are several different packages for the WCF Web API but  the one named WebApi.All is the easiest to get started with as it contains all relevant assemblies.

 

image

However when I try to add the package to a simple console application I get the following less than useful error message when the installation fails.

Install failed. Rolling back...
Error HRESULT E_FAIL has been returned from a call to a COM component.

 

image

 

The reason is that the WCF Web API tries to add a reference to some assemblies that are not available in the .NET 4 Client Profile so make sure to switch this to the full .NET 4 Framework and adding the package will work.

image

 

Fortunately this problem won’t occur when you use an ASP.NET project to add the package reference as they default to the full .NET Framework in the first place.

 

Enjoy!

 

www.TheProblemSolver.nl
www.dotnetevents.nl

Published Wed, Jun 1 2011 14:34 by Maurice

Comments

# Using the WCF Web API in an ASP.NET MVC application@ Monday, June 13, 2011 10:53 AM

Warning: This post is based on a prerelease version of the WCF Web API   In my previous blog post

# Using the WCF Web API in an ASP.NET MVC application@ Monday, June 13, 2011 10:55 AM

Warning: This post is based on a prerelease version of the WCF Web API   In my previous blog post

# re: Adding the WCF Web API to a project@ Wednesday, June 15, 2011 3:43 PM

Thanks a nice clear explanation and solution to a unhelpful error message.

by Graham