Here’s a simple way to create a dynamic Sitecore MVC robots.txt.
controller = "Robots",
action = "RobotsText"
2. Create a RobotsController
public class RobotsController : Controller
public FileContentResult RobotsText()
var contentBuilder = new StringBuilder();
return File(Encoding.UTF8.GetBytes(contentBuilder.ToString()), "text/plain");
private bool IsProduction
return (ConfigurationManager.AppSettings["IsProduction"] ?? "false") == "true";
3. Add /robots.txt to IgnoreUrlPrefixes setting in Sitecore.config
4. Ensure <modules runAllManagedModulesForAllRequests=”true”> is set to true within web.config.
When you are on the site in question:
- Left nav -> Site Contents
- Settings (on the right)
- People and groups
There is an easy way to keep tabs about what code is on each environment. There is a good MSBuild project which provides a set of useful additional MSBuild tasks:
To reference the extra tasks, you will need to make sure you have referenced the MSBuild Community Tasks Project DLL. The tasks of interest are GitVersion and GitBranch which will provide details of the SHA and branch that is being deployed. The following target is what you need to get started:
<Output TaskParameter="CommitHash" PropertyName="GitDeployedCommitHash" />
<Output TaskParameter="Branch" PropertyName="GitDeployedBranch" />
<GitVersionInformationLine Include="Deployment Date: $([System.DateTime]::Now)" />
<GitVersionInformationLine Include="Deployed by: $(USERNAME)" />
<GitVersionInformationLine Include="Git Branch: $(GitDeployedBranch)" />
<GitVersionInformationLine Include="Git Version: $(GitDeployedCommitHash)" />
This will generate a file to App_Config/__DeployInfo which will look something like:
Deployment Date: 22/12/2014 17:02:11
Deployed by: Mr Deployer
Git Branch: sprint
Git Version: b4bc2b4
Similar functionality could be added for Mercurial but isn’t included in this project, the following could be useful: https://msbuildhg.codeplex.com/documentation
Download this: http://www.microsoft.com/en-gb/download/details.aspx?id=40772
After creating a new website in IIS (and associated AppPool) all requests return a 503 and the Application Pool is stopped.
Event Logs will have something like:
Windows cannot copy file \\?\C:\Users\Default\AppData\Local\Microsoft\VSCommon\12.0\SQM\sqmdata-7696-039-00000.sqm to location \\?\C:\Users\[App Pool Name]\AppData\Local\Microsoft\VSCommon\12.0\SQM\sqmdata-7696-039-00000.sqm. This error may be caused by network problems or insufficient security rights.
DETAIL – Access is denied.
Navigate to C:\Users\Default\AppData\Local\Microsoft\VSCommon\12.0\SQM and delete any .sqm files within the folder.
This can be traced back to installing KB2932965 which is an update for Visual Studio 2013
By default IIS 8 creates a new user profile for every AppPool identity, it does this by copying the Default user profile. For whatever reason the update creates two .sqm files without setting any read permissions. When IIS attempts to copy the default user profile it fails because it doesn’t have read access. This in turns prevents the AppPool from starting correctly (although you’d never know from the IIS Management UI)
As far as I can tell these files are for customer satisfaction metrics, if you’re feeling particularly cautious don’t delete them, just give everyone read access (but delete them).
Angular is a really powerful framework that we’ve used on several projects now. However there can be a bit of an overhead in learning how it works. Debugging an angular app can also be a bit tricky.
This chrome plugin is reasonably useful and might just help you understand what is going on:
I recently found a bug in curvycorners.js and IE11 – curvycorners uses user agent sniffing to detect ie browsers by looking for the presence of ‘msie’. However the IE11 user agent has changed and become far more complicated to sniff! This blog explains the changes:
User Agent sniffing seems to be a common way of detecting the browser and version in order to target code at certain browsers, however it is far from ideal. This blog gives a good overview of why it is not a good idea. It also give an overview of the alternative – feature detection
For a much more detailed blog on feature detection see: