Get your modules ready for Orchard 1.9

Orchard 1.9 is just around the corner (don’t ask me exactly when it will be out, instead go and help with the remaining high priority bugs), and if you own existing Orchard modules, now is a really good time to test them against the latest 1.x build. You should be mostly fine as the new version doesn’t introduce significant breaking changes (that we know of), but there is one thing that you may have to do nonetheless to build a compatible version of your code. Orchard 1.9 will bump up its .NET Framework dependency to 4.5.1. As a consequence, if your modules are compiled against an earlier version of the framework, and take dependencies on assemblies such as Orchard.Core or Orchard.Framework, which are now built on the updated framework, Visual Studio will refuse to build your module.

The solution is simple. From Visual Studio, right-click your project in the solution explorer, and select “Properties”. Then find the target framework drop-down, and pick 4.5.1. You should now be able to build, then package your module and be ready the day 1.9 is out. Whenever that is.

Alternatively, you can directly edit your csproj file and look for this line:

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

Just edit that tag to bump up the version to 4.5.1.

You may also want to edit your web.config file, in order to prevent any confusion from Visual Studio IntelliSense. Then again, if you had made the change from VS like I suggested first instead of playing command-line and vi tough guy, it would have already updated both files for you…

No Comments