<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fredrik Haglund's blog &#187; EPiServer 5</title>
	<atom:link href="http://blog.fredrikhaglund.se/blog/tag/episerver-5/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fredrikhaglund.se</link>
	<description>Chatter about EPiServer, ASP.NET, CSS and Web Development.</description>
	<lastBuildDate>Tue, 28 Jun 2011 13:37:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>EPiServer CMS: How to configure Remote Events with many servers and Firewalls between them</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:40:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[enableRemoteEvents]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[RemoteEventsBinding]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</guid>
		<description><![CDATA[The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate [...]]]></description>
			<content:encoded><![CDATA[<p>The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. </p>
<p>This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate cache, the other web sites can potentially return old versions of a page!</p>
<h3>Pitfall – Default configuration is using Multicast UDP!</h3>
<p>If you read <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Configuring-EPiServer-CMS-5-R2-SP2-Enterprise/">Configuring EPiServer CMS 5 R2 SP2 Enterprise</a> you will learn that all you have to do is to set <code>enableRemoteEvents=&quot;true&quot;</code> in <em>web.config</em>. </p>
<p>It is only mentioned briefly that it is using UDP and you may have to change your firewall settings. Too be more specific the default configuration is using multicast UDP broadcast! Tell this to your network guys and watch their reaction&#8230;</p>
<p>If you look around you will also find a tech note about the <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Event-Management-System-Specification/">Event Management System Specification</a> and a FAQ about <a href="http://world.episerver.com/FAQ/Items/Multicast-UDP-not-working/">setting up a server to use TCP protocol</a> but not all clues needed are found there – you have to dig with the reflector to find out the rest.</p>
<h3>Scenario: 4 start pages, 8 Front-end servers IN DMZ and 2 in LAN</h3>
<p>You can change how the Event Management System communicates by changing WCF settings in <em>web.config</em>. It is possible to use TCP instead of UDP and also specify ports to use.</p>
<p>First, the current release (5 R2 SP2) does not support WCF Port Sharing so we need one port opened in the firewall for each start page (that is when you have several <em>siteSettings</em>-tags in web.config).</p>
<p>In our case we need to get four ports (for example port 13000-13003) opened in the firewall for TCP traffic between servers in DMZ and LAN.</p>
<p>Use the sample configuration below as a template to get it to work. In production I suggest using <em>configSource</em>-attribute in <em>web.config</em> to keep the WCF-settings in separate files.</p>
<h4>Web.Config</h4>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">services </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.services.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">client </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.client.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
        &lt;!--</span><span style="color: green">TODO: the option should be only in test environment true in the production should be false</span><span style="color: blue">--&gt;
        &lt;</span><span style="color: #a31515">serviceDebug </span><span style="color: red">includeExceptionDetailInFaults</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">binding </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">security </span><span style="color: red">mode</span><span style="color: blue">=</span>&quot;<span style="color: blue">None</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">binding</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.services.config</h4>
<p>Use this to configure WCF Services (listens to incoming messages). Setup one service for each EPiServer site-tag.</p>
<ul>
<li>Name should be unique. </li>
<li>Name must be the value of episerver/sites[siteid] plus &quot;/EPiServer.Events.Remote.EventReplication&quot;, i.e. if siteId is “sss.se” then name should be “sss.se/EPiServer.Events.Remote.EventReplication”. </li>
<li>Each site must use a diffrent port in services/service/endpoint[address]. </li>
<li>Use &quot;localhost&quot; in the address attribute to bind to all NIC on the machine. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">services</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.client.config</h4>
<p>And each server that changes the content must also be aware of where to send notifications so we must list all servers and websites. </p>
<ul>
<li>Name should be unique. </li>
<li>It is better if address contains IP-addresses than hostnames. </li>
<li>There should be one endpoint for each website on a server where port number matches the ports used in the services/service/endpoint[address]. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">client</span><span style="color: blue">&gt;
  &lt;!-- </span><span style="color: green">SERVER1 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">SERVER2 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">Repeat pattern above for all other servers and sites </span><span style="color: blue">--&gt;
&lt;/</span><span style="color: #a31515">client</span><span style="color: blue">&gt;</span></pre>
<p>Good luck! And let me know if this helps you or if you get stuck&#8230;</p>
<p><em>Credits to Petter Klang at EPiServer Support and Shahram Shahinzadeh on the backend dev team that has been helping us out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>EPiServer: &#8216;The virtual path could not be loaded&#8217; error when registering Web Parts in admin mode</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 14:29:14 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[Web Parts]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/</guid>
		<description><![CDATA[So you have created some web parts and they work fine on your test machine but when you want to register them on a test or production machine you only get a uninformative &#8216;The virtual path could not be loaded&#8217;. I guess you have already checked that the path is correct several times and that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image.png"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 5px 10px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image-thumb.png" border="0" alt="image" width="240" height="130" align="right" /></a>So you have created some web parts and they work fine on your test machine but when you want to register them on a test or production machine you only get a uninformative &#8216;The virtual path could not be loaded&#8217;.</p>
<p>I guess you have already checked that the path is correct several times and that you have deployed all DLL&#8217;s and ASP.NET files. What is wrong?</p>
<h3>LoadControl() parses and compiles your markup</h3>
<p>A quick look with reflection reveals the LoadControl() is called to verify that the web part really exists. When you ask ASP.NET for a user control it will parse the ASCX-file, generate code and then compile it.</p>
<p>So there is a lot that can go wrong and all exceptions from this process is swallowed by the user interface and replaced with virtual path could not be loaded.</p>
<p>A good way to actually see the exception is to create a dummy aspx file and register all user controls and reference them from markup. When you try to view the aspx file any compilation error from the user controls will surface.</p>
<h3>Examine compile and pages tag in your web.config</h3>
<p>The most common reason markup works fine on one machine but not another is differences in web.config. Check the compilation and pages tag and compare them for differences between the machines.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access Dynamic Properties when PageData is writable</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/05/28/access-dynamic-property/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/05/28/access-dynamic-property/#comments</comments>
		<pubDate>Wed, 28 May 2008 10:34:24 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[CreateWritableClone]]></category>
		<category><![CDATA[Dynamic Property]]></category>
		<category><![CDATA[DynamicProperty]]></category>
		<category><![CDATA[DynamicPropertyTree]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[FindDynamicProperty]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=153</guid>
		<description><![CDATA[One of the big changes between EPiServer CMS 4 and 5 is the handling of PageData instances and Dynamic Properties (read Inherited Property) in the cache. I was reminded of this when I created a custom property and needed access to a Dynamic Property but I always got a null value. In EPiServer CMS 5 [...]]]></description>
			<content:encoded><![CDATA[<p>One of the big changes between EPiServer CMS 4 and 5 is the handling of PageData instances and Dynamic Properties (read Inherited Property) in the cache. I was reminded of this when I created a custom property and needed access to a Dynamic Property but I always got a null value.</p>
<p>In EPiServer CMS 5 you will always get a read-only PagaData instance and if you want to modify it you have to call <em>CurrentPage.<strong>CreateWritableClone</strong>(</em>) to get an instance that you can modify.</p>
<h3>Read Dynamic Propety value returns null</h3>
<p>On the read-only version you can always write <em>CurrentPage["MyDynamicProperty"]</em> or <em>CurrentPage.Property["MyDynamicProperty"]</em> to easily get hold of the inherited value. But if you try to do that on a writable <em>PageData</em> instance it will not work and you will always get null back.</p>
<p>In my case when I want the value of a dynamic property in a custom property controller it always returned null because in when you are editing the page your PageData instace is writable.</p>
<h3>Using DynamicPropertyTree to FindDynamicProperty</h3>
<p>You can retreive the value of a Dynamic Property with the same method that a read-only PageData use if you need it while modifying a page. </p>
<p><span style="font-size: x-small; color: #008080;">PageReference</span><span style="font-size: x-small;"> locationRef = </span><span style="font-size: x-small; color: #008080;">DynamicPropertyTree</span><span style="font-size: x-small;">.Instance.FindDynamicProperty(</span><span style="font-size: x-small; color: #800000;">&#8220;MyDynamicProperty&#8221;</span><span style="font-size: x-small;">, CurrentPage.Property).Value </span><span style="font-size: x-small; color: #0000ff;">as</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #008080;">PageReference<span style="color: #000000;">;</span></span></p>
<h3>Change a Dynamic Property from code</h3>
<p>If you need to change a Dynamic Property from code use the class EPiServer.DataAbstraction.DynamicProperty:</p>
<pre>DynamicProperty myDynProp = DynamicProperty.Load(CurrentPage.PageLink, "MyDynamicProperty");
myDynProp.LanguageBranch = "sv"; //Only if you have unique values per languge
myDynProp.PropertyValue.Value = "My Value";
myDynProp.Save();</pre>
<p>You will also find method like ListForPage(PageReference pageLink) that returns a list of all Dynamic Properties for a given page. DO NOT USE that method in when you just want to read a value! Use you PageData class instead for faster access.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/05/28/access-dynamic-property/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable EPiServer UrlRewriter Interference</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/05/07/disable-episerver-urlrewriter-interference/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/05/07/disable-episerver-urlrewriter-interference/#comments</comments>
		<pubDate>Wed, 07 May 2008 13:07:59 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[HtmlAddingRewriteToExternalFilter]]></category>
		<category><![CDATA[StarCommunity]]></category>
		<category><![CDATA[trace.axd]]></category>
		<category><![CDATA[UrlRewriteModule]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=128</guid>
		<description><![CDATA[Are you also annoyed that EPiServer CMS 5 Friendly URLs and the handy trace.axd utility does not play well together? Does your site have standard aspx-pages that behaves strangely sometimes because EPiServer Friendly URL Rewriter interfere with generated html on the way out? StarCommunity does not work EPiServer Friendly URL Rewriter I had this issue [...]]]></description>
			<content:encoded><![CDATA[<p>Are you also annoyed that EPiServer CMS 5 Friendly URLs and the handy <strong>trace.axd </strong>utility does not play well together? Does your site have standard aspx-pages that behaves strangely sometimes because EPiServer Friendly URL Rewriter interfere with generated html on the way out?</p>
<h3>StarCommunity does not work EPiServer Friendly URL Rewriter</h3>
<p>I had this issue with StarCommunity 2.4 from NetStar (now bought by EPiServer) and you could get the most strange side effects in the admin interface with tabs not working, layout issues and navigational problems. All issues disappear if you disabled EPiServer Url Rewriting.</p>
<p>So how can you keep EPiServer Url Rewriting on but disable it for a folder or file? This is how I solved it by adding a few lines in <strong>Global.asax.cs</strong>:</p>
<div>
<pre><code>private void UrlRewriteModule_HttpRewriteInit(objectsender, UrlRewriteEventArgs e)
{
    UrlRewriteModuleBase module = sender asUrlRewriteModuleBase;
    if (module != null)
    {
        module.HtmlAddingRewriteToExternalFilter += module_HtmlAddingRewriteToExternalFilter;
    }
}
private void module_HtmlAddingRewriteToExternalFilter(objectsender, UrlRewriteEventArgs e)
{
    string path = e.Url.Path.ToLowerInvariant();
    e.Cancel = path.StartsWith("/netstar") || path.EndsWith("trace.axd");
}
protected void Application_Start(Object sender, EventArgs e)
{
    EPiServer.Web.UrlRewriteModule.HttpRewriteInit += UrlRewriteModule_HttpRewriteInit;
}
</code></pre>
</div>
<p>As you can see when the application starts it hooks into an event that hooks into another event that has the possibility to prevent Rewrite. Here we check if the requested URL is either starting with &#8220;/netstar&#8221; disabling rewrite for everything in the StarCommunity admin folder. It also cancels if it is a call to the trace utility.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/05/07/disable-episerver-urlrewriter-interference/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enable debug logging for EPiServer Scheduler</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 18:02:54 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer.SchedulerSvc.exe.config]]></category>
		<category><![CDATA[Publish Delayed Page Versions]]></category>
		<category><![CDATA[Scheduled Jobs]]></category>
		<category><![CDATA[ScheduledPlugIn]]></category>
		<category><![CDATA[ScheduledPlugInAttribute]]></category>
		<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/</guid>
		<description><![CDATA[If you have problems with the EPiServer Scheduler Service unexcitingly stopping you can also turn on debug logging to get more clues. Change EPiServer.SchedulerSvc.exe.config FILE You need to add the following to the service&#8217;s config-file to get detailed call stacks for exceptions that occur in you web application: &#60;system.runtime.remoting&#62;   &#60;customErrors mode="Off"/&#62; &#60;/system.runtime.remoting&#62; Update EPiServer.SchedulerSvc [...]]]></description>
			<content:encoded><![CDATA[<p>If you have problems with the EPiServer Scheduler Service unexcitingly stopping you can also turn on debug logging to get more clues.</p>
<h3>Change <em>EPiServer.SchedulerSvc.exe.config</em> FILE</h3>
<p>You need to add the following to the service&#8217;s config-file to get detailed call stacks for exceptions that occur in you web application:</p>
<p><code>&lt;system.runtime.remoting&gt;<br />
  &lt;customErrors mode="Off"/&gt;<br />
&lt;/system.runtime.remoting&gt;</code></p>
<h3>Update EPiServer.SchedulerSvc Registry</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image3.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb3.png" alt="image" height="126" style="margin: 0px 0px 0px 10px; border-width: 0px" /></a> Prepare a folder for the log file and make sure the account running the service has write access. I&#8217;m usually lazy and give everyone full access since this logging usually is not left on forever.</p>
<p>User RegEdit and change the ImagePath value for the EPiServer Scheduler Service to include a parameter with the log-filename.</p>
<p><code>HKLM\SYSTEM\CurrentControlSet\Services\EPiServer.SchedulerSvc<br />
ImagePath = C:\Program Files\EPiServer.Scheduler\EPiServer.SchedulerSvc.exe D:\Log\EPiServer.SchedulerSvc.log</code></p>
<p><strong>Be careful when you edit the Registry! </strong>I use to export the key to a file before I change anything so I can look at the original configuration.</p>
<p>See also: <a href="http://blog.fredrikhaglund.se/?p=127">Auto Restart of EPiServer Scheduler Service</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Auto Restart of EPiServer Scheduler Service</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 10:49:50 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Publish Delayed Page Versions]]></category>
		<category><![CDATA[Scheduled Jobs]]></category>
		<category><![CDATA[ScheduledPlugIn]]></category>
		<category><![CDATA[ScheduledPlugInAttribute]]></category>
		<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/</guid>
		<description><![CDATA[There are several functions in a EPiServer Web Application that rely on the Services installed by EPiServer Manager. For example delayed publish of a new version of a page at a specific time, mirroring of pages between servers, archiving pages that has past the stopped publish date and removing old pages from the waste basket. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb.png" alt="image" height="172" style="margin: 0px 0px 0px 10px; border: 0px" /></a>There are several functions in a EPiServer Web Application that rely on the Services installed by EPiServer Manager. For example delayed publish of a new version of a page at a specific time, mirroring of pages between servers, archiving pages that has past the stopped publish date and removing old pages from the waste basket.</p>
<h3>Requirements for Scheduled Jobs in EPiServer</h3>
<p>Several things must be true for tasks to be executed:</p>
<ul>
<li><strong>The Service must be running<br />
</strong>The service is installed and updated by EPiServer manager but you may have to configure it and setup the in the computers Administrative Tool for Services.</li>
<li><strong>Each EPiServer Web must be allowed to use the Service</strong><br />
There is only one instance of the Service but there might be several Web Applications. Each has a setting that controls if they are allowed <strong><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image1.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb1.png" alt="image" height="172" style="margin: 10px 10px 0px 0px; border: 0px" /></a></strong>to connect to the service or not. This often misunderstood setting is displayed on the Capability page in EPiServer Manager.</li>
<li><strong>Each Job must be active and have a schedule</strong><br />
You must also for each Web Application go to admin mode and enable each Scheduled Job by checking Active and give it a schedule.</li>
</ul>
<h3>The EPiServer Scheduler Service does not appear to be active</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image2.png"><img border="0" align="left" width="240" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb2.png" alt="image" height="196" style="margin: 0px 5px 0px 0px; border: 0px" /></a>If you have satisfied all requirements above and it suddenly stops working it can be an uncaught exception that halts your service.</p>
<p>My recommendation is always to configure the EPiServer Services to automatically restart if it should stop unexpectedly. This can be done from the Recovery Tab in the Properties for each Service.</p>
<h3>Update</h3>
<p>See also: <a rel="bookmark" href="http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/"><font color="#006a80">Enable debug logging for EPiServer Scheduler</font></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>EPiServer Export, Import or Mirror Troubles?</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 16:28:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Disassemble]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[Mirror]]></category>
		<category><![CDATA[PageTypeTransfer]]></category>
		<category><![CDATA[PropertyCategoryTransform]]></category>
		<category><![CDATA[TransformCategoryForExport]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/</guid>
		<description><![CDATA[I have been working a lot with migration and mirroring lately using EPiServer&#8217;s functions for export and import of data. My EPiServer Wish list Show call stack when exceptions halt export or import jobs Show PageID and Property related to errors and warnings during import and export This area of the product is still one [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working a lot with migration and mirroring lately using EPiServer&#8217;s functions for export and import of data.</p>
<div class="insert insertright">
<h3>My EPiServer Wish list</h3>
<ul>
<li>Show call stack when exceptions halt export or import jobs</li>
<li>Show PageID and Property related to errors and warnings during import and export</li>
</ul>
</div>
<p>This area of the product is still one of EPiServer weaker areas mainly because the error massages when something goes wrong does not contain enough information.</p>
<p>I want to share the last issue I run into today and also show how I did to find out what was wrong. We could not export and only got this lovely message:</p>
<p><code>The following errors have occurred: Exception: Object reference not set to an instance of an object.[]</code></p>
<p>As you can see not much to go on here&#8230;</p>
<h3>Strategy to resolve issues with EPiServer Export</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image15.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb3.png" alt="image" height="143" style="border-width: 0px" /></a> First thing you should do is to narrow down what is causing our problems and a call stack can often help. 1) We need to attach your debugger to the web server.</p>
<p>2) We must make sure it halts on thrown exceptions even if it outside our code. Open your options dialog and uncheck&#8221;Enable Just My Code&#8221;.</p>
<p><img border="0" align="left" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb4.png" alt="image" height="127" style="border-width: 0px" />With default settings the debugger will only break on uncaught exceptions.</p>
<p>3) We need the debugger to break when an exceptions are thrown regardless of they are handled by a try-catch statement.</p>
<p>This can be changed in your Exceptions dialog (Ctrl+Shift+E). You can either set it to catch all managed exceptions as I have in the screen shot or if you know what exception you are looking for you can halt on that one alone.</p>
<p>We are now ready to start the export again to trigger the error. If everything is correctly configured it will break on the exception and show you a call stack.</p>
<h3>Analyzing the call stack and Disassembling EPiServer</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image16.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb5.png" alt="image" height="176" style="border-width: 0px" /></a>With a call stack we have more clues to go on. In this case the two methods on top of the call stack gives us valuable clues.</p>
<p>Use <em>Lutz Roeder&#8217;s .NET Reflector</em> and click File&gt;Open to load all assemblies in your web applications bin-folder. Search for the class or method and Disassemble the two methods and get more clues.</p>
<p><code>PropertyCategoryTransform.TransformCategoryForExport<br />
PageTypeTransfer.Export</code></p>
<p>In this case it is probable that calling split on <em>categoriesAsIds</em> when <em>categoriesAsIds</em> is null is the culprit.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image17.png"><img border="0" align="left" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb6.png" alt="image" height="148" style="border: 0px" /></a> Looking at the calling method we can see that it is calling <em>TransformCategoryForExport</em> for <em>PageDefinitions</em> (a <em>PageDefinition</em> is another name for a property on a page type) if it as a Category. It does so to convert the Default Value for a Category property into a string with names instead of integer ids.</p>
<h3>Conclusion and workaround</h3>
<p>It is not possible to export a page type if you add a property of type Category selection (in EPiServer CMS 5 RC1 SP1 5.1.422.122). The reason is that default value is null and an easy workaround is to set the default value to &#8220;1&#8243; for each added Category property. The value &#8220;1&#8243; is the root category.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EPiServer License violation!</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 23:59:03 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer.SchedulerSvc.exe.config]]></category>
		<category><![CDATA[License violation]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/</guid>
		<description><![CDATA[Have you been annoyed by the exception &#8220;License violation! License is already in use at another online site&#8221; when you switch from one web site to another on you developer machine? I have and the reason is of course that I use my developer license file in more than one place. To workaround this problem [...]]]></description>
			<content:encoded><![CDATA[<p>Have you been annoyed by the exception &#8220;<em>License violation! License is already in use at another online site</em>&#8221; when you switch from one web site to another on you developer machine?</p>
<p>I have and the reason is of course that I use my developer license file in more than one place.</p>
<p>To workaround this problem you can always restart <em>EPiServer Scheduler Service </em>and recycle your application with an <em>iisreset.</em></p>
<p>EPiServer appears to use the Scheduler Service for more things than just executing scheduled tasks. It is used when a central communication point is required like when you need to synchronize licenses between web applications&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Available Page Types in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 13:24:59 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Available Page Types]]></category>
		<category><![CDATA[EPiServer 4]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/</guid>
		<description><![CDATA[It is a best practice to limit the number of Pages Types an editor can choose from when the editor creates a new page. As you probably know this is configured in Admin Mode on each Page Type. What you probably don&#8217;t think about is that these settings can make it impossible to import and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb10.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb10-thumb.png" border="0" alt="image_thumb[10]" width="244" height="191" align="right" /></a>It is a best practice to limit the number of Pages Types an editor can choose from when the editor creates a new page.</p>
<p>As you probably know this is configured in Admin Mode on each Page Type. What you probably don&#8217;t think about is that these settings can make it impossible to import and export pages.</p>
<h3>&#8220;Available Page Types&#8221;-rules can break import</h3>
<p>If your rules change over time or if you use Stop Publish and Archive Page so your pages moves around you can get in trouble with these rules.</p>
<p>In the current version (5.1.422.122 SP1) the import will stop with an error and it can be quite hard to figure out what is wrong.</p>
<p>I created a SQL-statement to help you figure out what is wrong. It will give you a list of all pages breaking the &#8220;Available Page Types&#8221;-rules. It lists the Parent and Child&#8217;s Page Id, Page Name and also Page Type.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image14.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb2.png" border="0" alt="image" width="504" height="283" /></a></p>
<p>This (messy) SQL statement for copy paste:</p>
<p><code>SELECT fkParentID AS ParentPageId, pkID AS ChildPageId, (SELECT Name FROM tblPage AS p2 WHERE (pkID = p.fkParentID)) AS ParentPageName, Name AS ChildPageName, (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID)) AS ParentPageTypeId, fkPageTypeID AS ChildPageTypeId FROM tblPage AS p WHERE (NOT EXISTS (SELECT fkPageTypeParentID, fkPageTypeChildID, Access FROM tblPageTypeToPageType AS tt WHERE (fkPageTypeParentID = (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID))) AND (fkPageTypeChildID = p.fkPageTypeID))) AND EXISTS (SELECT fkPageTypeParentID, fkPageTypeChildID, Access FROM tblPageTypeToPageType AS tt WHERE (fkPageTypeParentID = (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID)))) </code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Archive Page can create strange exceptions</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 10:54:37 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Archive page]]></category>
		<category><![CDATA[EPiServer 4]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/</guid>
		<description><![CDATA[If you export pages that have the Build-in property Archive Page set pointing to a page that is not included in your export package you will get an exception. At least if you are migrating from EPiServer 4 to 5.1. Use the following script if you want to clear all the value of Archive page [...]]]></description>
			<content:encoded><![CDATA[<p>If you export pages that have the Build-in property Archive Page set pointing to a page that is <em>not included</em> in your export package you will get an exception. At least if you are migrating from EPiServer 4 to 5.1.</p>
<p>Use the following script if you want to clear all the value of Archive page on all pages in your source database:</p>
<p><code>UPDATE tblPageTypeDefault<br />
SET fkArchivePageID = NULL</code></p>
<p>Remember to do a iisreset to invalidate all cached information after you change in the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tuning and Optimization of EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 15:17:08 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Application Pool]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[DataFactory]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[memoryLimit]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/</guid>
		<description><![CDATA[There are many factors to look at when you want to tune the performance of your EPiServer site. This is the first post about common pitfalls and how to optimize EPiServer for performance. EPiServer and Memory First thing to check is that you have enough memory. EPiServer needs a lot of memory to cache the [...]]]></description>
			<content:encoded><![CDATA[<p>There are many factors to look at when you want to tune the performance of your EPiServer site. This is the first post about common pitfalls and how to optimize EPiServer for performance.</p>
<h3>EPiServer and Memory</h3>
<p>First thing to check is that you have enough memory. EPiServer needs a lot of memory to cache the PageData object for each of all active pages on the site. The larger site (more pages) you have, the more memory you will need.</p>
<p>The <code>DataFactory</code> class will first look if the requested page or list of pages is in the cache when you call <code>GetPage()</code> or <code>GetChildren()</code>. If it is not in the cache, the page or list will be loaded from the database and added to the cache. The default implementation (<a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/EPiServer-CMS-5-SP1/Pluggable-Runtime-Cache/">read more about pluggable runtime cache</a>) uses ASP.NET&#8217;s built-in public cache to store pages and lists in memory.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/episerver-database-cache-usage.png" title="EPiServer Database Cache Usage"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/episerver-database-cache-usage.thumbnail.png" alt="EPiServer Database Cache Usage" class="imageright" /></a>The public cache in ASP.NET is also used to store other data in addition to EPiServer PageData and Lists. Periodically ASP.NET will use a Least Recently Used (LRU) algorithm to scavenge the cache for more space. If the memory pressure is very high the lifetime of cached items can be very short or even zero (not added at all). This is not good for EPiServer&#8217;s performance.</p>
<p>It is easy to see what&#8217;s inside your cache:</p>
<pre><code><span style="color: blue; ">protected</span><span style=""> <span style="color: blue">void</span> Page_Load(<span style="color: blue">object</span> sender, <span style="color: #2b91af">EventArgs</span> e)
</span><span style="">{
</span><span style=""><span>    </span><span style="color: blue">foreach</span> (<span style="color: #2b91af">DictionaryEntry</span> d <span style="color: blue">in</span> <span style="color: blue">this</span>.Cache)
</span><span style=""><span>    </span>{
</span><span style=""><span>        </span>Response.Write(d.Key);
</span><span style=""><span>        </span>Response.Write(<span style="color: teal">" - "</span>);
</span><span style=""><span>        </span>Response.Write(d.Value);
</span><span style=""><span>        </span>Response.Write(<span style="color: teal">"&lt;hr&gt;"</span>);</span><span style=""><span>
</span></span><span style=""><span>    </span>}
</span><span style="">}</span><span></span></code></pre>
<p>A very good indicator if Memory is an issue is to look at some statistics from the DataFactory class. You can see the <em>Cache hit rate</em> if you go to admin mode. <strong>It should be close to 100%</strong> or maybe a few percent below. (It is normal that it drops to zero when you restart the site but it should climb fast.) A constant low value is one indicator that you need more memory because PageData objects are thrown out of the cache and then they must be reloaded from the database.<a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/add-episerver-performance-counters.png" title="Add EPiServer Performance Counters"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/add-episerver-performance-counters.thumbnail.png" alt="Add EPiServer Performance Counters" class="imageleft" /></a>You can also see the <em>Cache Hit Ratio</em> (and some other counters) through Windows Performance Monitor. This is a good value to monitor in a hosting environment and add an alert when the value becomes to low.</p>
<h3>ASP.NET Worker Process / Application Pool</h3>
<p>The maximum memory ASP.NET allows a worker process to consume before it is recycled is by default 60% of the total system memory. <a href="http://msdn2.microsoft.com/en-us/library/7w2sway1.aspx">Read more about memoryLimit tag</a>.<br />
<code><br />
&lt;system.web&gt;<br />
  &lt;processModel&gt;<br />
    &lt;memoryLimit&gt;60&lt;/memoryLimit&gt;<br />
  &lt;/processModel&gt;<br />
&lt;/system.web&gt;<br />
</code><br />
<strong>Default Application Pool</strong> &#8211; Do not use it and do NOT delete it (even if you plan to never use it). Create your own pool instead but not create one pool for each site on the web server. Instead consolidate your applications into one pool and only use a separate pool for troublesome web applications. You must have separate pools for ASP.NET 1.1 and 2.0 applications though.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-recycling.png" title="Application Pool Recycling"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-recycling.thumbnail.png" alt="Application Pool Recycling" class="imageright" /></a>You can also configure the application pool to recycle if it consumes to much memory. If you <strong>worker process constantly recycles</strong> you need to find out why because EPiServer will always be a little bit sluggish after a restart (before data is cached again). You also loose all in-process session data when the process restarts which is an issue of its own.</p>
<p><strong>Settings</strong>: I recommend that you uncheck &#8220;Recycle worker process (in minutes)&#8221; and use &#8220;Recycle worker process at the following times&#8221; instead.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-performance.png" title="Application Pool Performance"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-performance.thumbnail.png" alt="Application Pool Performance" class="imageleft" /></a> You should also uncheck &#8220;Shutdown worker process after being idle&#8221;. This is very important for EPiServer sites that has a low traffic (for example during the night).</p>
<p><strong>Do not use Web Garden</strong> unless you know what you are doing. It will require double memory for the cache and out of process state-handling. If you change the number of worker processes from 1 to 2 it is like having two web servers on the same box with IIS acting like load balancer. (It is a cheap way in a development environment to test how you application will behave in a farm with load balancing.)</p>
<h3>MSSQL Server and EPiServer</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/mssql-server-properties-memory.png" title="MSSQL Server Properties Memory"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/mssql-server-properties-memory.thumbnail.png" alt="MSSQL Server Properties Memory" class="imageright" /></a>Its a best practice to have two machines, one for the web server and one for the database. But sometimes you have to run the database on the same machine as the web server. If you do, it is important to remeber that the MSSQL Server competes with the Web Server for resources like memory. You should <strong>always limit the amount of memory the database can use</strong> because it is better for EPiServer to have data cached in the web application than in the database.</p>
<p>Usually the usage of the database is low (around 5% CPU) in EPiServer scenarios because EPiServer tries to cache what it needs in the web application. If you have a higher usage of the database this can be an indication of that caching does not work as it should in the web application but it could also indicate that you do something else wrong. (More about database issues in a later post.)</p>
<h3>Other processes</h3>
<p>Finally, do not forget to have use the ordinary task manager to check if you have other processes that compete for the memory on your web server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Configure EPiServer File Manager</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 20:03:07 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[File Manager]]></category>
		<category><![CDATA[Page Folder]]></category>
		<category><![CDATA[PageFolderID]]></category>
		<category><![CDATA[pageFolderVirtualPathProvider]]></category>
		<category><![CDATA[showInFileManager]]></category>
		<category><![CDATA[Unified File System]]></category>
		<category><![CDATA[Virtual Path Providers]]></category>
		<category><![CDATA[virtualPath]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/</guid>
		<description><![CDATA[I got a question about the File Manager from one of the attendees on my last EPiServer Developer training and I will share my answer with you. You control the name, order and number of starting points in the File Manager for EPiServer CMS 5 by adding or removing Virtual Path Provides in web.config. &#60;virtualPath [...]]]></description>
			<content:encoded><![CDATA[<p>I got a question about the File Manager from one of the attendees on my last EPiServer Developer training and I will share my answer with you.</p>
<p>You control the name, order and number of starting points in the File Manager for EPiServer CMS 5 by adding or removing Virtual Path Provides in web.config.</p>
<pre><code>&lt;virtualPath customFileSummary="~/FileSummary.config"&gt; 

  &lt;providers&gt;  

    &lt;add showInFileManager="false" virtualName="Page Files" virtualPath="~/PageFiles/" ... /&gt;  

    &lt;add showInFileManager="true" virtualName="Global Files" virtualPath="~/Global/" ... /&gt;  

    &lt;add showInFileManager="true" virtualName="Documents" virtualPath="~/Documents/"... /&gt;  

</code></pre>
<p>The virtualName is what you see in the File Manager.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/filemanager.png" title="EPiServer File Manager"><img width="100%" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/filemanager.png" alt="EPiServer File Manager" /></a></p>
<p>You can hide providers from the File Manager by changeing the showInFileManager attribute to false but these providers will still be available from code. This can be usefull for generated thumbnail and similar.</p>
<p>If you open the File Manager without a page selected the first visible provider in the list will get focus.</p>
<p>There is usually a current page when you open the file manager in edit mode (either in the action window or as a modal dialog) and you will always see the page folder or get a question if you want to create a new page folder if it does not exist. There is currently no way to disable page folders in the current (5.1.422) release as far as I know.</p>
<p>Which Virtual Path Provider that is used to store Page Folders is also controlled in web.config.</p>
<pre><code>&lt;episerver ...&gt; 

  &lt;sites&gt;  

    &lt;site ...&gt;  

      &lt;siteSettings ... pageFolderVirtualPathProvider="SitePageFiles" ... /&gt;  

</code></pre>
<p>A common mistake is to mix up the Page ID and the Page&#8217;s Folder ID. They are two separate number sequences and there is a property on the PageData obeject that stores the folder id for each page.</p>
<pre><code>CurrentPage.Property["PageFolderID"].Value  

</code></pre>
<p>Follow this link to see more <a href="http://blog.fredrikhaglund.se/blog/2007/12/05/episerver-using-the-new-unified-file-system/">examples on how to use EpiServers Unified File System</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Properties with Special Functionality in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 14:36:26 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer Property]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=44</guid>
		<description><![CDATA[In addition to the build-in properties on EPiServer pages there are some additional user defined properties that have a special function from EPiServers point of view. As a beginner to EPiServer it is easy to miss this so after teaching new developers this week I thought I should hunt the down and make a list. [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to the build-in properties on EPiServer pages there are some additional user defined properties that have a special function from EPiServers point of view. As a beginner to EPiServer it is easy to miss this so after teaching new developers this week I thought I should hunt the down and make a list.</p>
<p>The property can either be defined directly on a page type or as a dynamic property so the value it can be inherited in a branch of the page tree. It is possible to both define properties as a dynamic and on page types. In this case the value on the page is used first.</p>
<table border="1">
<tr>
<th>Context</th>
<th>Property name</th>
<th>Description</th>
</tr>
<tr>
<td vAlign="top">XHtml Editor,<br />
XForms Editor</td>
<td vAlign="top">UIEditorCssPaths</td>
<td vAlign="top">Comma separated list of css-files that is used in the xhtml editor. Each path should start with ~ to be relative to the application root. If there is no value set on the page or in a dynamic property it falls back to a setting on the siteSettings tag in web.config.The editor and some of it&#8217;s supporting dialogs is using the css-files to populates the class drop down list. EPiServer has a parser in javascript that looks for a special attribute &#8216;EditMenuName&#8217; that is used as the human readable name for a style.</td>
</tr>
<tr>
<td vAlign="top">PageTemplateContainer PreviewText</td>
<td vAlign="top">MainIntro, MainBody</td>
<td vAlign="top">The PreviewText function is used to get a short description of the text. It takes the value from MainIntro and falls back to MainBody if it is blank. All html tags in MainBody is removed and only the first 400 characters is used.(PreviewText is using a regular expression to trim html tags and this can take some time if all pages in a long listing is missing MainIntro. Worth considering if you have performance issues with a listing.)</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">MainIntro, MainBody</td>
<td vAlign="top">Properties expected on each page that should be subscribeable. MainInto and MainBody is used when generating the e-mail.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">EPSUBSCRIBE-EXCLUDE, EPSUBSCRIBEHIDDEN, EPSUBSCRIBE</td>
<td vAlign="top">EPSUBSCRIBE, EPSUBSCRIBEHIDDEN and EPSUBSCRIBE-EXCLUDE is used in diffrent parts of the Subscription mail mechanism and I have to write another blog post about the exact function of them.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionDataSource</td>
<td vAlign="top">EPSUBSCRIBE-ROOT</td>
<td vAlign="top">Defines the startpage for SubscriptionDataSoruce.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">MailReadMore, MailSubject, MailFrom</td>
<td vAlign="top">Properties expected to be present on the subscription page that controls the sent message.</td>
</tr>
<tr>
<td vAlign="top">Calendar</td>
<td vAlign="top">ValidDays, EventStartDate,<br />
EventStopDate</td>
<td vAlign="top">The Calendar WebControl can create a list of all events between two dates. Event pages must have EventStartDate and EventStopDate to be included. ValidDays are optional but can be used to filter on which days a recurring event should be listed.</td>
</tr>
<tr>
<td vAlign="top">XForms</td>
<td vAlign="top">DefaultFormFolder</td>
<td vAlign="top">This is usually a dynamic property used to make life simpler for editors. You can organise your XForms into folders and if this property exists it will open the XForms editor with the folder matching the value as select.</td>
</tr>
<tr>
<td vAlign="top">SearchDataSource</td>
<td vAlign="top">PageRank, IconPath, MainIntro</td>
<td vAlign="top">This is read-only properties on the pages returned by a SearchDataSource.If you enable search in files temporary PageData objets are created for files that includes PageName for filename, PageChanged for when the file was uploaded and PageLinkUrl for the link to the file.</td>
</tr>
<tr>
<td vAlign="top">SiteMapProvider</td>
<td vAlign="top">PageSiteMapProvider</td>
<td vAlign="top">Used to get a SiteMapProvider from a Page. The name should match a SiteMapProvider defined in web.config.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">IsDocumentPageType</td>
<td vAlign="top">Controls if the client application should upload a copy of the original document. This will also be sent to the convert scripts that will skip building a rich HTML version if this property has not been set.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentInternalPath</td>
<td vAlign="top">If the IsDocumentPageType is set, this property will contain the path to the uploaded source document.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentInternalHtmlPath</td>
<td vAlign="top">If the IsDocumentPageType is set, this property will contain the path to the starting point for the rich HTML version.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentExternalPath</td>
<td vAlign="top">The path to the location of the source document may be used, for example, by other editors to see which document was used to publish this page.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">AllowDocumentUpdate</td>
<td vAlign="top">Controls if the client application should add properties to the word document so that the user can republish the document.</td>
</tr>
</table>
<p>This list does not include properties used by the public templates. I&#8217;m pretty sure I missed some properties so please, write a comment if you know of anyone I missed!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t find provider capability information for provider [XYZ]</title>
		<link>http://blog.fredrikhaglund.se/blog/2007/09/28/cant-find-provider-capability-information-for-provider-xyz/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2007/09/28/cant-find-provider-capability-information-for-provider-xyz/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 20:17:50 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Membership Provider]]></category>
		<category><![CDATA[ProviderCapabilitySettings]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=42</guid>
		<description><![CDATA[I noticed that there is a problem with using ASP.NET membership providers in EPiServer CMS (5.1.422). When going to edit mode you get the following exception: [EPiServerException: Can't find provider capability information for provider [XYZ].] EPiServer.Security.ProviderCapabilities.IsSupported(String providerName, Action action) +117 EPiServer.UI.Edit.UserMembership.EnableFields() +418 EPiServer.UI.Edit.UserMembership.OnLoad(EventArgs e) +1201 The reason is because EPiServer only has hardcoded the capabilites [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that there is a problem with using ASP.NET membership providers in EPiServer CMS (5.1.422). When going to edit mode you get the following exception:</p>
<p><code>[EPiServerException: Can't find provider capability information for provider [XYZ].]<br />
EPiServer.Security.ProviderCapabilities.IsSupported(String providerName, Action action) +117<br />
EPiServer.UI.Edit.UserMembership.EnableFields() +418<br />
EPiServer.UI.Edit.UserMembership.OnLoad(EventArgs e) +1201</code></p>
<p>The reason is because EPiServer only has hardcoded the capabilites for some of the default providers name like this:</p>
<p><code>static ProviderCapabilities()<br />
{<br />
_providerDictionary = new Dictionary();<br />
_providerDictionary.Add("SqlServerMembershipProvider", new ProviderCapabilitySettings(true, true, true, new object[] { "email", true, "comment", true }));<br />
_providerDictionary.Add("WindowsMembershipProvider", new ProviderCapabilitySettings(false, false, false, new object[] { "email", true, "comment", false }));<br />
_providerDictionary.Add("SqlServerRoleProvider", new ProviderCapabilitySettings(true, true, true));<br />
_providerDictionary.Add("WindowsRoleProvider", new ProviderCapabilitySettings(false, false, false));<br />
}</code></p>
<p>To get it to work if you have providers with other names you must obviously register them manually (at least until EPiServer provides a better sollution) in Global.asax.cs. This is how I did it:</p>
<p><code>private void RegisterCapabilitiesOnMembershipProviders()<br />
{<br />
string defaultMembershipProviderName = ProviderFacade.GetDefaultMembershipProviderName();<br />
string defaultRoleProviderName = ProviderFacade.GetDefaultRoleProviderName();</code><code>ProviderCapabilities.AddProvider(defaultMembershipProviderName, new ProviderCapabilitySettings(false, false, false, new object[] { "email", true, "comment", false }));<br />
ProviderCapabilities.AddProvider(defaultRoleProviderName, new ProviderCapabilitySettings(false, false, false));<br />
}</code><code>protected void Application_Start(Object sender, EventArgs e)<br />
{<br />
RegisterCapabilitiesOnMembershipProviders();<br />
}</code></p>
<p><strong>Update:</strong> <a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/Release-Notes/Release-Notes---EPiServer-CMS-5-SP1/">This has changed in SP1 so it uses the class type and not the name.</a> So a rename of a provider does not require registration but you must register capabilities if you write your own.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2007/09/28/cant-find-provider-capability-information-for-provider-xyz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

