16 July 2011

CRM 2011 Plugin Development Workspace

2 years ago, I wrote an article about Build a handy Dynamics CRM development environment, which has been widely used in the community. I have also provided several CRM 4.0 and 2011 development training courses for .Net developers in the past few years, the result and feedback were very good.

Now the Microsoft Dynamics CRM 2011 has been released, I'd like to guide you through an efficient development workspace for CRM 2011. The overall develop/build/debug process should be very smooth, see the following diagram:


First of all, the CRM 2011 only support 64bits server, so if you are using Windows 7, I suggest you to use the Oracle VM VirtualBox to install CRM 2011 server. My experience is the VirtualBox does everything you need for the development purpose, quicker and smaller, and also it supports 64bits Guest OS (even with a 32bits Host OS).

The minimum RAM required to run CRM 2011 (all-in-one box) is 3GB (recommend 4GB); It's also possible to install the SharePoint foundation 2010 on the same box if you have SharePoint document integration.

About the Host PC, the minimum RAM required is 4GB, it's good to have 8GB RAM (all with 64bits Windows 7); install Visual Studio 2010 on the Host PC for better performance, then you can set up the Visual Studio 2010 Remote Debugger (x64) on the Guest OS that has CRM 2011 server installed (refer this article about how to Build a handy Dynamics CRM development environment).

Next, after you developed a CRM plugin in Visual Studio 2010, you may register it using the Plugin Registration Tool (can be found in the CRM 2011 SDK). Make sure you register the DLL in the Disk (during development/testing phase); Also change the project properties in Visual Studio 2010: change the Build | Output path to the CRM server assembly folder, i.e.:
\\CRM\c$\Program Files\Microsoft Dynamics CRM\Server\bin\assembly\

So each time you build the project, the new DLL and PDB file will be output to the assembly folder, CRM will pickup the new plugin DLL automatically without manually re-registering it.

If you get the error message when rebuild the project in Visual Studio: "Unable to copy file ... because it is being used by another process...", you may add the "Pre-build event command line" to recycle the CRMAppPool or restart the Service of the CRM server (See: Build a handy Dynamics CRM development environment).

If you use PowerShell to do so, you need to change the Host PC's Execution Policy to Unrestricted and RemoteSigned.

On a 64bits Host PC, use the below command to start PowerShell,
%SystemRoot%\sysWOW64\WindowsPowerShell\v1.0\powershell.exe

Then execute the following command:
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy RemoteSigned

(Note, the 32bits PowerShell command line is in another folder:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe )

To debug a plugin, make sure you attach the right process:

  • online - w3wp.exe
  • offline - Microsoft.Crm.Application.Hoster.exe
  • asynchronous registered plug-ins (or custom workflow assemblies) - CrmAsyncService.exe
  • sandbox (isolation mode) - Microsoft.Crm.Sandbox.WorkerProcess.exe

Hope it helps!
:)


18 comments:

Anonymous said...

Good blog created of Microsoft crm 2011...
Business Courses

olbifi said...

Hello Jim, thanks for the information.
Even if you don't need a 64-bit Host OS, you have to have a 64-bit CPU for running CRM 2011 in a Virtual Box?! Is that true?

Jim Wang said...

Yes, CRM 2011 has to run in a 64bits server.

Sanjay Munjal said...

From your experience, would you recommend, installing VS2010 in the VM so that you can reuse and debug easily?

Jim Wang said...

Hi Sanjay,

I don't recommend to install VS2010 on the VM; Always use it on the host, then debug using remote debuger - for better performance.

gaurav said...

This is a superb information and you have described everything very clearly and really i got a lot from this article, Thanks for spreading this information here.
logo design perth

durga said...

Thank you for the info. It sounds pretty user friendly. I guess I’ll pick one up for fun. thank u.


How to Register a Business

peterjamens said...

This sounds to be the great post on microsoft dynamics crm 2011. Thanks for posting it.

http://www.aadseducation.com/new/microsoft-dynamics.html

Unknown said...

nice post wang,This is more useful information for all the people using CRM,i found more information at Microsoft Dynamics CRM

Unknown said...

Nice article and Information is useful. it will be useful for the people who are using mobile CRM. Karya also provide the MS dynamics CRM on mobile to access your info from your iphone, ipad and android.

Unknown said...

Hey there........thanks a lot for updating me on CRM 2011 Plugin Development Workspace. This is really a handy information for me which I am going to use. Thanks again.... 
CRM Development

Unknown said...
This comment has been removed by the author.
Unknown said...

So lovely post this is i like it so much i have tries this tutorial and it is working properly thank you so much for this.c online inventory software

Unknown said...
This comment has been removed by the author.
Unknown said...

Keep up the fantastic piece of work, I read few blog posts on this web site and I believe that your site is real interesting and has lots of great information. ERP Software in Mumbai || System Software || CRM Software in Mumbai || MLM Software

Unknown said...

I really appreciate spending some time to talk about that, I believe firmly regarding this and so really enjoy understanding more about this kind of subject.This is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this. CRM Software || MLM Software in Mumbai || ERP Software || System Software in Mumbai

Quân Đào said...

học kế toán thực hành cấp tốc
học kế toán thực hành cấp tốc
học kế toán thực hành tại cầu giấy
học kế toán thực hành tại thanh xuân
]học kế toán thực hành tại hà đông
học kế toán thực hành tại long biên
học kế toán thực hành tại long biên
học kế toán thực hành tại hải phòng
học kế toán thực hành tại bắc ninh
học kế toán thực hành tại tphcm
học kế toán thực hành tại quận 3
học kế toán thực hành tại hải phòng
học kế toán thực hành tại bắc ninh
học kế toán thực hành tại bình dương
học kế toán thực hành tại biên hòa
học kế toán thực hành tại vinh
học kế toán thực hành tại vinh
học kế toán thực hành tại huế
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại đà nẵng
học kế toán thực hành tại hải dương
học kế toán thực hành tại hưng yên
học chứng chỉ kế toán
học kế toán ở đâu tốt

Unknown said...

Dich vu ke toan ACB chuyên cung cấp dịch vụ kế toán trọn gói uy tín chuyên nghiêp giá rẻ nhất tại HCM và các tỉnh lân cận với chi phí bỏ ra từ 500.000-1.500.000đ.
Liên hệ: Dich vu ke toan , Dịch vụ kế toán.
Lầu 4, Tòa nhà Long Mã, 602 Cộng Hòa,P.13,Q.Tân Bình,HCM.
Hotline: (08) 62 97 97 97 - 0966 660 888.