Essay record
C#: The type or namespace name 'StringContent' could not be found
- Record
- Essay / / 1 min read / 66 words
On this page2 sections / +
DISCLOSURE: Some links may be affiliate links. Details
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;