Archive for July, 2015

‘Xrm’ does not exist in namespace ‘Microsoft’ – Build error while referring CRM 2015 SDK Dll’s

I got below annoying build error while adding early binding class to my Plug-in Project and build.

XRM does not exist in namespace

XRM does not exist in namespace

It was bit strange as I already referred ‘Microsoft.XRM.SDK.dll’ from CRM 2015 SDK.

Reason :

  • CRM 2015 SDK has built on .Net 4.5.2 Framework and my Visual studio does not support 4.5.2


Application Target Framework

Application Target Framework


Connecting to CRM from other applications using CrmConnection class – CRM 2015

Assume that you have an ASP.Net web application and you want to retrieve Contacts from CRM and display in a grid.

Before CRM 2015, to establish a connection with CRM we need to create a service proxy with user credentials (Refer article).

With CRM 2015, we can use “Connection Strings” to connect to the CRM server from external application.

You define the CRM connection strings in <web.config> or <app.config> as below



    <!– Online using Office 365 –>

<!– <add name=”Server=CRM Online, organization=contoso, user=someone” connectionString=”Url=;; Password=password;”/> –>

    <!– Online using Microsoft account (formerly Windows Live ID) –>

<!– <add name=”Server=CRM Online, organization=contoso,” connectionString=”Url=;; Password=password; DeviceID= DevicePassword= “/>–>

    <!– On-premises with provided user credentials –>

<!– <add name=”Server=myserver, organization=AdventureWorksCycle, user=administrator” connectionString=”Url=http://myserver/AdventureWorksCycle; Domain=mydomain; Username=administrator; Password=password;”/> –>

    <!– On-premises using Windows integrated security –>

<!–<add name=”Server=myserver, organization=AdventureWorksCycle” connectionString=”Url=http://myserver/AdventureWorksCycle;”/>–>

    <!– On-premises (IFD) with claims –>

<!–<add name=”, organization=contoso,” connectionString=”Url=;; Password=password;”/>–>



And you can establish connection in your code as below

// ‘CRMOnline’ is ConnectionString name defined in <web.config> or <app.config>

var connection = new CrmConnection(“CRMOnline”);

var service = new OrganizationService(connection);

var context = new CrmOrganizationServiceContext(connection);

Refer MSDN article for more details


Categories: CRM 2015 Tags: ,