Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

DefaultNetworkCredentials don't work in release

$
0
0

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? 

Thanks


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>