title: Retrieve Credentials from Windows generic Credentials Store using C# in ASP.net website under IIS
body: <p>Retrieve Credentials from Windows Credentials Store problem using C# in ASP.net website under IIS I am using following code</p>
  
  <p>Local machine and windows 10 IIS its working fine. but when i try to hosting in windows server 2012 R2 not working.
  My code:</p>
  
  <pre><code>    var cm = new Credential();
  cm.Target = "targetname";
  cm.Type = CredentialType.Generic;
  if (!cm.Exists())
  {
      Console.WriteLine("cm is null");
  }
  cm.Load();
  Console.WriteLine(cm.Password);
  Console.WriteLine(cm.Username);
  </code></pre>
  
  <p>Above code running on windows server 2012 R under IIS. But above code is not able to retrieve username and password.(cm is null always) I used same code in my console application and works fine. Please let me know any special instruction need to follow.</p>