1

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 assembly reference?)

What I have tried so far and didn't work for me:

System.Web.Http missing after .net 4.5 upgrade

System.Net.Http: missing from namespace? (using .net 4.5)

Can't add a reference to my project - it simply doesn't detect it

What I am trying to do from my own end but doesn't seem to work:

On Nuget's official website I am trying to install this package using Package manager command:

 PM> Install-Package System.Web.Http -Version 4.0.0

But, I see the following error on the console

enter image description here

What I want from you:

At this point, the only way to resolve this issue is by reaching out to one of my other team members and ask them to send me the missing .dll.But I would encourage an answer that would help me get through this issue by pointing to the root cause of this problem and if there is an alternate way to get this missing reference.

Useful note:

I am building this solution on Visual Studio 2019 and the solution points to .net framework version 4. I have come across answers that suggest changing the framework version to 4.5. But even after that I could not find the .dll in References(Yes, I have checked extensions and framework)

shuberman
  • 1,416
  • 6
  • 21
  • 38
  • 1
    I'm not sure, but it looks like this package is deprecated, and from the error, this namespace does not exist on it. Have you checked this answer? : https://stackoverflow.com/questions/55567384/system-web-http-missing-in-net-core-2-1 – Albert Nov 29 '19 at 13:09
  • That can't be since the same solution works on my coworker's machines. – shuberman Nov 29 '19 at 13:10
  • 1
    @Albert Also that link talks about a version 2.1 whereas we are dealing with framework 4 and 4.5 here which has System.Web.Http – shuberman Nov 29 '19 at 13:12
  • It says on the NuGet link you sent that this is not the official Web API package, could it be related to that? If so, I'd think it could be some sort of namespace conflict. – Albert Nov 29 '19 at 13:18
  • 1
    Even if that is the case then why wouldn't it install tho? Because I am using the console to do that and it gives me an error message from what I have attached on the screenshot. As for official. I believe `Nuget` is open source so probably for Microsoft it is not official. That's what I make out of that. Nevertheless, Official or not, at least it should install right? – shuberman Nov 29 '19 at 14:00

0 Answers0