Virtual PC Management for MS CRM Consultants

The Blab:

I don’t particularly enjoy being deprived of sleep, and things like attending a live LiveMeeting session running 9:00AM – 10:00AM on Pacific Time (meaning waking up  at 3:00AM on our NZ Time) doesn’t really appeal to me a great deal.

NEVER FEAR, MY FELLOW COMRADES!!!

– Long live LiveMeeting On-Demand!!! :-)

So, I was watching a MSFT Partner on-demand LiveMeeting training “Launching Your Microsoft Dynamics™ CRM Practice: Tools for Microsoft Dynamics™ CRM Consultants” hosted by Val Draper, a CRM PTS out from the States somewhere.

Ok, getting to my point of this post. There was a few polling questions Val started his session on, one was “Do you use Differencing disks on the Microsoft Dynamics CRM VPC image”. I was in complete AWE when I heard what the response was – “100% of the attendants are NOT using differencing disks” and these are MSFT Gold partners around the globe we are talking about here…

In this post, I write about what differencing disks are, why I use differencing disks and how I use it with Microsoft Dynamics CRM VPC Image.

Issue #1: “I need more disk space for my VPCs!!!”

I’m a MSCRM Specialist and I work with different clients on their MSCRM implementations day in and day out. Just like most(?) other MSCRM Specialists out there, I do ANYTHING and EVERYTHING in the Microsoft Dynamics CRM VPC Image. If it had a 2 bedrooms apartment with a heat pump and a sea view, I’d live in it.

The two OOTB .VHD files come with this VPC image are 15.6 GB in size. Imagine I get pimped out to work on 15+ clients’ implementations over a course of 6 months time (which is insanely realistic). To keep different clients IP (customisations, codes, third party add-ons etc) separate from each other, I’ll need to have 15 copies of the VPC image on my laptop.

So Let me pull up the calculator: 15.6 GB x 15 = 234 GB and let’s assume client specific changes we make are 3GB each 3GB x 15 = 45GB. All up I need 234GB + 45GB = 279GB of disk space just for my VPC storage.

Soon I’ll be crying out loud for more disk space…  image

Introducing Microsoft Virtual PC Differencing Disks

This is a really simple concept, a differencing disk is simply a VHD file that’s created based on another VHD file. Let’s call this base VHD “Parent VHD” and the differencing disk “Child VHD” for the moment and they work like this,

1. A “Child VHD” can be created with Virtual Disk Wizard in Microsoft Virtual PC using “mouse-point-and-click”, the “Child VHD” keeps a reference to “Parent VHD”.

2. When we create a Virtual Machine using Microsoft VPC, we can directly point the VM to the “Child VHD”. So in the VMC file there is no reference to the “Parent VHD”.

3. When we commit “Saved states” (a.k.a. any changes we made to a VM) to Hard Disk, it is saved to the “Child VHD” instead of “Parent VHD”. We essentially write all the differences we made to the Child VHD, hence the name “differencing disk”.

4. “Parent VHD” file can be and should be permanently marked “Read Only” via file properties at OS level. (explained further down this post)

How is differencing disk helping us with VPC disk spaces?

In our context, the “Parent VHD” is the “CRM-SRV-01 2009.vhd” that comes Microsoft Dynamics CRM VPC Image, and I create a child VHD for each of the 15 clients I have. Since we are not writing our changes to the “Parent VHD”, it remains client independent. Therefore, we can share this parent VHD across all of our clients, and assuming that our client “Child VHD” are 3 GB on average as well. Which means I only need 3GB x 15 + 15.6GB x (15 – 14) = 60.6GB of disk space comparing to 279 GB. This is a total saving of 279GB – 60.6GB = 218.4GB and 78.3% (218.4/ 279) of disk space comparing the the previous approach.

image

“So, how exactly do I create a Differencing Disk for MS CRM VPC Image” – I hear you ask?

