X-Frame-Options and Orchard CMS

Just recently I ran into an issue while working on an Orchard CMS 1.8.1 website for a client. As part of the project some of the Orchard pages need to be loaded on an external website via an iframe. When the external page is loaded, the iframe fails to load the Orchard page and the following message is seen in Chrome:

Refused to display ‘{My Url}’ in a frame because it set ‘X-Frame-Options’ to ‘SAMEORIGIN’.

We have a couple of options on how to fix:
Read More

File.ReadAllBytes() results in a System.OutOfMemoryException Exception

Sometimes you’ve just got to read that whole file and store it into a Byte[] and sooner or later you’ll run into a file that pushes the limits and you’ll get the wonderful System.OutOfMemoryException. Now you can make sure your Application Pool or Console application is set to run in 64bit mode which will help but what happens if you need to load over 2GB into a Byte[]? Thankfully Microsoft has finally (only took 10 years) introduced very large object support into .NET 4.5+!

Read More

Why am I not seeing the Icon Overlays in Shell Extensions TFS Power tools?

Helpful post on getting the shell icons to display in explorer. Since this article was written you know need to add two blank spaces in front of each overlays name when editing the registry. It also doesn’t hurt to remove the “z” in front of a couple of the overlays name.

The post: http://blogs.msdn.com/b/youhana/archive/2012/01/09/why-am-i-not-seeing-the-icon-overlays-in-shell-extensions-tfs-power-tools.aspx

Attempt by security transparent method failed

If you are seeing the following:

Attempt by security transparent method ‘Microsoft.Web.Mvc.ScriptExtensions.Script(System.Web.Mvc.HtmlHelper, System.String)’ to access security critical type ‘System.Web.Mvc.MvcHtmlString’ failed.

or something similar chances are you’ve recently updated your project from MVC 4 to 5 and didn’t update all the references in nuget to target the new version. In my case the MVC4Futures nuget package should be removed and the Microsoft.AspNet.Mvc.Futures package should be used instead.

Debugging StructureMap with WhatDoIHave()

Having issues with StructureMap? Getting the exception

No default instance defined

Try running 


and let StructureMap tell you what it knows. This method returns a formatted string showing everything in your container. If you see a blank in the configured instances then that’s something that is registered but doesn’t have a concrete instance.