I am on Windows 8 and I am using ASP.NET MVC4 - specifically the ApiControllers.
So the MVC4 web pages are showing up - but I try to get to the APIs, I get the error message "Method not found Net.Http.HttpHeaders.AddWitoutValidation". Again, I am on Windows 8, and I have tried on IIS 8, IIS 7.5 Express. I see the method defined in the
System.Net.Http assembly that's part of the nuget package which is in the bin directory of the application.
I have spend a lot of time on this - if anyone could shed some light into a solution-that would be great. Thanks
Unfortunately when running on any machine that has .NET 4.5 installed (this includes Windows 8 machines) you need to use the version of Web API that is compatible with the version of .NET that you have isntalled. This means that a Windows 8 Consumer Preview
installation only supports Web API Beta and you cannot use any of the Web API nightly builds. If you want to use the latest builds of Web API you will have to deploy them onto a machine that does not have .NET 4.5.
The problem is that when you install 4.5 the framework will redirect System.Net.Http to the new RTM version. This doesn't have
HttpHeaders.AddWitoutValidation.
If you need to use the older version of WebAPI (we have a product about to RTM an don't want to re-QA everything). There is a fairly simple workaround. Which is to add you own redirect to ensure that the assembly resolution finds your version
of the dll and not the new framework version.
Add an app.settings (if you are self hosting) or add to your web.config (if you are hosting in IIS).
The problem is that when you install 4.5 the framework will redirect System.Net.Http to the new RTM version. This doesn't have
HttpHeaders.AddWitoutValidation.
If you need to use the older version of WebAPI (we have a product about to RTM an don't want to re-QA everything). There is a fairly simple workaround. Which is to add you own redirect to ensure that the assembly resolution finds your version
of the dll and not the new framework version.
Add an app.settings (if you are self hosting) or add to your web.config (if you are hosting in IIS).
splusq
0 Points
1 Post
Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
May 28, 2012 08:22 AM|LINK
I am on Windows 8 and I am using ASP.NET MVC4 - specifically the ApiControllers.
So the MVC4 web pages are showing up - but I try to get to the APIs, I get the error message "Method not found Net.Http.HttpHeaders.AddWitoutValidation". Again, I am on Windows 8, and I have tried on IIS 8, IIS 7.5 Express. I see the method defined in the System.Net.Http assembly that's part of the nuget package which is in the bin directory of the application.
I have spend a lot of time on this - if anyone could shed some light into a solution-that would be great. Thanks
Salman
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
May 31, 2012 01:47 AM|LINK
I'm sorry you are running into issues.
Unfortunately when running on any machine that has .NET 4.5 installed (this includes Windows 8 machines) you need to use the version of Web API that is compatible with the version of .NET that you have isntalled. This means that a Windows 8 Consumer Preview installation only supports Web API Beta and you cannot use any of the Web API nightly builds. If you want to use the latest builds of Web API you will have to deploy them onto a machine that does not have .NET 4.5.
Hope this helps.
ASP.NET Team
@marcind
Blog
aliostad
Member
228 Points
55 Posts
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
May 31, 2012 12:37 PM|LINK
This question deals with this very issue:
http://forums.asp.net/p/1797823/4955368.aspx/1?Web+API+Project+from+latest+builds+
anton.samars...
Member
2 Points
1 Post
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Jun 01, 2012 09:58 AM|LINK
Are you going to publish new version of WebApi soon?
alvipeo
Member
12 Points
22 Posts
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Jun 01, 2012 10:07 AM|LINK
I'm having the issue with HttpResponseMessage<T> on RC - it's not in System.Net.Http and I don't know if it exists in RC. Does anyone know?
Or is it something that was removed from web api RC completely?
aliostad
Member
228 Points
55 Posts
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Jun 01, 2012 11:22 AM|LINK
HttpResponseMessage<T>is no more. The problem was that it was not possible to guarantee the generic type remaining the same through the pipeline.
http://aspnetwebstack.codeplex.com/discussions/350492
RameshRajend...
Star
7983 Points
2099 Posts
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Jun 01, 2012 11:28 AM|LINK
Hai
http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Net/WebHeaderCollection.html
thank u
andypook
Member
2 Points
1 Post
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Aug 24, 2012 09:18 AM|LINK
The problem is that when you install 4.5 the framework will redirect System.Net.Http to the new RTM version. This doesn't have HttpHeaders.AddWitoutValidation.
If you need to use the older version of WebAPI (we have a product about to RTM an don't want to re-QA everything). There is a fairly simple workaround. Which is to add you own redirect to ensure that the assembly resolution finds your version of the dll and not the new framework version.
Add an app.settings (if you are self hosting) or add to your web.config (if you are hosting in IIS).
See http://andypook.blogspot.co.uk/2012/08/webapi-addwithoutvalidation-method-not.html
chaoren
Member
11 Points
36 Posts
Re: Method not found: 'Void System.Net.Http.Headers.HttpHeaders.AddWithoutValidation
Nov 23, 2012 08:49 AM|LINK
Thanks that worked