Here is a step to step instructions on the HOW-TO…

  1. Download Microsoft Dynamics CRM 4.0 Virtual PC Image (April 2009).
    (*Note: you will need to have MBS Partner access, this image expires on 12/08/2010)image
  2. Double click on “MSCRM 40 2009 Demonstration VPC.part01.exe” to extract its content. When the extraction completes, you will see three files.

    image 
    “CRM-SRV-01 2009.vmc” – Fist thing to do is to delete this file, because, this is the VM that directly references the “Parent VHD” (CRM-SRV-012009.vhd). This is not what we want. What we want is to create a “Child VHD” (Differencing Disk) that reference this “Parent VHD”, THEN, create a VM (a vmc file) based on the “Child VHD”.

    “CRM-SRV-012009.vhd” – This is our main guy, it contains the Operating System, all software installed etc. This will be the “Parent VHD” for our clients Differencing Disks. You notice that I’ve made this file read only. This is because if I make changes to this file after creating Differencing Disks based on it, the Differencing Disks will become invalid.

    ”CRM-SRV-01 2009 Extrax v1.vhd” – This vhd contains a whole bunch of additional utilities like the accelerators etc. When mounted to a VM, this shows as a separate drive.

  3. Open Microsoft Virtual PC 2007 SP1.

    image
  4. File | Virtual Disk Wizard
    image
  5. Next | Select “Create a new virtual disk” | Next | Select to create “A virtual hard disk” | NextimageHere are a few rationales that I chose the above location for this differencing disk; 
            a. I store all my client project work under %Drive%:\Projects\ 
            b. I name the folder the client’s name – in this case, I have “Client 15” 
            c. I explicitly name the differencing disk “client name” + Diff
             Disk.vhd
    , so that even if it does get out of the folder context I know
               exactly what it is for. I sometime add the “project name” to it too 
               if there are more than one crm project going on with one particular
               client. 
           d. The reason I don’t include the “Parent VHD” name in this diff name is 
               because, when I do get to created a new VM based on this Diff Disk, 
               and it loses its references to the “Parent VHD”, it will show me the
               Parent VHD’s name and ask me to link to it.
  6. Next | select “Differencing” | Nextimage
  7. Browse to the “CRM-SRV-01 2009.vhd” file that we extracted earlier.imageNote: It warms us that we shouldn’t do any changes to this parent vhd. This 
             is why I made it read only in step 2.
  8. Finish | Congratulations!!! You have now successfully created a Differencing Disk based on the Microsoft Dynamics CRM VPC Image.image
  9. Now we will create a Virtual Machine based on this Differencing Disk.
    File | New Virtual Machine Wizard.
    image

10. Next | select “Create a virtual machine” | Nextimage 11. Browse to a location and enter the name for the vm | Nextimage      Note: I personally prefer to store the vmc files alongside referenced vhd file. 
               In this case, it’s %Drive%":\Projects\Client 15\Client 15.vmc

12. Select Windows Server 2003 for OS as is the Microsoft Dynamics CRM 4.0
      Virtual PC Image (April 2009)
| Next.image

13. Allocate 2GB of memory to the VM | Nextimage

14.  Select “An existing virtual hard disk” | Nextimage
15. Select the vhd file location, check Enable undo disks | Next.image     Note: This is the differencing disk we created earlier, the “Child VHD”. 
              I always check Enable undo disks, I think it should default to checked.

16.  Finish | Woila!!! You have successfully create a Virtual Machine that’s based 
       a differencing disk! and you can go about using the newly created VM.image

Issue #2: “My VM is running too slow, how can I improve its performance?”

One other benefit of using difference disks, apart from saving disk space, is it can greatly improve your VM performance by running the Base (parent) VHD on a separate physical disk (not just separate disk partitions), yet better, run it on a USB stick or a separate Solid State Drive (SSD). Here are the reasons;

1. By creating a differencing disk, we are introducing an additional file for Virtual
    PC Process to perform Disk Operations on. This is on top of the Parent VHD
    and the saved states files. So, having the Parent VHD separate from the
    Differencing Disk and saved states files on a different physical disk, we are
    offloading competing Disk Operations on one single disk.

2. This Parent VHD is read only and we are only doing ONLY Read Disk Operation
    on it, SSDs and USB drives are fantastic in performing read disk operations.
    (and shit in doing writes). So the set up is illustrated in the diagram below;

image

3. Taking this setup one step further, I have these 32GB USB drives, I put two
    different Parents.vhd files on them, create two diff disks and two VMs pointing
    to each of them respectively, give them 1.5 GB of RAM each, leaving 1GB of my
    Windows 7 64 bit host OS. AND run two VMs on one single laptop!!! It works
    like a charm!!!IMG_0245 If you are really up to it and have these 8GB onboard RAM laptops lying around, you can try to run 3 VMs at the same time, give them 2GB each and see how they go :-)

TO SUM UP:

1. As a CRM Specialist, we have multiple VMs catering for different clients. 
    Differencing Disk is a very space efficient approach to manage these VMs.

2. You can host the base Microsoft Dynamics CRM VPC VHD on a USB drive for 
    your VMs to improve their performance.

3. You can take this concept one step further and run two VMs (perhaps more if 
    you have one of those 8GB RAM laptops) at the same time without taking much 
    toll on the performance.

4. These concepts don’t just apply to CRM  peeps, it really applies to anyone that
    use multiple VMs, check out Andrew Connell, a SharePoint MVP, a virtualization
    maniac, how he has taken SharePoint development VMs to the extreme.

Happy VM’ing everyone!!!

Comments (2)

I’m taking BATT to China

image

If you don’t know what BATT is, read this earlier post. Over the past week and a bit I’ve been busy localizing some of the training material for our Chinese audience and I’ll be taking it to China for my follow countrymen and women later this month (June 2009)

This training tour is a two full day training course that focuses on building Line of Business applications with Microsoft Dynamics CRM 4.0. There are 6 modules;

