Month: October 2010

WebTest Recording does not work in Visual Studio 2008 Test Suite

Hi,

If you have IE 8 and Windows 7/Server 2008, WebTest recording may not function in IE correctly. To solve this problem, delete the following keys in the registry.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories\{00021493-0000-0000-C000-000000000046}

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories\{00021494-0000-0000-C000-000000000046}

Dynamics CRM 4.0 Windows Server 2008/IIS 7.5 install problems

Hi,

Setup:

SQL 2008 r2

Windows Server 2008 r2

IIS 7.5

Ensure IIS Windows Authentication is installed.

Also ensure:

So, go to the web site (Microsoft Dynamics CRM) -> features view -> double-click on handler mappings -> double click on "StaticFile" -> make sure it reads:
StaticFileModule,DefaultDocumentModule

 

use Fiddler if you get issues. I was playing with DbPopulator and the RunPopulation command and had issues, Fiddler helped me solved them. Like connecting to my CRM website:

here is the RunPopulation.exe i used, notice portnumber for iis! I got errors with SOAP CALLS, since Organisaton was wrong, by using fiddler you can find these issue, when it calls: CRMService.asmx to upload data to CRM:

 

SET WEBSERVER=WIN-IQUJ9E2TJQS:5555
SET ORGANIZATION=Romiko
SET DOMAIN=Romiko.Derbynew.Com
SET USERNAME=romiko
SET PASSWORD=mypassword

SET CRMUSERBASE=Romiko
SET CRMUSERSTART=1
SET CRMUSERCOUNT=1

ImportCustomization\ImportCustomization.exe ImportCustomization\Account_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD
ImportCustomization\ImportCustomization.exe ImportCustomization\Contact_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD
ImportCustomization\ImportCustomization.exe ImportCustomization\Task_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD

DbPopulator\UserConfigGen.exe /domain:%DOMAIN% /webserver:%WEBSERVER% /userbase:%USERNAME% /password:%PASSWORD% /threadcount:1 /crmuserbase:%CRMUSERBASE% /crmuserstart:%CRMUSERSTART% /crmusercount:%CRMUSERCOUNT% /orgname:%ORGANIZATION%

DbPopulator\dbPopulator.exe UserPopulate.xml
DbPopulator\dbPopulator.exe DbPopulator\ProductSuite.xml
DbPopulator\dbPopulator.exe DbPopulator\NestedSFAEntitiesWithState_Custom.xml
DbPopulator\dbPopulator.exe DbPopulator\ReportsData.xml

 

 

image

Also ensure:

Microsoft Dynamics CRM 4.0

Microsoft Dynamics CRM 4.0 is compatible with Windows Server 2008 and Windows Server 2008 R2-based computers. The Microsoft Dynamics CRM 4.0 client for Microsoft Office Outlook is supported on Windows Server 2008 and Windows Server 2008 R2 when used with Terminal Services or with Citrix.
The following versions of Windows Server 2008 and Windows Server 2008 R2 are supported:

  • The 32-bit and 64-bit editions of the Windows Server 2008 Standard
  • The 32-bit and 64-bit editions of the Windows Server 2008 Enterprise
  • The 32-bit and 64-bit editions of the Windows Server 2008 Datacenter
  • The 32-bit and 64-bit editions of the Windows Server 2008 Web Server

Installing Microsoft Dynamics CRM 4.0 on Windows Server 2008
Note: Microsoft Dynamics CRM 4.0 is not currently supported in an IPv6 only environment.
Note: During the install of Microsoft Dynamics CRM 4.0 you must use Network Service as the Service Account or the installation will fail.
A server role describes the primary function of the server. In Windows Server 2008, administrators can dedicate an entire computer to one server role, or install multiple server roles on a single computer. In order to install Microsoft Dynamics CRM 4.0 on Windows Server 2008 the following Windows Server 2008 Server roles need to be installed.

  • Static Content role service (Included in the Web Server (IIS) role)
  • Dynamic Content Compression role service (Included in the Web Server (IIS) role)
  • Windows Authentication IIS role service (Included in the Web Server (IIS) role)
  • Compatibility Components role service (Included in the Web Server (IIS) role)
  • Indexing Service (Included in the File Services role)

To add the above roles before you install Microsoft Dynamics CRM 4.0 follow these steps:

  1. Click Start, click All Programs, click Administrative Tools, and then click Server Manager.
  2. Right-click Roles, and then click Add Roles.
  3. Click Next to get to the Server Role Screen.
  4. Mark the checkbox for the following roles, and then click Next.
    • Application Server
    • File Services
  5. Click Next to get to the Roles Services for the Application Server.
  6. Select the checkbox next to Web Server (IIS) Support. When the Add Roles Wizard box comes up, click Add Required Role Services, and then click Next.
  7. Click Next to get to the Web Server Role Services, keep the existing checkboxes that are marked and mark the checkbox next to IIS 6 Management Compatibility, and then click Next.
  8. Click Next to get to the File Services Role Services, mark the checkbox next to Indexing Service , and then click Next.
  9. Click Install

