This project is read-only.

Making Orchard 1.4 compatible with .NET Framework 4.5

Topics: Troubleshooting
Sep 24, 2012 at 10:52 AM


is there a way to make Orchard 1.4 (and maybe previous versions) compatible with .NET Framework 4.5. There are so big differences what has been changed to make previous versions working under new .NET Framework? For nopCommerce it was some FluentValidation issue, for PagedList custom class was also some small changes. Can't it be done also for Orchard?


Sep 24, 2012 at 11:18 AM

Any specific reason why you want to see such support for older Orchard versions?

Sep 24, 2012 at 2:26 PM

I'm hosting company owner and after updating my environment to .NET 4.5 some of my customers have complains about this upgrade and they have custom modules which will probably not work under Orchard 1.5.x (customers use versions 1.1.x, 1.3.x and 1.4.x). I want to help them by providing solution how to make their versions compatible with this unfortunate .NET 4.5 update.

Sep 24, 2012 at 2:32 PM

Well, I don't know how to help you out here, maybe others can. There were some topics on 4.5 support before, you could dig through those, maybe it contains a solution.

But as an advice : in the future do not do such upgrades without understanding the implications and without giving people a chance to prepare for the switch.


Sep 24, 2012 at 2:35 PM

This kind of issues with .NET Framework is something new. There was always backward compatibility and issues like this one was mostly domain of PHP where small change could take your whole site down. I've sent info about upgrade to my customers about 17 days earlier but probably them assumed that this will be another backward compatible version.

Regarding other topics on this forum they mostly end with upgrading to Orchard 1.5.1 which may be not possible in some cases.

Sep 24, 2012 at 2:42 PM

There is no exact .NET 4.5 problem in Issue Tracker? Somehow Orchard started to work under latest version of .NET Framework so something has been changed. Hasn't this been addressed in some fork commited to main code or some issue where is information what was causing problems?

Sep 24, 2012 at 4:57 PM

We don't have nearly the resources to maintain old versions of Orchard. The only way to make 1.4 compatible with .NET 4.5 that I know of is to upgrade to 1.5. That is the fix. I'm not sure what wasn't working or why it started working all of a sudden, but we certainly didn't make changes on our end (and I don't see how they could have been pushed your way). Maybe there was a silent update of MVC? I don't know.

Sep 24, 2012 at 6:11 PM

It looks like adding:

[assembly: SecurityRules(SecurityRuleSet.Level1, SkipVerificationInFullTrust = true)]
to AssemblyInfo.cs files for 4 main Orchard projects from Orchard solution is a fix for .NET 4.5 compatibility.

[assembly: SecurityRules(SecurityRuleSet.Level1, SkipVerificationInFullTrust = true)]
Sep 24, 2012 at 6:40 PM

Nice, thanks for sharing.

Sep 24, 2012 at 6:44 PM

No problem. I'm not 100% sure it will cover all issues but when I've compiled Orchard 1.3 with this line and replaced bin files of my client website it started working. The same fix was made for PagedList component:

and probably for some other software:


Sep 25, 2012 at 12:29 AM

We had to make some changes to have it running on 4.5. Removing all [Security] attributes is one change. We also upgraded to a newer version of Autofac.

Sep 29, 2012 at 9:39 AM

Hi Folks,

I'm from .NET Framework - CLR team. Could you let us know any issues that you are facing in running Orchard 1.4 as-is on .NET4.5 - you can email us netfx45 compat at Microsoft dot com?

There is single cause for various manifestations of this Exception message - "Message:Operation could destabilize the runtime.". We're working on addressing this issue in upcoming update.




Sep 30, 2012 at 7:50 PM


as a hosting provider only thing which was needed for all Orchard pre 1.5 versions was to add:

[assembly: SecurityRules(SecurityRuleSet.Level1, SkipVerificationInFullTrust = true)]

to AssembyInfo.cs. I've created packages for various versions of Orchard and after providing them to my customers their sites started working correctly.

Are you planning to release this update just like normal windows update or maybe quicker?