I use the same code that I use in a Windows application to get the credentials for our portal. When I use the code in a .DLL I get a System.Net.WebException and the connection is refused. This just started happening and was functioning before. I haven't made any code changes to the connection for the portal. I will paste below.
Does anyone have any ideas? This library is used in a plugin for AutoCAD and hasn't had any issues till this last week. I started a brand new project and I am getting the same error.
The connection is as follows.
var cred = await Esri.ArcGISRuntime.Security.AuthenticationManager.Current.GenerateCredentialAsync(
new Uri("https://ourportal/arcgis/sharing/rest"),
"xyz",
"xyz") as ArcGISTokenCredential;
I thought I might be missing a reference but it looks okay in my config.
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Esri.ArcGISRuntime" version="100.8.0" targetFramework="net472" />
<package id="Esri.ArcGISRuntime.WPF" version="100.8.0" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net472" />
</packages>
Is there any setting that I am missing or that it might of gotten changed to now get the connection refused from our portal? This same code works in applications that are built as stand alone applications.