1. Using Microsoft Dynamics CRM 4.0 with Windows Presentation Foundation
2. Using Microsoft Dynamics CRM 4.0 with Silverlight
3. Microsoft Office Client Integration with Microsoft Dynamics CRM 4.0
4. Using Microsoft Dynamics CRM 4.0 with Unified Communication
5. Introduction to Azure Services Platform with Microsoft Dynamics CRM 4.0
6. Microsoft Dynamics CRM 4.0 with Windows Azure

Each module consist of one hour of ppt and demos, followed by another hour of 300 level deep code dive hands on labs.

Details:

Date & Time: 24th & 25th June 2009, Start from 9:00am each day
日期和时间:2009年6月24,25号。 每天早上9点开始。

Location:  7th Floor, Tianjun International, No.365 Tianhe Road, Guangzhou, China
地址: 广州市天河区天河路365号天俊国际大厦七楼

Cost: FREE!!!  免费!!!

Registration:

There are VERY limited spaces available as this will be the ONLY BATT course for the ENTIRE China, a country with 1.6 billion population (yeah, go figure.)

So, to register email Liping on v-lipz@microsoft.com with your details!

See you all there!!! (Oh, it will be delivered in Mandarin Chinese BTW ;)

So I’ll be hitting the road again 22nd – 28th June WLG – AKL – HKG – CAN – TAO – HKG – CHC – WLG (looking forwards to seeing my folks again @TAO) :)

Leave a Comment

