我在 Mono 3 上遇到 MVC4 问题。我在 Xamarin Studio 中使用最新版本和最新更新,但是当尝试对 Web 服务器进行 HTTP POST 时,它返回以下错误。按照指南的建议,我正在使用 Windows 中的 MVC4 DLL 和 System.Web 4.0.0.0 的 Mono 版本。
任何想法如何解决这个问题,或者我只是更好地恢复到 MVC3?
System.TypeLoadException
Could not load type 'System.Web.UnvalidatedRequestValuesBase' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.Mvc.
Exception stack trace:
at System.Web.Mvc.UnvalidatedRequestValuesWrapper.get_Form () [0x00000] in <filename unknown>:0 at System.Web.Mvc.FormValueProvider..ctor (System.Web.Mvc.ControllerContext controllerContext, IUnvalidatedRequestValues unvalidatedValues) [0x00000] in <filename unknown>:0 at System.Web.Mvc.FormValueProviderFactory.GetValueProvider (System.Web.Mvc.ControllerContext controllerContext) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ValueProviderFactoryCollection+<>c__DisplayClassc.<GetValueProvider>b__7 (System.Web.Mvc.ValueProviderFactory factory) [0x00000] in <filename unknown>:0 at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator25`2[System.Web.Mvc.ValueProviderFactory,<>f__AnonymousType2`2[System.Web.Mvc.ValueProviderFactory,System.Web.Mvc.IValueProvider]].MoveNext () [0x00059] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/System.Core/System.Linq/Enumerable.cs:2269 at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator33`1[<>f__AnonymousType2`2[System.Web.Mvc.ValueProviderFactory,System.Web.Mvc.IValueProvider]].MoveNext () [0x0006f] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/System.Core/System.Linq/Enumerable.cs:3120 at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator25`2[<>f__AnonymousType2`2[System.Web.Mvc.ValueProviderFactory,System.Web.Mvc.IValueProvider],System.Web.Mvc.IValueProvider].MoveNext () [0x00059] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/System.Core/System.Linq/Enumerable.cs:2269 at System.Collections.Generic.List`1[System.Web.Mvc.IValueProvider].AddEnumerable (IEnumerable`1 enumerable) [0x00013] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/corlib/System.Collections.Generic/List.cs:134 at System.Collections.Generic.List`1[System.Web.Mvc.IValueProvider]..ctor (IEnumerable`1 collection) [0x0002f] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/corlib/System.Collections.Generic/List.cs:69 at System.Linq.Enumerable.ToList[IValueProvider] (IEnumerable`1 source) [0x00006] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-3.2.3/mcs/class/System.Core/System.Linq/Enumerable.cs:2951 at System.Web.Mvc.ValueProviderFactoryCollection.GetValueProvider (System.Web.Mvc.ControllerContext controllerContext) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerBase.get_ValueProvider () [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerActionInvoker.GetParameterValue (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ParameterDescriptor parameterDescriptor) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerActionInvoker.GetParameterValues (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionDescriptor actionDescriptor) [0x00000] in <filename unknown>:0 at System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass25.<BeginInvokeAction>b__1e (System.AsyncCallback asyncCallback, System.Object asyncState) [0x00000] in <filename unknown>:0
Version Information: 3.2.3 ((no/8d3b4b7 Mon Sep 16 23:46:28 EDT 2013); ASP.NET Version: 4.0.30319.17020