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



4 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....

Jim Long said...

Smooches back at ya, worked great, thanks.

algaly said...

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

kongponleu88 said...


Thank you for sharing valuable information. Nice post. I enjoyed reading this post.
โกเด้นสล็อต