No Triple monitors for me :-(

Dell Precision M6300

So I finally hunted down a second external (third overall with my laptop) LCD monitor (very difficult to come by at work if you are already on two) with the full expectation of being able to run my ship like Captain Kirk with three monitors.

My pathetic little NIVDIA Quadro FX 1600M only fricken supports up to two displays and I am on Windows 7 RC :-(

<rant>

THEN WHY THE HECK DID YOU COME WITH TWO VIDEO PORTS!!!

</rant>

My Captain Kirk dream is still on hold :-(

What a let down!!!

image

Comments (1)

More Business Actions

image 

This is way more exciting than Business Time by Flight of the Conchords (okay, maybe that’s debatable). If you missed out on the Business Action World Tour that happened in in March all around the world in person. Never fear!!! Here is another chance. The same sessions will be delivered via Livemeeting across three different time zones from Monday 27th April to Friday the first of May.

For content details and registrations visit Ben Riga’s post or Catherine Eibner’s post.

 

image

This is the next wave of Worldwide Business Action on Microsoft Dynamics CRM by Microsoft Metro program. It’s a two-day Instructor Led Training (ILT) course and my colleague Chris Auld is instructing this course in Singapore on 10th-11th May and Sydney on 14th-15th.

Back in February, a team of us at Intergen worked very hard and built the content for this training course – six modules; a mix of presentation decks, demonstrations and hands-on labs for this training course. The labs are step by step instructions on how to build Line of Business applications by leveraging the greatness of Microsoft Dynamics CRM as an application platform and integrate with WPF, Silverlight, OBAs, OCS, .NET Service and Windows Azure.

For registrations refer to blog posts from Chris or Catherine.

Comments (1)

Microsoft Business Solutions in China

First thing first, MBS is short for Microsoft Business Solutions and is synonymous with Microsoft Dynamics. Microsoft Dynamics is Microsoft’s offerings on ERP and CRM systems.

On a recent trip to China, I delivered a training courseBusiness Action World Tour – in Mandarin, in Beijing and Shanghai, China, and here is the blog post I promised on MBS in China.

While I was there, I had a chance to work with folks from MBS China, MCS Shanghai, a local MBS partner on a 4000 seats CRM implementation for a local bank. In this post I write about what I have seen / learnt / realized some of the unique characteristics of the Chinese market in the business solutions arena and Microsoft Business Solutions in particular from working with these folks.

The business solutions market in China is pretty fairly partitioned
Tier 1 companies, ones that employ tens or hundreds of thousands of people like large telcos, banks, insurance companies, power companies, big manufacturing plants and some foreign invested global corporations. They are floating in all major stock exchange markets and are chopped up between SAP, Oracle, Siebel, IBM etc, a few global competitors. This is a global phenomena and this is no exception in China. So in terms of business solutions in this market tier, the level of maturity on both demand and supply sides is comparable to it in most developed countries. Microsoft is positioning its Dynamics Suite of ERP and CRM systems at tier 2 and 3, and there is no *good* ERP and CRM, local or foreign, for the small to medium market (Tier 2 & 3) in China apart from the Microsoft Dynamics Suite, this is great for Microsoft in the long run. But, this market tier is nowhere as mature as tier one. MBS isn’t doing particularly well comparing to other parts of the world – MBS GCR only has an annual sales target of 9 millions US and 3 millions for CRM, this is shockingly low for a 1.4 billion population economy.

In general, businesses in China, don’t fully understand the function of IT in a business
This is a true reflection of a developing economy. Business solutions in China for tier 2 and 3 market is still at its very early days, they don’t really have well defined business processes to drive their business operations, things happen and decisions are made on a very ad hoc basis, unorganized verbal communications is the main channel of driving business operations. They typically see IT systems as commodities that they can live without or a one off purchase and then shelved away for the rest of its life, there is no drive for adoption or satisfaction. They don’t see IT systems as an ongoing investment for the business to adapt changes in the business. In general, business owners and managers in China have a very primitive view on IT, they haven’t understood the value propositions of IT solutions in a business. They haven’t realized how IT solutions can drive productivity at individual workers level as well as organization level. They are yet to see the role of IT in driving company wise business operations’ efficiency, transparency, predictability and consistency. Concepts like Business Intelligence, Line of Business Solutions, Workflow driven business operations and organization collaborations are only just starting to emerge in this market tier. Then again, this is China we are talking about here, one of the main characteristics of the Chinese economy is cheap labour – if businesses can achieve the same tasks with 100 men running around manufacturing plants at 10 dollars a day, why would they choose to spend 3 million dollars on an ERP system that does roughly about the same thing?

There are, however, businesses in this tier are leading the way in adopting Line of Business solutions. They are riding at the forefront of this MBS wave and taking full advantage of being an early technology adopter. They wish to achieve two main goals from adopting a LOB solution. One, through implementing a LOB solution, they wish to define and formalize their business processes that drive their business operations. Two, they wish to benchmark these business processes against them of worldwide best practices in their specific industry verticals. This is more than just a couple of Business Analysts joggling along and formalize what’s already there. This is having specialized business consultants with relevant industry knowledge come in, look at their businesses and define their processes. This is distinctly different from what we have here in New Zealand and most developed countries where businesses already have a well defined set of business processes and business operations are driven by these processes. What they need is a *tool* to realize/automate these processes. In other words, businesses in the western world know what they do the best, IT systems implementers like Intergen, are literally “implementers” and working with the business to *refine* their business processes at the most.

So, what businesses in China need are end to end business solutions in their respective industry vertical, can MBS meet these needs?

MBS ecosystem in China lack business knowledge
In China, the MBS ecosystem is made up of MBS in China, MCS China and local MBS partners in China.

Microsoft Business Solutions (MBS) China, is a marketing and sales team that’s geared around license sales on the suite of Microsoft Dynamics products. (At the time of this blog post, MBS China only officially supports Microsoft Dynamics CRM and AX). They have technical pre-sales support, but that’s as far as it goes. They are not involved in post sales implementation.

Microsoft Consulting Services (MCS) China is a team of technology specialists and is very light on Dynamics but nevertheless they still are involved in implementations with their very limited Dynamics capability. There was only one person in MCS Shanghai that has had MSCRM implementation experience.

Local MBS partners, these folks are the main task forces for implementing MBS solutions in China. They are either foreign invested or home grown. What you’ll find amongst these partners is, they have good technical capabilities just like any other Microsoft dev shops, however they lack knowledge on industry vertical business solutions.

When I was helping out on this 4000 seat CRM implementation for a local bank, one of the senior managers asked for “Business solution for Customer Relationship Management in the banking sector”. No one could answer to that request, not MBS China, not MCS China, not the partner.

So here we have; businesses asking for best practices, benchmark business processes and solutions for running a paper mill factory on one hand, and 10 C# coders dressed up in suits and ties sitting across the table looking blindly at each other on the other hand. I’m not sure how well this deal is going down for.

There is a distinct mismatch between what the market *wants* and what MBS ecosystem in China can “provide”. This sets MBS apart from SAP and Oracle. No wonder MBS China has shockingly low sales targets…

IT service is cheap and very competitive in China
”Cheap labour” doesn’t  just apply to brick shifters, it applies across the economy and also to IT Services. On average local MBS partners charge at RMB¥2000 (NZD $600 – $350, USD$300-$175 depending on forex rate) per person per day. So for the foreign companies that want to explore the Chinese market, you simply can’t compete on price with the local partners, unless you are to set up an offshore office that hire locals and pay local wages as well.

Political and social pressure
This is another unique characteristic of the Chinese economy – a social and political one. There is a fair bit of pressure from central government and communities on keeping people employed, so businesses sometimes have to consider striking a very fine balance between employment rates and company efficiency. So businesses do have to think twice before implementing a system and make a whole lot of people redundant…

Where to from here???
The demand for business solutions in China in tier 2 and 3 is already picking up, with the Chinese economy and this market matures over time, the demand will grow exponentially.

Microsoft and partners need to take a long and hard look at this market, look at the needs and wants of this market.

1. To the Chinese market, MSFT needs to position the Dynamics suite not just as products but more importantly as end to end business solutions offerings in variously different industry verticals, put solutions ahead of products.

2. MSFT actually needs to *BUILD* these business solutions offerings on top of the Dynamics products and ship them with the products, put business back into the solutions. Keep your eyes on SAP and Oracle and no else where.

3. MSFT and partners need to look at building up their capabilities around providing business solutions offerings to their customers. There needs to be business processes people, there needs to be business consultants that specialize in different industry verticals not just technical people. Again, look at how SAP and Oracle build their implementation partners.

There is a long way ahead of us all my friends, and it only gets more exciting! :)

Leave a Comment

CRM Licensing in Dev, UAT and Production

There is plenty of information out there on MSCRM licensing model; Server License, Device CAL and User CAL, Connector License etc etc… But, if you are a dev shop, or an organization that does your own development, if you follow standard software release cycle practice and have Development, User Acceptance Testing and finally Production environments. What’s the licensing situation around these? After a bit of a chat with the local MS Dynamics CRM Specialist Dirk.Develter@MSFT, here is the breakdown.

Development

Server and user CALs – The organization has to have the server licensed, this is usually via MSDN which covers the Server License as well as up to 10 user CALs.

User Acceptance Testing (UAT)

Server – These have to be purchased separately for each installed CRM Server instances OR if the organization has MSDN they could use these as well.
If the organization has bought Server licenses for Production, they may NOT use these for UAT as they are physically separate CRM Server instances.

User CALs – If the organization has MSDN feel free, if not these will have to be purchased separately. BUT, if the organization has purchased CALs for Production they can use these for UAT as well.

Bottom line is – if there is a separate installed CRM Server instance (or server role in the case of Enterprise edition), you need a separate server license.

Production

Server and user CALs – cough up with the hard cold cash and dash them to MSFT.

Leave a Comment

Microsoft Dynamics CRM – Business Action World Tour – Beijing, Shanghai China

From the 9th to the 15th March I delivered a training course “Business Action World Tour” in Beijing and Shanghai, China – in mandarin. :) It is part of a greater Microsoft Metro program, which is a technology early adoption program by Microsoft Dynamics DPE team in Seattle.

These were half a day overview events focusing on the following aspects with demos to kill;

1. Dwelling on the xRM concept and elaborate on building Line-of-Business applications with Microsoft Dynamics CRM as an application platform. To hear Steve Ballmer himself talking about xRM in an exclusive interview with Destination CRM Magazine July 2008 issue (Flash Player required.)

2. Leveraging Microsoft’s investments in WPF and Silverlight to build compelling user experiences into Line-of-Business Applications with Microsoft Dynamics CRM.

3. Increase information workers’ productivity and Leverage organizations’ existing investment and skills with MS Office suite of products, by building Office Business Applications (OBAs) that interact with MS CRM. So information workers don’t have to leave their familiar environments – Office word, excel etc – to perform LoB application tasks.

4. Increase organization wise productivity by exploring possible integration points with “Office on the server” products, SharePoint and OCS specifically.

5. Compare the pros and cons for different deployment possibilities with Microsoft Dynamics CRM 4.0; On-Premise, Partner hosted or Microsoft’s own datacenter through CRM online.

6. Showcase a self-service web application that integrates with a LoB application built on Dynamics CRM Online, also consumes third party services. The best part is, this web application is hosted by Windows Azure Services Platform. So, anything and everything about this application is in the cloud.

I’ve learnt so much delivering this course in Mandarin. To ease understanding of my Chinese audience, I translated the 101 pages of  PPT from English to Chinese, I picked up all of the technical terms in Chinese along the way. The translated version of the PPT is here for download for anyone that’s interested.

Also, I’m writing a post on what the Chinese market is like for Microsoft Business Solutions, so subscribe to this blog to stay tuned.

Microsoft Dynamics DPE team folks have also blogged about these events:

Ben Riga – Group Manager for Dynamics DPE in Seattle

Girish Raja – Technical Evangelist for Dynamics CRM in Seattle

Catherine Eibner – Dynamics Developer Evangelist, Sydney

Microsoft Dynamics CRM Team Blog

Comments (2)

Form Based Authentication in SharePoint

This post serves me as a list of items to do when configuring FBA from scratch in SharePoint. It is by no means self explanatory or exhaustive.

1. Create a new web application call it Intranet, extend it and call that Extranet. Extranet is to live in Extranet zone.

2. Run “aspnet_regsql.exe -E -A all -S DatabaseServerName”

image

3. Create web application proj in VS to add users via Website ASP.NET Web Configuration. In web.config of this web app set authentication mode = “Forms”, and add connection string setting to the database created in step 2.

4. In Extranet and central admin web.config

Add the following two blocks of configuration settings.

<system.web>
 
  <!-- membership provider -->
  <membership defaultProvider="AspnetSqlMembershipProvider">
    <providers>
      <remove name="AspnetSqlMembershipProvider" />
      <add name="AspnetSqlMembershipProvider"
           type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
           passwordStrengthRegularExpression=""
           connectionStringName="SqlProviderConnection"
           passwordAttemptWindow="10"
           enablePasswordRetrieval="false"
           enablePasswordReset="true"
           requiresQuestionAndAnswer="false"
           applicationName="/"
           requiresUniqueEmail="false"
           passwordFormat="Hashed"
           minRequiredPasswordLength="3"
           minRequiredNonalphanumericCharacters="0"
           />
    </providers>
  </membership>
 
  <!-- role provider -->
  <roleManager enabled="true" defaultProvider="AspnetSqlRoleProvider">
    <providers>
      <remove name="AspnetSqlRoleProvider"/>
      <add name="AspnetSqlRoleProvider"
           connectionStringName="SqlProviderConnection"
           applicationName="/"
           type="System.Web.Security.SqlRoleProvider,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
           />
    </providers>
  </roleManager>
 
  <!-- other settings -->
 
</system.web>
<configuration>
<connectionStrings>
  <add name="SqlProviderConnection" connectionString="Data Source=VM-WSSDEV;Initial Catalog=AspNetDb_FBASpike;Integrated Security=True" />
</connectionStrings>
</configuration>

5. In central Admin

image

6. Add app pool identity user to sql server  assign dbo role to the database created in 2.

image

7. Add users created in step 3 to Site Collection Admin

image

8. Download and deploy FBA Tools and Utils for SharePoint 2007 to manage users, roles within SharePoint.

Comments (1)

STSDEV – few gotchas, tips and tricks

For those of you who have given up using any versions of Visual Studio extension for Windows SharePoint Services 3.0
(a.k.a. VSeWSS 1.0, 1.1, 1.2)

                                 GOOD ON YA!!!

- You’ve just saved yourself loads of pain.

(I think this itself deserves a good post, my colleagues are currently building the next version of VSeWSS at the time of this post, may God be with them!)

For those of you who have taken up WSPBuilder or STSDEV,

                              GOOD ON YA!!! (X2)

- SharePoint development have just become less painful :)

