Code: Select all
client.CredentialsMode = System.Net.CredentialsMode.Enabled;
Error CS0433 The type 'System.Net.CredentialsMode' exists in both 'CSharpXamlForHtml5.System.dll, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null' and 'CSharpXamlForHtml5, Version=126.96.36.199, Culture=neutral, PublicKeyToken=null'
So, I managed to work around this by creating a new CSHTML5 class library, and changing the alias of "CSharpXamlForHtml5.System.dll" from "global" to "sys", and then creating a new subclass of the WebClientWithCredentials class, which I called "WebClientWithAuth". Since I changed the alias of the System.dll, I was able to hard-code the CredentialsMode to Enabled, see the following sample: