C#: The type or namespace name 'StringContent' could not be found

2020.12.20 | 64 words |

Overview

I’m building a web app in C# on .NET Core and I’m running into an issue when trying to use StringContent. The error:

error CS0246: The type or namespace name 'StringContent' could not be found

Solution

Typically errors like this mean you’re missing an import. I was able to fix this by adding this import to the top of my file:

using System.Net.Http;

 

About the Ham

Hi I'm Hamilton - I built this! If you want more content like this subscribe to my email list, connect with me around the web, or take a look at some of my other projects.

More Projects

comments powered by Disqus