Thursday, February 20, 2014

Solving System.Web.Http.GlobalConfiguration' does not contain a definition for 'Configure

When upgrading your fantastic Asp.Net Web Api projects to version 2.0, you might come across this wonderful error -

System.Web.Http.GlobalConfiguration' does not contain a definition for 'Configure 
on this line of code -
GlobalConfiguration.Configure(WebApiConfig.Register);

The solution is quick and simple.

1. Open the Package Manager Console for the project with the error.
2. Type in Install-Package Microsoft.AspNet.WebApi.WebHost and hit Enter
3. Rebuild your project and all should be right with the world (or at least right with your project)


Smooches,
Kila



5 comments:

Anonymous said...

Thank you Kila, this solved my problem.

I am not sure about nu-get though, this whole scenario causes more problems than it fixes....

Unknown said...

Smooches back at ya, worked great, thanks.

algaly said...

Thanks!
This actually solved it!
Avi (algaly@gmail.com)

Anonymous said...

Thank you !

Anonymous said...

Slot Machines | Casino Site - Choegocasino
‎Slots · ‎Table Games · ‎Slot Machine 카지노 Games at 1xbet korean Choegocasino · ‎Table Games · ‎Dice Games 인카지노