System.TypeLoadException on MessageSettingsPartDriver

Topics: Installing Orchard, Troubleshooting
Apr 5, 2012 at 12:19 AM

I recently updated my local source code subscription from the default branch to the 1.x branch. Everything still worked on my local machine (e.g., when I build it under Visual Studio), but when I built everything with the ClickToBuild.cmd file and FTP it out to my beta server (running IIS 6, uggh), I got a 404 error when navigating to my root. And when I check my logs, I see a dozen or so errors that look like this (all referencing Orchard.Messaging.Drivers.MessageSettingsPartDriver):

2012-04-04 19:17:19,745 [7] Orchard.Environment.Extensions.ExtensionManager - Error loading extension 'Orchard.Messaging'System.TypeLoadException: Inheritance security rules violated by type: 'Orchard.Messaging.Drivers.MessageSettingsPartDriver'. Derived types must either match the security accessibility of the base type or be less accessible.   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)   at System.Reflection.RuntimeAssembly.GetExportedTypes()   at Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader.LoadWorker(ExtensionDescriptor descriptor) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Environment\Extensions\Loaders\DynamicExtensionLoader.cs:line 198   at Orchard.Environment.Extensions.Loaders.ExtensionLoaderBase.Load(ExtensionDescriptor descriptor) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Environment\Extensions\Loaders\ExtensionLoaderBase.cs:line 37   at Orchard.Environment.Extensions.ExtensionManager.BuildEntry(ExtensionDescriptor descriptor) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 160   at Orchard.Environment.Extensions.ExtensionManager.<>c__DisplayClass1c.<LoadFeature>b__16(AcquireContext`1 ctx) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 110   at Orchard.Caching.Cache`2.CreateEntry(TKey k, Func`2 acquire) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Caching\Cache.cs:line 57   at Orchard.Caching.Cache`2.<>c__DisplayClass2.<Get>b__0(TKey k) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Caching\Cache.cs:line 19   at System.Collections.Concurrent.ConcurrentDictionary`2.AddOrUpdate(TKey key, Func`2 addValueFactory, Func`3 updateValueFactory)   at Orchard.Caching.Cache`2.Get(TKey key, Func`2 acquire) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Caching\Cache.cs:line 17   at Orchard.Caching.DefaultCacheManager.Get[TKey,TResult](TKey key, Func`2 acquire) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Caching\DefaultCacheManager.cs:line 33   at Orchard.Environment.Extensions.ExtensionManager.LoadFeature(FeatureDescriptor featureDescriptor) in c:\source\Alanta\working\AlantaWebCorp\src\Orchard\Environment\Extensions\ExtensionManager.cs:line 109

This is the same error mention in Piotr's recent blog post about upgrading (http://www.szmyd.com.pl/blog/upgrading-orchard-and-security-exceptions#.T3zYAfBSS68), but I can't find any references in the Orchard solution to [assembly: SecurityTransparent]. I added the recommended [assembly: SecurityRules(SecurityRuleSet.Level2)] attribute to my own assembly, but it didn't make any difference.

Reverting to the default branch fixed the problem.

Thoughts?