I just registered for an online 365 trial version.
I copy-pasted the Walkthrough sample code appearing here, and changed the Url, Username and Password values inside the App.config, so that they have the relevant values.
However, I get an exception when calling xrm.SaveChanges()
:
Content of exception:
An unhandled exception of type 'Microsoft.Xrm.Sdk.SaveChangesException' occurred in Microsoft.Xrm.Sdk.dll
Content of Message:
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
Content of Inner Exception:
Code: {System.ServiceModel.FaultCode}, Message: Invalid Request
Stack trace:
at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges(SaveChangesOptions options)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.SaveChanges()
at CRMSimpleConsole1.Program.Main(String[] args) in C:\Users\home\documents\visual studio 2015\Projects\CRMSimpleConsole1\CRMSimpleConsole1\Program.cs:line 32
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart() I also get an exception when calling xrm.Create(): An unhandled exception of type 'System.ServiceModel.Security.MessageSecurityException' occurred in mscorlib.dll
Note that the same happens for any call to the service (e.g., xrm.Create()
.
I searched for this on the web, and people say it is caused because of wrong time sync. Well, at least in the CRM Settings area, the time zone is correct, so I don't what to do.