We encountered an issue while attempting to convert the .cs file to the .NET 6 framework. When we tried to upgrade the .NET framework, it resulted in the removal of assemblies from the project, and the namespace "System.activity" is causing an error.
Could you kindly assist us in converting the attached .cs file to the .NET 6 framework?
I disabled the SSL verification, but still it is giving error, please help.
using System;using System.Collections.Generic;using System.Net;using System.Net.Http;using System.Net.Security;using System.Security.Cryptography.X509Certificates;using System.Threading.Tasks;using System.Activities;using System.ComponentModel;namespace starterpackage.FirstActivityBuild{ public class AuthToken : CodeActivity { [Category("Input")] [RequiredArgument] public InArgument<string> Endpoint { get; set; } [Category("Input")] [RequiredArgument] public InArgument<string> Username { get; set; } [Category("Input")] [RequiredArgument] public InArgument<string> Password { get; set; } [Category("Output")] public OutArgument<string> ResponseStatus { get; set; } [Category("Output")] public OutArgument<string> ResponseContent { get; set; } protected override void Execute(CodeActivityContext context) { string apiUrl = Endpoint.Get(context); string userId = Username.Get(context); string password = Password.Get(context); // Disable SSL certificate validation ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; using (HttpClient client = new HttpClient()) { // Construct the request parameters var requestContent = new FormUrlEncodedContent(new[] { new KeyValuePair<string, string>("userid", userId), new KeyValuePair<string, string>("password", password) }); // Make the GET request HttpResponseMessage response = client.GetAsync(apiUrl +"?" + requestContent.ReadAsStringAsync().Result).Result; // Get the response status string responseStatus = response.StatusCode.ToString(); ResponseStatus.Set(context, responseStatus); // Get the response content string responseContent = response.Content.ReadAsStringAsync().Result; ResponseContent.Set(context, responseContent); } } }}
Thank you.
I disabled the SSL verification, but still it is giving error, please help.