I'm creating an asp.net core app using Visual Studio 2017. I'm trying to encode a URL component using web utility.
var value = System.Net.WebUtility.UrlEncode("some text here");
When I include that in my code, I see the below error. I'm at a loss as to finding the issue. I see no project.json file. I have searched for anyplace where System.Runtime.Extensions are being included.
I have the following packages installed: AspNetCore, AspNetCore.Mvc, AspNetCore.StaticFiles, .netCore.App, PaulMiami.AspNetCore.Mvc.Recaptcha
I have tried to remove the captcha package without it fixing the issue.
Error CS0433 The type 'WebUtility' exists in both 'System.Runtime.Extensions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Other posts I've seen about this issue ask for a project.json file, which I don't seem to have. Any thoughts?
Update 1: I tried to create a new asp.net core web app - all defaults out of the box, I then installed the PaulMiami.AspNetCore.Mvc.Recaptcha package, the call to WebUtility works fine in the newly created app. There must be something I'm not finding in the existing application that is causing this issue.