После установки Mono & Mod_Mono на моем сервере Centos 5 мне удалось заставить сервер активировать свой сайт MVC3 (который успешно работает под IIS).
К сожалению, при попытке запустить с Apache я получаю сообщение об ошибке:
Метод не найден: 'System.Web.Helpers.Chart.ExecuteChartAction'.
Описание: HTTP 500. Ошибка обработки запроса.
Это характерно для меня, поскольку в моем коде вообще нет ссылок на класс диаграмм. Похоже, что исключение также исходит от Composition, и трассировка стека включает в себя различные ссылки на MefContrib.
Я экспериментировал с различными комбинациями .dll в моем каталоге bin. Это его текущее содержание, которое привело меня к этой стадии:
MyDll.dll MefContrib.Web.Mvc.dll System.Web.WebPages.Deployment.dll
MyDll.pdb System.Web.Helpers.dll System.Web.WebPages.Deployment.xml
MyDll2.dll System.Web.Helpers.xml System.Web.WebPages.dll
MyDll2.pdb System.Web.Mvc.dll System.Web.WebPages.Razor.dll
HtmlAgilityPack.dll System.Web.Mvc.xml System.Web.WebPages.Razor.xml
HtmlAgilityPack.pdb System.Web.Razor.dll System.Web.WebPages.xml
HtmlAgilityPack.xml System.Web.Razor.xml WebActivator.dll
MefContrib.dll System.Web.Routing.dll
Где MyDll и MyDll2 - это созданные мной проектные библиотеки, включающие в себя различные экспорты и импорты служб для создания MEF.
По-моему, в библиотеках MefContrib есть что-то, что не очень хорошо работает с Mono, поскольку, кроме этого, мой проект - чрезвычайно простое приложение MVC3.
Полная трассировка стека:
Ошибка сервера в «/» приложении
Method not found: 'System.Web.Helpers.Chart.ExecuteChartAction'.
Description: HTTP 500. Error processing request.
Stack Trace:
Server Error in '/' Application
Method not found: 'System.Web.Helpers.Chart.ExecuteChartAction'.
Description: HTTP 500. Error processing request.
Stack Trace:
System.MissingMethodException: Method not found: 'System.Web.Helpers.Chart.ExecuteChartAction'.
at (wrapper managed-to-native) System.Reflection.MonoMethodInfo.get_method_info (intptr,System.Reflection.MonoMethodInfo&) <IL 0x00008, 0x0004c>
at System.Reflection.MonoMethodInfo.GetMethodInfo (intptr) [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:63
at System.Reflection.MonoMethod.GetPseudoCustomAttributes () [0x00002] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
at System.MonoCustomAttrs.GetPseudoCustomAttributes (System.Reflection.ICustomAttributeProvider,System.Type) [0x0000d] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System/MonoCustomAttrs.cs:68
at System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider,System.Type,bool) [0x00039] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System/MonoCustomAttrs.cs:291
at System.Reflection.MonoMethod.IsDefined (System.Type,bool) [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/corlib/System.Reflection/MonoMethod.cs:276
at Microsoft.Internal.AttributeServices.IsAttributeDefined<System.ComponentModel.Composition.ExportAttribute> (System.Reflection.ICustomAttributeProvider,bool) <0x00036>
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsExport (System.Reflection.ICustomAttributeProvider) [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:355
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo/<GetExportMembers>c__Iterator0.MoveNext () [0x0017f] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:302
at System.Linq.Enumerable.Any<System.Reflection.MemberInfo> (System.Collections.Generic.IEnumerable`1<System.Reflection.MemberInfo>) <0x0009e>
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.HasExports () [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:106
at System.ComponentModel.Composition.AttributedModel.AttributedPartCreationInfo.IsPartDiscoverable () [0x0003a] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs:95
at System.ComponentModel.Composition.AttributedModel.AttributedModelDiscovery.CreatePartDefinitionIfDiscoverable (System.Type,System.ComponentModel.Composition.Primitives.ICompositionElement) [0x0000a] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/AttributedModel/AttributedModelDiscovery.cs:19
at System.ComponentModel.Composition.Hosting.TypeCatalog.get_PartsInternal () [0x00051] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs:166
at System.ComponentModel.Composition.Hosting.TypeCatalog.get_Parts () [0x00006] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/TypeCatalog.cs:123
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_Parts () [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs:137
at (wrapper dynamic-method) object.lambda_method (System.Runtime.CompilerServices.Closure,System.ComponentModel.Composition.Primitives.ComposablePartCatalog) <IL 0x00001, 0x00013>
at System.Linq.Enumerable/<CreateSelectManyIterator>c__Iterator29`2<System.ComponentModel.Composition.Primitives.ComposablePartCatalog, System.ComponentModel.Composition.Primitives.ComposablePartDefinition>.MoveNext () <0x00114>
at System.Linq.Enumerable/<CreateSelectManyIterator>c__Iterator29`2<System.ComponentModel.Composition.Primitives.ComposablePartCatalog, System.ComponentModel.Composition.Primitives.ComposablePartDefinition>.MoveNext () <0x00206>
at System.Collections.Generic.List`1<System.ComponentModel.Composition.Primitives.ComposablePartDefinition>.AddEnumerable (System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.ComposablePartDefinition>) <0x0008a>
at System.Collections.Generic.List`1<System.ComponentModel.Composition.Primitives.ComposablePartDefinition>..ctor (System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.ComposablePartDefinition>) <0x0008b>
at MefContrib.Hosting.Interception.InterceptingCatalog.GetParts () <IL 0x00033, 0x0009b>
at MefContrib.Hosting.Interception.InterceptingCatalog.get_Parts () <IL 0x00001, 0x0000f>
at System.ComponentModel.Composition.Primitives.ComposablePartCatalog.GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition) [0x00017] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs:88
at MefContrib.Hosting.Interception.InterceptingCatalog.GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition) <IL 0x00010, 0x00033>
at MefContrib.Hosting.Filter.FilteringCatalog.GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition) <IL 0x00007, 0x00021>
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition) [0x00040] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs:279
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition,System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.Export>&) [0x00006] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:208
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition) [0x0000b] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:102
at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition) [0x00030] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/AggregateExportProvider.cs:157
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition,System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.Export>&) [0x00006] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:208
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition,System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.Export>&) [0x0000e] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:145
at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition) [0x00008] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/CompositionContainer.cs:396
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition,System.Collections.Generic.IEnumerable`1<System.ComponentModel.Composition.Primitives.Export>&) [0x00006] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:208
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports (System.ComponentModel.Composition.Primitives.ImportDefinition,System.ComponentModel.Composition.Hosting.AtomicComposition) [0x0000b] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.cs:102
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore (System.Type,System.Type,string,System.ComponentModel.Composition.Primitives.ImportCardinality) [0x0006b] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs:799
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports (System.Type,System.Type,string) [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.ComponentModel.Composition/src/ComponentModel/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs:267
at MefContrib.Web.Mvc.CompositionDependencyResolver.GetService (System.Type) <IL 0x00009, 0x0002b>
at System.Web.Mvc.DependencyResolverExtensions.GetService<System.Web.Mvc.IControllerFactory> (System.Web.Mvc.IDependencyResolver) <0x0002d>
at System.Web.Mvc.SingleServiceResolver`1<System.Web.Mvc.IControllerFactory>.get_Current () <0x00097>
at System.Web.Mvc.ControllerBuilder.GetControllerFactory () <IL 0x00006, 0x00021>
at System.Web.Mvc.MvcRouteHandler.GetSessionStateBehavior (System.Web.Routing.RequestContext) <IL 0x00024, 0x00097>
at System.Web.Mvc.MvcRouteHandler.GetHttpHandler (System.Web.Routing.RequestContext) <IL 0x00008, 0x0002c>
at System.Web.Mvc.MvcRouteHandler.System.Web.Routing.IRouteHandler.GetHttpHandler (System.Web.Routing.RequestContext) <IL 0x00002, 0x00015>
at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache (System.Web.HttpContextBase) [0x00054] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs:127
at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache (object,System.EventArgs) [0x00007] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs:87
at System.Web.HttpApplication/<RunHooks>c__Iterator5.MoveNext () [0x001aa] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web/System.Web/HttpApplication.cs:1050
at System.Web.HttpApplication/<Pipeline>c__Iterator6.MoveNext () [0x006d3] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web/System.Web/HttpApplication.cs:1259
at System.Web.HttpApplication.Tick () [0x00000] in /usr/src/redhat/BUILD/mono-2.10.2/mcs/class/System.Web/System.Web/HttpApplication.cs:932
Version information: Mono Runtime Version: 2.10.2 (tarball Mon Apr 18 19:06:50 UTC 2011); ASP.NET Version: 4.0.30319.1