
Hi all,
I'm fairly new to Azure and CRM and after completing a working connection to CRM on my local site, I've stumbled across this error when I moved to it to my Azure site. Please can you help me find where the issue lies? I'm thinking it could be a configuration problem or an actual problem with the CRM connection when not working locally:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.] umbraco.test.Page_Load(Object sender, EventArgs e) in ...my file path... System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Control.LoadRecursive() +145 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
The error highlights line 43:
Line 43: Guid userid = ((WhoAmIResponse)_service.Execute(new WhoAmIRequest())).UserId;
Line 44: if (userid != Guid.Empty)
Line 45: {
...I've also picked out this:
OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);
serviceProxy.EnableProxyTypes();
_service = (IOrganizationService)serviceProxy;
I would really appreciate advise on this. I haven't included the full code as I'm not 100% sure it is down to the code since it works locally.
Source Error:
*This post is locked for comments
I have the same question (0)I had a missing assembly reference. I needed Microsoft.IdentityModel even though I didn't use it in the local version.