DefaultNetworkCredentials don't work in release RRS feed

  • Question

  • Hi all,

    I have an ASP.NET web site that connects to CRM with default credentials. When application run in debug IT'S ALL OK. If I publish the web site into IIS to my localhost  I have an error when I try to use OrganizationServiceProxy.

    This is the code:

    ClientCredentials creds = new ClientCredentials();
    creds.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
    string organizationUri = "myUri";
    string _url = organizationUri + "/XRMServices/2011/Organization.svc";
    Uri _uri = new Uri(_url);
    OrganizationServiceProxy _serviceProxy = new OrganizationServiceProxy(_uri, _uri, creds, creds);
    _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    WhoAmIRequest _request = new WhoAmIRequest();
    WhoAmIResponse _response = serviceProxy.Execute(_request) as WhoAmIResponse;

    Anyone have an idea?

    IIS Configuration? 


    Tuesday, September 24, 2013 12:45 PM


  • When the website is published in IIS, the default credentials will be the identity of the application pool that your application runs under. This will need to be a CRM user.

    (When you run the application in debug mode, it will use your credentials)

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Marked as answer by Samuel7CRM2011 Friday, October 11, 2013 10:01 AM
    Tuesday, September 24, 2013 2:45 PM