I am trying to execute the below code to retrieve details from Sharepoint using C#. It is giving error:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.'
using (ClientContext spcontext = new ClientContext("siteURL"))
{
spcontext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;
spcontext.FormsAuthenticationLoginInfo = new FormsAuthenticationLoginInfo("UserName","Password");
spcontext.Load(spcontext.Web, w => w.Title, w => w.ServerRelativeUrl, w => w.Lists);
spcontext.ExecuteQuery();
Console.WriteLine(spcontext.Web.ServerRelativeUrl);
}
My application is ASP.NET Core 3.1.