Questions tagged [system.web.http]

18 questions
14
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
  • 1,113
  • 2
  • 13
  • 33
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:…
6
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,941
  • 26
  • 98
  • 191
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
  • 268
  • 5
  • 16
1
vote
0 answers

Found conflicts between different versions of "System.Web.Http" that could not be resolved

I have opened an old project in visual studio 2022 (before I used vs 2017), When I build I get several light warnings, but this may affect the correct operation this is the warning: Found conflicts between different versions of "System.Web.Http"…
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
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…
shuberman
  • 1,416
  • 6
  • 21
  • 38
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
  • 3,730
  • 9
  • 43
  • 94
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
  • 1,273
  • 3
  • 16
  • 41
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
  • 784
  • 1
  • 12
  • 30
0
votes
0 answers

How does 'System.Web.Http' Compiles in .NET 7 Blazor server Application

System.Web.Http DLL compiles in .NET 7 application. I have Used RoutePrefixAttribute class in .NET 7 App and the solution compiled successfully, There is no warnings in the Dependencies section. Couldn't find any proper explanation of how that dll…
Naveen
  • 127
  • 1
  • 10
0
votes
1 answer

"Using System.Web.Http" is not supported in .NET Core 6 Class Library. What is the alternative?

One of my our application uses System.Web.Http to support ExceptionHandler in ASP.NET 4.x for the existing code. Currently I am migrating all the class library to .Net 6 Class library. However, System.Web.Http nuget package is not available for .NET…
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
  • 390
  • 5
  • 19
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,799
  • 9
  • 43
  • 93
1
2