If you have already enabled the Application Server, File Services or Web Server (IIS). Then to enable certain Role Services follow these steps:

  1. Click Start, click All Programs, click Administrative Tools and click Server Manager.
  2. Expand Roles and right-click Application Server, File Services or Web Server (IIS) depending on the role you need and click Add Role Services.
  3. Complete the wizard to add the desired role services.

Back to the top

MORE INFORMATION

Back to the top

Issues that may occur when you use Windows Server 2008 with Microsoft Dynamics CRM 4.0

The following known issues may occur when you use Microsoft Dynamics CRM 4.0 with Windows Server 2008 if the above roles are not installed. . Any available workarounds are also described.
Issue 1: Error message when you try to open the Microsoft Dynamics CRM 4.0 Web application:

"Problems with this Web page might prevent it from being displayed properly or functioning properly" Line: 194 Char: 1 Error: Object expected code: 0 URL: http://localhost/

To work around this problem, enable the Static Content role service in the Web Server (IIS) role.
Issue 2: Error message when you install Microsoft Dynamics CRM 4.0:

"Action Microsoft.Crm.Setup.Server.EnableCompressionAction failed" System.Runtime.InteropServices.COMException (0x80005006): Exception from HRESULT: 0x80005006

To workaround this problem, enable the Dynamic Content Compression role service in the Web Server (IIS) role.
Issue 3: Error message when you try to open the Microsoft Dynamics CRM 4.0 Web application:

"HTTP Error 401.2 – Unauthorized"

To work around this problem, enable the Windows Authentication role service in the Web Server (IIS) role.
Issue 4: Error message when you try to install the Microsoft Dynamics CRM 4.0 server:

"Internet Information Services (IIS) 7 along with IIS 6 Compatibility Components must be installed on Windows Server 2008"

Microsoft Dynamics CRM 4.0 only supports IIS 6.0 Management Compatibility role service.
To work around this problem, you must install the IIS 6.0 Compatibility role service in the Web Server (IIS) role.
Issue 5: If you only enable IPv6, the following problems may occur in Microsoft Dynamics CRM 4.0. Consider the following scenario. You install Microsoft Dynamics CRM 4.0 Internet Facing Deployment (IFD) in an IPv6-only environment. You set the internalnetworkaddress registry key to an IPv6 address. You try to open the Microsoft Dynamics CRM 4.0 Web application. In this scenario, you receive the following error message:

An invalid IP address was specified.

Consider the following scenario. You try to install the Microsoft Dynamics CRM 4.0 server in an IPv6-only environment. Then, you configure the Setup process to create the Web site to be used as the Microsoft Dynamics CRM server. In this scenario, you receive the following error message:

Check WebServerValidator: Failure: An address incompatible with the requested protocol was used

To work around these problems, make sure IPv4 is enabled along with IPv6 and that you have Update Rollup 3 or higher installed.
Issue 6: Consider the following scenario: You try to install the Microsoft Dynamics CRM 4.0 Server with a Security Account running under a Domain User account on Windows Server 2008. The Microsoft Dynamics CRM 4.0 installation tries to add the domain user to the IIS Worker Process Group (IIS_WPG). Windows Server 2008 runs IIS 7.0. However, Microsoft Dynamics CRM 4.0 uses IIS 6 compatibility mode. In this scenario, the Setup process fails, and you receive the following error message:

Action Microsoft.Crm.Setup.Server.ConfigureAspNetAccountAction failed. System.ComponentModel.Win32Exception: The group name could not be found.

This problem occurs because IIS 6 compatibility mode no longer has the IIS_WPG group.
To work around this problem, you must select the Network service to start Microsoft Dynamics CRM 4.0.
Once Microsoft Dynamics CRM 4.0 is installed and running you can change the service account to a domain user by doing the following:

  1. On the Microsoft Dynamics CRM server click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager .
  2. Expand your Web Server name and then click Application Pools .
  3. Right-click CRMAppPool, and then click Advanced Settings.
  4. Click Identity, change the Identity to the Service Account you created, and then click OK.
  5. Click Start, click Run, type iisreset, and then click OK..

Active Directory Changes:

  1. On the domain controller click Start, click Administrative Tools, and then click Active Directory Users & Computers.
  2. Navigate to where the Microsoft Dynamics CRM Security Groups were created and add the service account to both the PrivUserGroup and SQLAccessGroup.

File System Changes on the 2008 IIS Server:

  1. On the Microsoft Dynamics CRM Server navigate to C:\Program Files\Microsoft Dynamics CRM\.
  2. Change the permissions on the Trace Directory giving the service account FULL CONTROL to this directory.

Include the service account in the following groups in the Microsoft Dynamics CRM server:

  • The local IIS_IUSRS group
  • The local CRM_WPG group

To to this, follow these steps:

  1. In the Microsoft Dynamics CRM server, click Start, point to Administrative Tools, and then click Server Manager.
  2. Expand Configuration, expand Local Users and Groups, and then click Groups.
  3. In Groups pane, right-click IIS_IUSRS, and then click Properties.
  4. Click Add, type the service account, click Check Names, and then click OK two times.
  5. In Groups pane, right-click CRM_WPG, and then click Properties.
  6. Click Add, type the service account, click Check Names, and then click OK two times.