Here are a few tips and tricks I learnt along the way and from my experienced and knowledgeable colleagues from Intergen.

#1. Why STSDEV is ignoring changes made in targets file?

Close your solution in Visual Studio and reopen it, and yes we’ll have to repeat this each time we make a change to the targets file. I know it’s a pain in the bum.

What is up with this close/reopen business and how to fix it? When you find out, please do let me know :)

#2. Why is my solution deployed globally?

image

After a project is created with STSDEV, the default solution deployment command under DebugDeploy Target in targets file is;

<Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate" />

To change your deployment to a site collection;

<Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -url $(TargetUrl)  -force" />

where $(TargetUrl) is defined as a property between <PropertyGroup> tags at the beginning of the targets file;

<PropertyGroup>
  <PackageName>Play.wsp</PackageName>
  <PackageFile>Play.wsp</PackageFile>
  <TargetUrl>http://intranet/</TargetUrl>
  <!-- Other properties omitted -->
</PropertyGroup>

#3. “This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.”

This is a tricky one. The error message is very generic and can mean many things… To resolve it, you need to flick between the targets file and the SolutionConfig.xml file, make changes and trying deploying it.

image

Remember, each time you make a change to the targets file, close your solution and reopen it for it to take effect in the build.

If you’ve written any custom code in the project, like event receivers, and you need deploy this assembly to GAC. You’ll have to make each and very single following points are addressed.

