AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
CRM
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.08.2009, 19:06   #1  
Blog bot is offline
Blog bot
Участник
 
25,497 / 847 (79) +++++++
Регистрация: 28.10.2006
Jim Wang: Build a handy Dynamics CRM development environment
Источник: http://jianwang.blogspot.com/2009/08...velopment.html
==============

Last month, Sonoma Partners and Microsoft had an very useful article for CRM developers: Setting Up Your Development Environment, I have abstract it into Chinese version. In this post, I'd like to give my idea about how to build up a handy Dynamics CRM development environment.

The typical situation is: A CRM developer runs a Virtual PC image on his/her own PC; the virtual image is a All-In-One CRM system(Windows Server/SQL/IIS/CRM/SharePoint etc.); the Host PC has Visual Studio installed. I'm not going to discuss the mutli-developers sharing one development environment using TFS in this article.

Setup Virtual PC environment:
Microsoft Virtual PC is a free software, it has all we need to develop a CRM project. You may firstly install Windows Server 2003/2008 on the VPC, then install AD, DNS, IIS 6/7, SQL server 2005/2008, CRM 4, etc. Finally it's a All-In-One CRM box, I'd like to point out that:

1. It can be a Domain Controller - that's for your development only, not for production.

2. You may need 3 Network Adapters in the VPC:
a. Local only - for VPC internal use
b. Microsoft Loopback Adapter - for the communication between Host and VPC
c. Host's Physical Adapter - for the Internet access via the Host PC

The communication between Host and VPC can be used by a Physical Adapter, however think about this situation:
You have a laptop which can be used at home(via Wireless) and company(via Cable), so the IP arrange / Adapter are different.
That's the reason why we need a Microsoft Loopback Adapter in this "handy" environment(BING it: how to set up a Microsoft Loopback Adapter).

3. The VPC can be set up to the On-Premise/IFD mode, so you can develop/test both CRM deployment. You may edit Host's hosts file(e.g.: C:\WINDOWS\system32\drivers\etc\hosts) to point to the IFD URL.


Setup Visual Studio on the Host PC:
You can use Visual Studio to develop/debug CRM on the Host PC, to make it work efficiently:

1. Add user credentials to access VPC (on your Host PC(I suppose it's a Windows XP system, Vista/7 are similar), go to: Control Panel>>User Accounts>>Advanced>>Manage Passwords) , then type in VPC's Server name, User name and Password, click OK to save it.



2. To make the Remote Debug work, the runas account for Visual Studio on the Host PC and the runas account for the Visual Studio Remote Debugging Monitor(msvsmon.exe) on the VPC must use the same user name, it doesn't matter whether users are in two different domains. For example, your VPC domain name call: WIN2K3, your logon user for the VPC is Administrator; However your Host PC's logon user is: CompanyDomain\jimwang, in this case, the remote debugging will not work because it's on different users names. What you can do is, use the local Administrator account on your Host PC to run Visual Studio. E.g.: you can simply create a shortcut on your desktop, target to, e.g.: %windir%\system32\RUNAS.exe /USER:HostPCName\Administrator "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"

3. How to remote debug VPC CRM from the Host PC?
Once you completed the step1 and step2, then make sure the msvsmon.exe is running on the VPC( you can copy the file from your Host PC: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\), the monitor will then waiting for new connections. Go back to your Host PC, set a Breakpoint in your project,
Then click "Debug">>"Attach to process...", in the Qualifier, type in the VPC's server information you created on step 1, e.g.: WIN2K3\Administrator@R2
And then attach w3wp.exe (Managed code).




4. How to deploy the plugins .dll file to VPC?
You need to deploy the .dll file to the VPC's file system in order to Remote Debug(see SDK for more information), the folder is, e.g.: C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly\
You may share the folder and give permission to everyone with full control, then in the Visual Studio, set up the project output path to the shared folder, e.g.: \\R2\assembly\
Now, you may have the experience that, every time you deploy/debug the project, you have to run a IISRESET on the VPC to release the previous .dll file.
I write a Windows PowerShell script to help you do the hard work, your may save it as RecycleCRMAppPool.ps1, then in Visual Studio, make it as the Pre-build event command line of the project. The script will recycle the CRMAppPool before deploy the .dll file.


$server="R2";

$co = new-object System.Management.ConnectionOptions;
$co.Authentication=[System.Management.AuthenticationLevel]::PacketPrivacy;
$co.EnablePrivileges=$true;

$wmi = [WmiSearcher] "Select * From IIsApplicationPool";
$wmi.Scope.Path = "\\$server\root\microsoftiisv2";
$wmi.Scope.Options=$co;

foreach($crmpool in $wmi.Get())
{
if($crmpool.name -eq "W3SVC/AppPools/CRMAppPool")
{
$crmpool.recycle();
}
}




5. You may also use Microsoft Dynamics CRM Develop Toolkit Visual Studio add-on to develop any plugin/workflow assembly/jscript for your CRM project, it will reduce your development time.


Источник: http://jianwang.blogspot.com/2009/08...velopment.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Building a Self-Contained Virtual CRM Development Server Blog bot Dynamics CRM: Blogs 0 05.05.2009 10:05
Jim Wang: Customizing CRM by Using the Microsoft Dynamics CRM Developer Toolkit Blog bot Dynamics CRM: Blogs 0 09.04.2009 22:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 4.0 Bookshelf Blog bot Dynamics CRM: Blogs 1 22.01.2009 04:46
Microsoft Dynamics CRM Team Blog: Top 14 Microsoft Dynamics CRM Sites and Downloads Blog bot Dynamics CRM: Blogs 0 14.07.2008 13:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 14:33.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.