Issue 7; When you upgrade from Windows Server 2003 to Windows Server 2008, the Indexing Service is uninstalled. When the Indexing Service is uninstalled, you cannot use the application Help files in Microsoft Dynamics CRM 4.0.
To work around this problem, enable the Indexing Service role service in the File Services role.

Rendering and Binding Drop Down Lists using ASP.NET MVC 3 EditorFor

Hi,

I wanted to render a drop down list on my EditorTemplates. I notice on the net allot of people creating ascx controls and using something like:

[UIHint("List")]

if you do not, you end up with an error:

error CS0305: Using the generic type ‘System.Collections.Generic.IEnumerable<T>’ requires 1 type arguments

However, this is not necessary in MVC 3, I am using Razor, so cshtml. I am sure it will work just as well in MVC2.

All you need to do is be explicit on the generics e.g.

In my cshtml file which is in the EditorTemplates, I have this:


Click me for ENUM lists

<div class="editor-field">
 @Html.DropDownList("CategoryId", new SelectList(ViewData["Categories"] as IEnumerable<PhotoRA.Web.Models.Category>, "CategoryId", "Name", Model.CategoryId))
 </div>

All I do is cast the ViewData with the as clause and use my generic type:

as IEnumerable<PhotoRA.Web.Models.Category>

So, no need for a ASCX file just for a dropdownlist!

The ViewModel in this case looks like this:

public class StoreManagerViewModel
{
 public Photo Photo { get; set; }
 public List<Category> Categories { get; set; }
 public List<Event> EventList { get; set; } 

}


Click me for ENUM lists

Mecurial / Tortoisehg: Setting up a Source Control Repository on HTTP

Hi,

Install the following

http://tortoisehg.bitbucket.org/download/index.html

One this is installed we will:

  • Create a Repository where our source code will sit.
  • Create a clone where our working location is
    STEP 1: Create the Repository

So, the first step is to allocate a folder for the repository:

My repository folder is called:

PhotoRARepository

We will then right click the folder and select Create Repository:

image

We just confirm the destination as the same place:

image

Cool, now we need to publish the repository to the web.

Right click the folder and go to repository explorer.

image

Then in the explorer go to Tools->Settings and configure HTTP/HTTPS and port number to listen on:

image

Once this is done, click the Server Button!

image

You will see a window open that is listening on this new port:

image

That’s it we done.

We can also updated the .hgignore file to ignore checking in these files:

image

# Ignore file for Visual Studio 2008

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml

 

Next, you need to activate the files in the repository, by adding them, if you got existing files already in the folder!

image

 

Once this is done, you COMMIT them to the repository:

image

Confirm all the files and we done on the Master repository side:)

image

Double check all files have a nice green tick:

image

If you go back to the repository explorer the history should now be there after the commit.

image

    STEP 1: Clone the Repository from a developer machine

 

Note: if you have the master repository, you still need to clone it and use the clone, never use the repository directly!)

To use the repository, you need to create another folder on ALL users machines that will use the source control. To do this, they will CLONE the repository.

So if you are the only user of the project, you will STILL need to clone it, that means if your computer is the repository and you want to use the source control, you must also clone it.

So i created a new folder called PhotoRA, which will be my clone. I right click the folder and select Clone:

image

Then specify the web URL.

image

Once done, it will automatically fill the folder and you can now use Visual Studio and start coding.

image

We can test this, by opening the solution editing the file and committing it to the repository.

I went an updated the web.config file in my clone repository using Visual Studio. Now I right click the clone folder and commit.

image

Next I right click my clone folder and select repository explorer and I see the history, I can now PUSH it up to the main repository.

image

You can see all the chit chat in the HTTP Server Log:

image

Never edit files directly in the MAIN repository!

 

Repeat STEP 2 for ALL developers using your repository 🙂

That’s it 🙂

MVC 3 Cleaner Views

Hi,

Lets compare MVC 2 to a MVC 3 view, a basic one:

MVC 2:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PhotoRA.Web.ViewModels.StoreBrowseByEventViewModel>" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> 
</asp:Content> 

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 
    <h2>Browse Photo's</h2> 
    <ul>
    <%foreach (var photo in Model.Photos) {%>
    <li><a href="<%: Url.Action("Details","Store", new {photoId = photo.PhotoId} )  %>"> <img src="<%:photo.Photo_Url %>" /> </a></li>
    <%}%>   
    </ul>


</asp:Content>

MVC3:

@model PhotoRA.Web.ViewModels.StoreBrowseByEventViewModel
    <h2>Browse Photo's</h2>
  <ul>
    @foreach (var photo in Model.Photos) {
      <li><a href="@Url.Action("Details", "Store", new {photoId = photo.PhotoId})"><img src="@photo.Photo_Url" /></a></li>
    }
  </ul>

 

Pretty Clean….

There is also a @helper for HTML helpers and loads of other stuff such as layout defaults and better IoC/DI support.