(Depend on the option combinations you chose when you created the solution with STSDEV, none / some / all of these should have been done for you.)

a. The assembly is signed with a key file. (Project -> properties)

image

b. In SolutionConfig.xml, allow GAC deployment and safe control.

<AssemblyDeployment>True</AssemblyDeployment>
<SafeControlSettings>True</SafeControlSettings>

c. In SolutionConfig.xml, specify the safe control.

<Assemblies>
    <Assembly Location="Play.dll" DeploymentTarget="GlobalAssemblyCache">
        <SafeControls>
            <SafeControl Assembly="Play, Version=0.0.0.0, Culture=neutral, PublicKeyToken=abbe9e18e07720bf" Namespace="Play" TypeName="*" Safe="True" />
        </SafeControls>
    </Assembly>
</Assemblies>

You can get the assembly name by opening up the dll in reflector after signing it with a key and compiled the project.

image

d. In targets file, under BuildDeploy target, solution deploy command allows GAC deployment.

<Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -url $(TargetUrl) -force" />

e. If solution is to deploy to a site collection, specify the URL in the deploy command as well, so it knows which web config to place the safe control in. (See the above code snippet.)

f. If you are intending to deploy to all Site Collections in this Web Application, make sure you specify so by having a -allcontenturl switch in the command.

<Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -allcontenturls -force" />

Failing all above, keep Live.com ‘in ;)

#4. “This solution contains resources scoped for a Web application and must be retracted from one or more Web applications.”

If you have successfully deployed your wsp solution to a specific site collection following the steps in #2 and 3, then you might come across this message when you try to build the project in “DebugRetract” or “DebugDelete” build targets.

If you take a look at the output windows it fails at line:

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o retractsolution -name Play.wsp -immediate

This happens because we haven’t specified the site collection URL that we had deployed the wsp solution to. So, if we change the line to.

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe" -o retractsolution -name Play.wsp -immediate -url $(TargetUrl)

