jetbrains.annotations in 1.10 modules

Topics: Installing Orchard
Mar 24 at 8:50 PM

When creating a fresh new orchard site using the zip file on my iis server, when trying to enable a module (tinyMCE in my case) I get this error:
An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
One or more errors occurred.
System.AggregateException: One or more errors occurred. ---> System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=,
the exception goes on forever, but they main reason is that it misses the jetbrains annotations lib.

Do more people have this or is there an easy way to fix this?
Mar 26 at 10:16 AM
Looks like an issue with the zip distribution. Can you please open an issue for this on GitHub?
Apr 1 at 10:09 PM
Edited Apr 1 at 10:12 PM
I just grabbed the latest version from github. Upgrading my v1.8 -> v1.10

When I run I get the same error.
Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=, Culture=neutral, PublicKeyToken=null'.

This is coming from ExtensionManager.cs
       private static string GetSourceFeatureNameForType(Type type, string extensionId) {
            foreach (OrchardFeatureAttribute featureAttribute in type.GetCustomAttributes(typeof(OrchardFeatureAttribute), false)) {
                return featureAttribute.FeatureName;
            return extensionId;
Apr 15 at 8:05 PM
Edited Apr 16 at 8:58 AM
Chrismorse did you find what caused this? I am seeing the same issue, incidentally also on a site that is being upgraded from 1.8.x to 1.10.x.

This is a "Precompiled" build (Release | Any CPU) from the current 1.10.x branch (last pulled 2 days ago). There is no sign of this issue in debug and no references to the deprecated attribute.

Increased the logging level and added additional logging to ExtensionManager.LoadFeature, which in the log below is the line "loading feature 'Orchard.Themes'":
Orchard.Environment.Extensions.ExtensionLoaderCoordinator - (null) - INFO Executing list of operations needed for loading extensions...
Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager - (null) - INFO Storing module dependency file.
Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager - (null) - DEBUG Existing document is identical to new one. Skipping save.
Orchard.FileSystems.Dependencies.DefaultExtensionDependenciesManager - (null) - INFO Done storing module dependency file.
Orchard.Environment.Extensions.ExtensionLoaderCoordinator - (null) - INFO Done loading extensions...
Orchard.Environment.DefaultOrchardHost - (null) - INFO Start creation of shells
Orchard.Environment.Configuration.ShellSettingsManager - (null) - INFO Reading ShellSettings...
Orchard.Environment.Configuration.ShellSettingsManager - (null) - INFO Returning 1 ShellSettings objects for tenants Default.
Orchard.Environment.DefaultOrchardHost - (null) - DEBUG Creating shell context for tenant Default.
Orchard.Environment.ShellBuilders.ShellContextFactory - (null) - DEBUG Creating shell context for tenant Default
Orchard.Environment.ShellBuilders.CompositionStrategy - (null) - DEBUG Composing blueprint
Orchard.Environment.Extensions.ExtensionManager - (null) - INFO Loading features
Orchard.Environment.Extensions.ExtensionManager - (null) - INFO loading feature 'Orchard.Themes'
Orchard.Environment.DefaultOrchardHost - (null) - ERROR A tenant could not be started: Default Attempt number: 0
System.AggregateException: One or more errors occurred. ---> System.TypeLoadException: Could not load type 'JetBrains.Annotations.UsedImplicitlyAttribute' from assembly 'Orchard.Framework, Version=
Apr 20 at 5:46 PM
I haven't figured it out yet.
Apr 20 at 7:26 PM
I have managed to get it working again. Are you (or have you been) running multiple versions of Orchard on the same box using the Precompiled build? My theory is that dependencies are being cross-wired due to the fact that some AssemblyInfo.cs are set to BuildAction Content instead of Compile.

This causes the dll to be compiled with version, so fusion can't tell the difference between a 1.8.x, 1.9.x, 1.10.x library. So your 1.10.x installation will be picking up 1.8.x libraries.

This could be way off, but there are some open issues on GitHub referring to this as a minor issue, but it may not be so minor after all. When I have a moment tomorrow I will dig them up.
Apr 25 at 12:28 PM