c# - Dynamics CRM code popping up dialog in service -
given following connection code:
var serviceuri = "http://machine.co.za/crm/xrmservices/2011/organization.svc"; var clientcredentials = new clientcredentials { windows = { clientcredential = new system.net.networkcredential("someuser", "somepass", "domain") } }; var organizationserviceproxy = new organizationserviceproxy(new uri(serviceuri), null, clientcredentials, null); // line of code pops dialog? var user = (whoamiresponse)organizationserviceproxy.execute(new whoamirequest()); if (user.userid == guid.empty) throw new invalidoperationexception(string.format(@"connection {0} cannot established.", crmconnection.serviceuri)); user.dump();
if supplied password incorrect, code pops credentials dialog. since service not have rights interact desktop, service halts cannot show dialog.
how suppress dialog, , have exception thrown instead. using dynamics 2011.
i going take given crm dynamics organizationserviceproxy
hardwired pop dialog.
there no configuration options or flags turn behavior off.
Comments
Post a Comment