Thursday, April 15, 2010

Ducatshell error

Often I encounter error with Ducatshell error. Problem is caused when the permission inherited to sitecore folder is insufficient.

The security that is normally missing is the ISS application pool security

For example, if we have website.localhost as our application pool name,

the security will be : IIS APPPool\website.localhost

The following bat file will apply the security defined as a parameter to folders that generally requires special security permission

icacls WebSite\sitecore\shell\Applications\debug /grant %1:(OI)(CI)M
icacls WebSite\sitecore\shell\Controls\debug /grant %1:(OI)(CI)M
icacls WebSite\sitecore\shell\Override /grant %1:(OI)(CI)M
icacls WebSite\temp /grant %1:(OI)(CI)M
icacls WebSite\upload /grant %1:(OI)(CI)M
icacls Data /grant %1:(OI)(CI)M

To execute the bat file. The following steps are to be taken.

1. Place the bat file on the same folder as the webroot. that is essentially the bat file is a sibling file of webroot
2. Open up Command prompt in admin mode
3. Navigate to the bat file
4. Type in -> .bat "iis apppool\website.localhost"
5. Enter

Thursday, April 8, 2010

WCF - Issues with multiple host header

Often you encounter WCF error such as below:

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item


This issue is caused of multiple host header define in IIS settings. There are number of solution to this, one of them is creating custom ServiceHostFactory or another simpler solution is to configure the settings as below

directly under system.servicemodel

<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://intranetportal"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>

Modification to RSS.NET to allow Sorting of Items

In RssItemCollection.cs
------------------------
///
/// Sorting for RSSItem
///
public void Sort()
{
InnerList.Sort(new RssItemComparer());
}

class RssItemComparer : IComparer
{
public int Compare(object x, object y)
{
return ((RssItem)y).CompareTo((RssItem)x);
}
}

in RssItem.cs
--------------
public int CompareTo(object obj)
{
return this.pubDate.CompareTo(((RssItem)obj).pubDate);
}