Code: Select all
client.CredentialsMode = System.Net.CredentialsMode.Enabled;
Error CS0433 The type 'System.Net.CredentialsMode' exists in both 'CSharpXamlForHtml5.System.dll, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null' and 'CSharpXamlForHtml5, Version=220.127.116.11, 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: