Create IIS Website problem

May 26, 2010 at 8:17 AM

I've execute websitecopy utility on step 6 of installation document. What does it do? Which content and where it copies? Also I try to execute step 12 . In the installation folder I've found two Website directory - C:\Accelerators\Customer Portal\Installation\Website\Customer-Portal-R2\Website. Which from them I should use for create iis web site? I've tried to create web site both ways, but can't browse tham.

May 26, 2010 at 9:14 AM



I am no expert like Shan but the website copy takes the web pages from the customer portal folder and inserts the definitions into Dynamics. It does not create a website as such.



May 26, 2010 at 9:53 AM
Edited May 26, 2010 at 10:25 AM

My understanding is that websitecopy is used to initialise many variables inside the CRM. It don't understand how it is linked to IIS then. So I have the same question as 4olega : when creating the IIS website (step 16), I suppose that the steps are the same as for previous accelerators :

  1. Create a new web site using the wizard
  2. Point to the files that the web site will use : wich directory should we choose : C:\Accelerators\Customer Portal\Installation\Website\ or C:\Accelerators\Customer Portal\Installation\Website\Customer-Portal-R2\Website ?
  3. Do we have to allow anonyous access ?
  4. I suppose that we have to allow "Run scripts (sucha as ASP)"

I've tried all combinations between choices above, and nothing works. I have 2 different results. Most of the time, I got a 403 error :


The website declined to show this webpage

 HTTP 403

Most likely causes:

  • This website requires you to log in.

What you can try:


Go back to the previous page.<noscript id="goBack"></noscript>


More information More information<noscript></noscript>

(I suppose that some configuration is missing somewhere, but where ?), or when I select the longest path for the website directory, I get an "Index was outside the bounds of the array" exception.

Line 53: 		<roleManager enabled="true" defaultProvider="CrmRoleProvider">
Line 54: 			<providers>
Line 55: 				<add name="CrmRoleProvider" type="Microsoft.Xrm.Portal.Web.Security.CrmContactRoleProvider"/>
Line 56: 			</providers>
Line 57: 		</roleManager>

Source File: D:\Website\Customer-Portal-R2\Website\web.config    Line: 55

All help would be greatly appreciated.



May 26, 2010 at 11:04 AM

OK, I have found the solution :

The folder to use when creating the IIS website is the longest one : C:\Accelerators\Customer Portal\Installation\Website\Customer-Portal-R2\Website

And the error was caused by a wrong syntax in the connectionStrings part of the web.config file

Now I can display the portal home page :-)


May 26, 2010 at 11:13 AM

Nicolas, can you show right syntax in the connectionStrings part of the web.config file for on-Premise? Do you allow anonymous access? I also get 403 error with C:\Accelerators\Customer Portal\Installation\Website\Customer-Portal-R2\Website path.

May 26, 2010 at 11:21 AM
Edited May 26, 2010 at 12:57 PM

Here are my IIS settings for Authentication Methods :

  • Enable anonymous access
  • Integrated Windows authentication

For the moment, I have access only to the home page (all others return a 404 - File or directory not found error).

Edit : Now i have access to all pages that do not requiere authentication (Home, Event Calendar, Contact Us), but it seems that the link with the CRM is not completly OK. I can modify pages content, but I seen no events in the calendar, and the leads are not created from the contact-us page.

May 26, 2010 at 2:06 PM

The instructions did not include enough information for setting this up on IIS 6.  The reason you do not have access to other pages is that the portal uses a CMS that does url rewriting of content-managed urls.  In order for this feature to function, in IIS 6, you have to configure your 404 errors to redirect to /default.aspx so that ASP.NET can handle all page requests.  This is not necessary in IIS 7, but does take an additional step for IIS 6.  To do this, open your website in the IIS Admin tool and flip to the custom errors page.  Locate the entry for 404 and change the settings from File to Url and set /default.aspx as the url to redirect to.  Once you do that, urls like '/contact-us' will start to work.

And for perspective for other people monitoring this thread:

The website does need to be configured for anonymous access and forms authentication to function.  It also needs to have run scripts, otherwise aspx pages will not function.

The WebsiteCopy utility is a utility that can be used to move CRM content that is used for the portals.  It can be used to move it from a source location to a destination location, and both the source and destination locations can be a CRM instance or an XML file.  It can be used to clone a site on the same CRM as well.  The content is stored in custom CRM entities, and we provide an XML file for the default content of the site in the /installation/Customizations/customerportal.xml file.  The WebsiteCopy utility does NOT do anything with IIS settings - it is simply a data-moving utility.

Yes, the folder that you want to copy to your IIS server and use to set up the website is the /installation/website/Customer-Portal-R2/website folder.

The portal has certain behaviors built into it, including filtering services by ones that have a description of *web*.  The configuration of the CRM for portal operations is covered in the documentation/Customer Portal Functionality and Administration Guide_V1.0.doc file.  That said, the portal itself is open source and is designed for you to be able to inspect the pages and make any adjustments that you want to have.  If you don't want the portal to filter services by *web* in the description, or if you have your own logic to filter the services listed in the portal, simply change the code.  I recommend that everyone looks at the code and becomes familiar with it.

Shan McArthur

May 26, 2010 at 2:34 PM

Thanks for detail response, Shan. But I get 403 (This website requires you to log in.) error. What shoul I do?

May 26, 2010 at 2:41 PM

A 403 error indicates that you probably don't have the IIS website set up properly.  It requires anonymous authentication to function.  Are you using Windows 2003 Server (IIS6) or Windows 2008+ (IIS 7)?  I would also recommend that you examine where you extracted the website files to, which application pool (and process identity) that is used to host the site, and examine the file permissions on the website files to validate that the process has the required permissions to host the site.


May 26, 2010 at 3:22 PM

I use 2003 Server SP1 with IIS6. Anonymous access allowed. I use DefaultAppPool. I'll try to set up IIS 7.0

May 28, 2010 at 5:24 PM

I'm getting the same error mentioned above where:

Source Error:

Line 53: 		<roleManager enabled="true" defaultProvider="CrmRoleProvider">
Line 54: 			<providers>
Line 55: 				<add name="CrmRoleProvider" type="Microsoft.Xrm.Portal.Web.Security.CrmContactRoleProvider"/>
Line 56: 			</providers>
Line 57: 		</roleManager>

Source File: C:\inetpub\wwwroot\PortalTest\web.config Line: 55

What needed to be changed to fix this?
May 28, 2010 at 5:37 PM


The actual error is being masked.  When the process is starting up while it is servicing the first request, it is validating the locations restrictions in the bottom of the web.config, and that in turn restricts use to particular locations in the site based on role providers, so then it instantiates the role provider.  This means that the first time the portal assembly is used is in the context of the role provider.  If there are any technical difficulties, it surfaces as a role provider error, but it really doesn't have anything to do with the role provider.  I usually recommend either attaching to the process with Visual Studio debugger, or if that is not an option, comment out the role provider and refresh the site until you see a real error message, which usually will then tell you what is really wrong.  Once you resolve that problem, remember to put the role provider back in the web.config.

If I could see the real error message (not one about the role provider), that would be helpful in diagnosing your configuration issue.

Shan McArthur

May 28, 2010 at 6:14 PM

This is what I get now:

Server Error in '/' Application.


Index was outside the bounds of the array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
   Microsoft.Xrm.Portal.Data.Services.CrmDataContextFactory.Create(Type contextType, String name) +425
   Microsoft.Xrm.Portal.Cms.WebsiteSelectors.NameWebsiteSelector.GetWebsitesByName(String name) +67
   Microsoft.Xrm.Portal.Cms.WebsiteSelectors.NameWebsiteSelector.GetWebsite() +27
   Microsoft.Xrm.Portal.Web.SiteContext.get_Website() +44
   Microsoft.Xrm.Portal.Web.SiteContextModule.RewritePath(Object sender, EventArgs args) +1616
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171


Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016

May 28, 2010 at 6:19 PM

Did you import the CRM customizations into your CRM yet?  And after that, import the data using the WebsiteCopy utility?

The error looks like it is either an error locating the website entity (and why I ask if it is in your CRM), or it looks like a connection string issue.  If you think you have the customizations and data imported into your CRM, please send me your connection string (but obfuscate the username and password).


May 28, 2010 at 6:27 PM

I did import all of the customizations/workflow/sitemap/isvconfig  (All show in CRM now)

I also did the websitecopy (kind of a pain, but eventually I got it)

(Website Entity is in the customizations)

Here is the connection string:

  <add name="Xrm" connectionString="Authentication Type=AD; Server=; User; Password=xxx" />
    <add name="Live" connectionString="Application Id=000000004C02F93C; Secret=55R4nEiF4QuazkKR4xHUVn9aoKSfvsyn" />

May 28, 2010 at 8:08 PM

Tried running the  websitecopy again, just to be sure it ran, but it told me that the wesite already exists.

Aug 24, 2010 at 12:07 AM

I am having the identical problem as bensonk2 on a Windows 2008 Server (32-bit) using IIS 7.  Was this problem ever resolved?