Remember to close and reopen your solution for this change to take effect, then build it. You should see the problem go away.

#5. Can’t Debug I hear you say?

There are a couple of things you need to do here,

One is, allows a pdb file to be generated each time you compile the project. in Visual Studio 2008, right click on the project -> Properties -> Build -> Advanced… -> Debug Info -> full

image

So repeat this for all the concerned Configuration target. I recommend do it for “DebugRefreshAssemblyInGac, DebugBuild, DebugDeploy, and DebugRedeploy”. Not sure about “DebugUpgrade” never used it before.

image

Two is adding the pdb files to the correct GAC location. First you’ll need to find out where in GAC you’ll want to copy the pdb files into.

Start -> Run and type in “C:\windows\assembly\GAC_MSIL” as it can’t be opened through a file explorer.

image

Follow your nose and you should find the directory where the bit was deployed to, copy out the path from Address bar, this is the folder you want to deploy your pdb file to.

image

So in your target file, you need add two lines to your “DebugDeploy” target and “DebugRefreshAssemblyInGac” target like to following;

<Target Name="DebugDeploy" DependsOnTargets="DebugInstall">
  <Message Text="Deploying Solution..." Importance="high" />
  <Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -url $(TargetUrl) -force" />
  <Exec Command="$(STSADM) -o execadmsvcjobs" />
  <Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="C:\windows\assembly\GAC_MSIL\Play.0.0.0__abbe9e18e07720bf" SkipUnchangedFiles="" />
  <Message Text="$(TargetDir)$(TargetName).pdb copied to GAC for debugging." Importance="high" />
  <Exec Command="$(POSTBUILD)" />
  <Message Text="" Importance="high" />
</Target>
 
<Target Name="DebugRefreshAssemblyInGac" >
  <Message Text="(Re)installing assembly in GAC and recycling app pool" Importance="high" />
  <Exec Command="$(GACUTIL) -if $(TargetPath)" />
  <Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFolder="C:\windows\assembly\GAC_MSIL\Play.0.0.0__abbe9e18e07720bf" SkipUnchangedFiles="" />
  <Message Text="$(TargetDir)$(TargetName).pdb copied to GAC for debugging." Importance="high" />
  <Exec Command='$(ISSAPP_SCRIPT) /a "SharePoint - 80" /r' />
  <Message Text="" Importance="high" />
</Target>

Remember to close and reopen your solution each time you change the target file.

image

Make sure the timestamp for these two files are identical, or your code is likely to be out of sync with the pdb.

#6. Have a post build script depending on your build targets?

In your target file, add a new property inside <PropertyGroup> tag.

<POSTBUILD>"$(ProjectDir)PostBuild.bat"</POSTBUILD>

And use this as a command in any targets in your target file, like so;

<Exec Command="$(POSTBUILD)" />

- I hear you ask, why wouldn’t you just use Build Event from project properties?
Because STSDEV introduces a handful of build targets (10 of them) and sometimes it’s useful to have control over which targets you want to have a post build script while not others. Also, we can run different post build scripts for different build targets leveraging this approach, just define different scripts as properties inside <PropertyGroup> tag then just invoke the appropriate ones from different build targets.

- Note, in theory we should be able to put anything we have in a post build script in the target file. After all, the targets file is just a script file in an XML format. But to me, I want to be able to share my build script around with other developers or from project to project. By extracting some of the common tasks out to a build script I’m protecting myself against having to relying on STSDEV. After all, STSDEV is just one of the great tools out there. That’s just my opinion, your mileage may vary.

#7. Have multiple projects under one solution?

When you first create a project with STSDEV and call it Play, It will lay out its folder structure like so;

image

When you create more than one projects and shift them to a sub directory to where the solution file resides, like so;

image

Then you compile your project, you’ll see this error;

image

and this in your Output Window;

STSDEV - Simple Tools for SharePoint Developers
Refreshing Solution Package Files
Current Solution Name:
Current Solution Directory:
Refreshing deployment files...
 
Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Dev\Play\Play\DeploymentFiles\SolutionConfig.xml'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
   at System.IO.StreamWriter..ctor(String path)
   at stsdev.SolutionConfigBuilder.Create(String FilePath, Boolean AssemblyDeployment, Boolean SafeControlSettings, AssemblyDeploymentTarget DeploymentTarget, PermissionSet CasPermissions)
   at stsdev.SolutionConfigBuilder.Create(String FilePath, Boolean AssemblyDeployment, Boolean SafeControlSettings, AssemblyDeploymentTarget DeploymentTarget)
   at stsdev.SolutionConfigBuilder.Create(String FilePath, Boolean AssemblyDeployment, Boolean SafeControlSettings)
   at stsdev.SolutionConfigBuilder.Create(String FilePath, Boolean AssemblyDeployment)
   at stsdev.SolutionBuilder.LoadSolutionConfigFile()
   at stsdev.SolutionBuilder.RefreshDeploymentFiles()
   at stsdev.SolutionBuilder.RefreshDeploymentFiles(String TargetSolutionName, String TargetSolutionDirectory)
   at stsdev.Program.Main(String[] args)
