Visual Studio 2012 を使用して、Windows 7 で ASP.NET MVC 3 Web アプリケーションを作成しました。Visual Studio で問題なくビルドして実行できます。OS X 10.8.2 で Xamarin Studio 4.0 と Mono 3.0.4 を使用して、その Web アプリケーションを編集および実行したいと考えています。これが私がこれまでに試したことです:
- Xamarin Studio で .sln を開きました。
- System.Data.Entity および System.Web.Entity への参照を削除しました。
- System.Web.Helpers (バージョン 1.0.0.0)、System.Web.Mvc (バージョン 3.0.0.0)、および System.Web.WebPages (バージョン 1.0.0.0) .dll を bin フォルダーにコピーしました。
- System.Web.Helpers、System.Web.Mvc、および System.Web.Webpages への古い参照を削除しました。
- *.Designer.cs ファイルの「using System.Data.*」を「using System.Data.Entity.Core.*」に置き換えました。
- EntityFramework (バージョン 4.x) への参照を削除しました。
- bin フォルダーから EntityFramework.dll と EntityFramework.xml を削除しました。
- /Library/Frameworks/Mono.framework/Libraries/mono/4.5/EntityFramework.dll (バージョン 6.0.0.0) への参照を追加しました。
- 実行をクリックします。
[実行] をクリックすると、次の例外が発生します。
Exception rethrown at [0]:
---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Web.Configuration.HostingEnvironmentSection ---> System.MissingMethodException: Method not found: 'System.Configuration.ConfigurationProperty..ctor'.
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000b9] in /Users/duncan/git/mono/bockbuild/profiles/mono-mac-release/build-root/mono-3.0.4/_build/mono-3.0.4.git/mcs/class/corlib/System.Reflection/MonoMethod.cs:524
--- End of inner exception stack trace ---
at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x002fb] in /Users/duncan/git/mono/bockbuild/profiles/mono-mac-release/build-root/mono-3.0.4/_build/mono-3.0.4.git/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs:244
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x0003a] in /Users/builder/data/lanes/mono-mac-ui-refresh-master/3108f76b/source/bockbuild/profiles/mono-mac-release/build-root/xsp-2.11/_build/mono-xsp-d3e2f80/src/Mono.WebServer/VPathToHost.cs:150
at Mono.WebServer.XSP.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00775] in /Users/builder/data/lanes/mono-mac-ui-refresh-master/3108f76b/source/bockbuild/profiles/mono-mac-release/build-root/xsp-2.11/_build/mono-xsp-d3e2f80/src/Mono.WebServer.XSP/main.cs:486
at Mono.WebServer.XSP.Server.Main (System.String[] args) [0x00025] in /Users/builder/data/lanes/mono-mac-ui-refresh-master/3108f76b/source/bockbuild/profiles/mono-mac-release/build-root/xsp-2.11/_build/mono-xsp-d3e2f80/src/Mono.WebServer.XSP/main.cs:264
例外をグーグルで検索しましたが、解決策が見つかりませんでした。参照がありませんか?MVC 3 または 4 および Entity Framework 4 または 6 を使用し、Mono で動作するサンプル プロジェクトはどこにありますか?