Questions tagged [system.web.http]

15 questions
9
votes
1 answer

System.Web.Http missing in .net Core 2.1

System.Web.Http is missing in my .net core 2.1 project. the error states Error CS0234 The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) please refer the image for more clarity
Sanjeev S
  • 913
  • 1
  • 12
  • 26
7
votes
1 answer

System.Web.Http methods missing in Nunit test project

I am writing some unit test for an ApiController. I continue to get multiple System.MissingMethodException exceptions for methods in the System.Web.Http namespace. Message: System.MissingMethodException : Method not found:…
4
votes
3 answers

Namespace System.Web.Http.Results not found within asp.net web api application

I have an asp.net web api application in which I have this line : using System.Web.Http.Results; My problem is that the namespace isn't recognized, I verified the dll system.Web.Http exists in the bin folder !! So I need to know: What is the…
Lamloumi Afif
  • 8,129
  • 23
  • 79
  • 175
2
votes
0 answers

Could not load file or assembly System.Web.Cors, Version=5.2.3.0 after downloading code from git onto new machine

I have been given an updated laptop at work and have checked in everything then pulled down to my new machine.. having then spent virtually the whole day sorting out all the Nuget references and reinstalling packages etc... I am now getting the…
dreadeddev
  • 238
  • 5
  • 14
1
vote
1 answer

C# Model binding complex property

In my REST API, my model binding is not mapping a property that is a list of objects. It correctly gets to the controller, and shows all the properties but they are empty. E.g. for the POST request {age: 202, setting: ["school"]} I get something…
bitwise
  • 13
  • 4
1
vote
2 answers

Remove Authorize rule for specific API call

I have a WEB Api controller, that has the [Authorize] tag at the top of the controller - which means all API in this class will have this rule applied. Like this: [Authorize] [RoutePrefix("api/v1/route")] public class ItemController…
Alex
  • 2,974
  • 3
  • 30
  • 70
1
vote
1 answer

Returning Error Code from Controller with System.Web.Http

I have a very light weight REST API that I wrote that validates a user. I want to return the validation as a JSON object, which I can, but if there are missing arguments, I want to kick back an error with some information. Here is my controller …
john
  • 839
  • 10
  • 27
1
vote
3 answers

Http triggers in azure functions - serializing objects in camelcase

I have created an HttpTriggered azure function that returns a response in capital case. How do I convert it to camel case? return feedItems != null ? req.CreateResponse(HttpStatusCode.OK, feedItems :…
horatius
  • 594
  • 4
  • 27
0
votes
0 answers

Unable to add reference : System.Web.Http 4.0.0

What I am trying to do: Upon building my solution for the first time, I see errors related to missing namespaces. They have a code of CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an…
mishsx
  • 1,153
  • 4
  • 15
  • 29
0
votes
1 answer

after adding Telegram.Bot From nuget, MVC fails on compile

i'm using vs2012 and created a MVC4 project i'm going to implement a webhook for telegram bot. but after i added Telegram Bot Api from nuget, my projects not compiles fully and throws an exception like below: Attempt by method…
0
votes
2 answers

Facing "Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, ' or one of its dependencies."

I am trying to deploy a MVC Web API solution on the server. The server has Windows 2012 R2 operating system. This is MVC 4 based Web API solution. The server has .Net 4.0 framework installed. Except this server machine the solution has been deployed…
Binoy
  • 188
  • 15
0
votes
1 answer

The type or namespace name 'Dependencies' does not exist in the namespace 'System.Web.Http'

I updated my project from .NET4 -> .NET461 and it builds without any errors on my local machine. However, when I push it and start team city build, then it crashes with the error from this question's topic. Team city machine is also equipped with…
Marek M.
  • 3,737
  • 7
  • 36
  • 76
0
votes
1 answer

No HTTP resource was found that matches the request URI, No type was found that matches the controller

When i am hitting the url: http://localhost/api/adxxx/getDeals/?input=2 I get the following error: "Message": "No HTTP resource was found that matches the request URI 'http://localhost/api/adxxx/getDeals/?input=2'.", "MessageDetail": "No type was…
0
votes
1 answer

MEF - wrong assembly version

I have a web app that uses MEF, Webapi and OData. For MEF I created a helper class that loads the catalog on demand (at first access) The following is MEF integration code. Public Shared ReadOnly Property Catalog As AggregateCatalog Get …
-1
votes
2 answers

HttpConfiguration from System.Web.Http in .NET 5 project

Update: Complete code example: public class DelegatingHandlerStub : DelegatingHandler { private readonly Func> _handlerFunc; public DelegatingHandlerStub() { …
Ogglas
  • 38,157
  • 20
  • 203
  • 266