MSBUILD : warning MSB3073: The command ""C:\Program Files\STSDev v1.3\stsdev.exe" /refresh "Play" "C:\Dev\Play\Play\"" exited with code -532459699.

This happens because, STSDEV uses solution directory to reference its deployment files and these files are per-project based. When we moved the project related files and folders else where, we’ll need to reference them by project directory.

All you need to do is to change the follow line in your <PropertyGroup> in your targets file.

<REFRESH>$(STSDEV) /refresh "$(TargetName)" "$(SolutionDir)"</REFRESH>

to

<REFRESH>$(STSDEV) /refresh "$(TargetName)" "$(ProjectDir)"</REFRESH>

Close and reopen the solution then try building the project again!

#8: “error : Cannot create INF file: setup.inf”

This happens because STSDEV will try to create/write to files called setup.inf and setup.rpt. The chances are you have these two files under source control so they are locked.

setup.inf, setup.rpt in project directory, along with manifest.xml and SolutionPackage.ddf in DeploymentFiles folder will get regenerated and written to each time you build your project. So don’t have them under source control.

image

#9: “Where are my web stuff?”

Enlightened by a colleague of mine – Matt Smith – a SharePoint Evangelist. When you create a project with STSDEV, the project is a C# library type.

image

When we add New Items, there isn’t a great of items are available to us. Especially when we develop SharePoint solutions, ASP.NET artifacts like ascx User Controls, aspx pages etc…

image

For us to be able to add web stuff to the project, Visual Studio needs to see the project we are adding stuff to – is a Web Application Project. To achieve this, add the following line of xml to the first <PropertyGroup> node of your .csproj file.

<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

So,

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">DebugBuild</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  <ProductVersion>9.0.21022</ProductVersion>
  <SchemaVersion>2.0</SchemaVersion>
  <ProjectGuid>{3C135253-DDB3-421F-B27A-FC0481335E58}</ProjectGuid>
  <OutputType>Library</OutputType>
  <RootNamespace>Play</RootNamespace>
  <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
  <SignAssembly>true</SignAssembly>
  <AssemblyOriginatorKeyFile>KeyFile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

becomes

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <Configuration Condition=" '$(Configuration)' == '' ">DebugBuild</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{3C135253-DDB3-421F-B27A-FC0481335E58}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>Play</RootNamespace>
    <TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
    <SignAssembly>true</SignAssembly>
    <AssemblyOriginatorKeyFile>KeyFile.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>

Reload the project and we see the project icon has become it of a Web Application Project;

image

and we can add all the web stuff to our project now;

image

There you go, the joys and pains for working with STSDEV.

Technorati Tags: ,,,

Comments (2)

"xRM"? What do you mean?

The “x” represents *anything* relationship management.

Apart from the core business automations that most CRM systems have; Sales, Marketing and Customer Services. There are three points I see Dynamics CRM is really really good at;

1. Managing relationships among both system and custom entities.

2. Managing and tracking of activities surrounds these entities, like; tasks, emails, letters etc.

3. Ease of customizations and instant exposure of this schema change through its API; the Web Services – programmability.

So where is the real world taking us with Microsoft Dynamics CRM?

People have taken liberties upon themselves and are really leveraging the above advantages to implement solutions that do not evolve just around customers and contacts. They have taken it across a variety of industries; military, task management, political parties for constituent tracking and management, administering benefits programs for government, Health care, manufacturing, insurance, you name it!

Here are a few local / global examples;

Military
The US Air Force in Europe uses Microsoft Dynamics CRM as a platform to manage deployment of personnel.

HR
A leading US financial services firm is building out an HR staffing system on Microsoft Dynamics CRM.

Our very own Kiwi ERMLive for Payroll and HR.

Recruitment
Momentum, uses CRM to manage job vacancies and candidates information.

Another Kiwi start up that’s founded by an ex-intergenite, Simon Gardiner and his business associates, have built his recruitment business entirely on CRM 4.0, leveraging its multi-tenancy feature and the latest of it all; Windows Server 2008, Hyper-V and IIS7.

Broadcast
Scripts management and tracking by a local broadcasting firm.

What is Microsoft’s vision?

Steve Ballmer, CEO of Microsoft Corp, said the following in an exclusive interview with the Destination CRM Magazine July 2008 issue;

Siebel maybe sold three-plus million seats, something like that. You know, the total install base of Salesforce is just over a million; we’re just under a million; blah, blah, blah. Yet all of these numbers pale in comparison to what I think the value that the CRM technology *the xRM category* can mean. I think it’s a category that should actually be – I said this on stage, and I mean it – many, many tens of millions of seats. [Read the article for more].

Want to read more about this concept? Jason Hunt and Aaron Elder from Ascentium have written a 14 page article on it – “Microsoft Dynamics CRM as a Business Application Platform“.

Leave a Comment

Older Posts »