1

I have installed WCF Web API Preview 5 using NuGet Visual Studio extension (WebApi.All). I am trying to implement some simple examples on the internet, but it seems like they have different Assemblies to the ones I installed. For example, I cannot get HttpHostConfiguration, DelegatingChannel, HttpMessageChannel, etc.

I have made sure my target framework is set to ".NET Framework 4". Am I missing something, or has anyone else experienced a similar issue. Btw, my project is an MVC3 project.

Thanks for your help.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171
Karis Sr.
  • 171
  • 2
  • 12

2 Answers2

3

It sounds like the sample code you are trying to use is from preview 4 or before. A number of breaking changes where made in preview 5.

To get the Http server configuration you can use the GetDefaultHttpConfiguration() extension method on the RouteCollection. The DelegatingChannel has been renamed to DelegatingHandler.

See the release notes here or this blog post from Howard Dierking for more info.

Maurice
  • 27,582
  • 5
  • 49
  • 62
  • You're right Maurice. I ended up removing all the binaries that were installed by NuGet, and used the ones in Preview 5 from wcf.codeplex.com . Thanks for the answer. – Karis Sr. Oct 12 '11 at 09:51
  • 1
    Using NuGet you should get the 0.5 bits right now. See [here](http://nuget.org/List/Packages/WebApi.All) – Maurice Oct 12 '11 at 11:38
0

You need to add a reference to the dll that contains those classes. They are probably not referenced by default in a MVC3 project.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252