Hi,
I'm facing the below error while connecting to the Org service of my Dynamics 365 Online Trial. I've gone through some of the solutions provided(e.g. updating to new SDK version etc), but none have helped, so posting this query here.
An exception of type 'System.InvalidOperationException' occurred in CRM Test Solution.dll but was not handled in user code
Metadata contains a reference that cannot be resolved: 'opsoftdec.api.crm8.dynamics.com/.../Organization.svc;sdkversion=8.2'.
The program '[2388] iisexpress.exe' has exited with code -1 (0xffffffff).
Following is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Xrm.Sdk;
using System.ServiceModel.Description;
using Microsoft.Xrm.Sdk.Client;
using System.Net;
using Microsoft.Xrm.Sdk.Query;
namespace CRM_Test_Solution
{
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
string _username = "username";
string _password = "password";
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = _username;
credentials.UserName.Password = _password;
credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials;
Uri organisationUri = new Uri("opsoftdec.api.crm8.dynamics.com/.../Organization.svc");
Uri homeRealmUri = null;
OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(organisationUri, homeRealmUri, credentials, null);
IOrganizationService service = serviceProxy;
}
catch (Exception ex)
{
throw ex;
}
}
*This post is locked for comments