Bug 12136 - Cannot run ASP.NET MVC 4 application (MVC sourced from NuGet) in Xamarin Studio
Summary: Cannot run ASP.NET MVC 4 application (MVC sourced from NuGet) in Xamarin Studio
Status: RESOLVED INVALID
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: 4.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 4.0.9 (from master)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-07 11:16 UTC by Chris Leow
Modified: 2013-06-24 16:18 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Zipped up project that I'm using to test (1.08 MB, application/zip)
2013-05-07 11:16 UTC, Chris Leow
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Chris Leow 2013-05-07 11:16:25 UTC
Created attachment 3926 [details]
Zipped up project that I'm using to test

Targeted framework 4.5, basic "HelloWorld" MVC project fails.  Get the following error through disassembly with breakpoint where indicated.

00000000   ldarg.0 
00000001   call Void System.Object:.ctor ()
00000006   ldarg.2 
00000007   call String Microsoft.Win32.KeyHandler:GetVolatileDir (String)
0000000c   stloc.0 
0000000d   ldarg.2 
0000000e   stloc.1 
0000000f   ldarg.2 
00000010   call Boolean System.IO.Directory:Exists (String)
00000015   brfalse 00000022
0000001a   ldc.i4.0 
0000001b   starg.s 3
0000001d   br 0000003f
00000022   ldloc.0 
00000023   call Boolean System.IO.Directory:Exists (String)
00000028   brfalse 00000037
0000002d   ldloc.0 
0000002e   stloc.1 
0000002f   ldc.i4.1 
00000030   starg.s 3
00000032   br 0000003f
00000037   ldarg.3 
00000038   brfalse 0000003f
0000003d   ldloc.0 
0000003e   stloc.1 
0000003f   ldloc.1 
00000040   call Boolean System.IO.Directory:Exists (String)
00000045   brtrue 00000063
0000004a   ldloc.1 
0000004b   call DirectoryInfo System.IO.Directory:CreateDirectory (String)
00000050   pop 
00000051   leave 00000063
00000056   stloc.2 
00000057   ldstr "No access to the given key"     <!---- breakpoint sets on this error
0000005c   ldloc.2 
0000005d   newobj Void System.Security.SecurityException:.ctor (String, Exception)
00000062   throw 
00000063   ldarg.0 
00000064   ldarg.2 
00000065   stfld 
0000006a   ldarg.0 
0000006b   ldloc.1 
0000006c   stfld 
00000071   ldarg.0 
00000072   ldarg.3 
00000073   stfld 
00000078   ldarg.0 
00000079   ldarg.0 
0000007a   ldfld 
0000007f   ldstr "values.xml"
00000084   call String System.IO.Path:Combine (String, String)
00000089   stfld 
0000008e   ldarg.0 
0000008f   call Void Microsoft.Win32.KeyHandler:Load ()
00000094   ret
Comment 1 Mikayla Hutchinson [MSFT] 2013-05-07 19:52:53 UTC
What is it exactly that fails? Do you have more context, e.g. what assembly are you stepping into?
Comment 2 Chris Leow 2013-05-08 01:46:22 UTC
Oh yeah sorry, trying to run in xsp4 with debugging, pressing F5 in Xamarin Studio basically...
Comment 3 Mikayla Hutchinson [MSFT] 2013-05-08 13:52:30 UTC
So it runs, but stops with an unhandled exception on the indicated location? In what assembly?

It looks like the webapp is trying to access a windows registry key.
Comment 4 Chris Leow 2013-05-08 14:20:08 UTC
This is the full trace from application output (never noticed it before, must have a blind spot):

User assembly '/Users/chrisleow/Projects/BlastOutServer/BlastOutServer.Worker/bin/Debug/BlastOutServer.Worker.exe' is missing. Debugger will now debug all code, not just user code.
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/xsp4/2.11.0.0__0738eb9f132ed756/xsp4.exe
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
Adding applications '/:.'...
Registering application:
    Host:          any
    Port:          any
    Virtual path:  /
    Physical path: /Users/chrisleow/Projects/BlastOutServer/HelloWorld/
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
Loaded assembly: __MetadataTypes
Loaded assembly: __MetadataTypes
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.Web/4.0.0.0__0738eb9f132ed756/Mono.Web.dll
xsp4
Listening on address: 127.0.0.1
Root directory: /Users/chrisleow/Projects/BlastOutServer/HelloWorld
Thread started:  #2
Listening on port: 8080 (non-secure)
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
An exception has occurred while generating HttpException page:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Web.Util.HttpEncoder.GetCustomEncoderFromConfig () [0x00000] in <filename unknown>:0 
  at System.Lazy`1[System.Web.Util.HttpEncoder].InitValue () [0x00000] in <filename unknown>:0 

The actual exception which was being reported was:
System.Web.HttpException: Initial exception ---> System.Configuration.ConfigurationErrorsException: Error deserializing configuration section httpRuntime: Unrecognized attribute 'targetFramework'. (/Users/chrisleow/Projects/BlastOutServer/HelloWorld/Web.config line 1)
  at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
Thread started:  #7
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/55a50ff6/15f418d0_40511726_00000001/HelloWorld.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/ccf6c053/8ca7d775_40511726_00000001/Microsoft.Web.Infrastructure.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/f3d12b6a/b3803c4c_40511726_00000001/Microsoft.Web.Mvc.FixedDisplayModes.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/a19d874f/e1cc9069_40511726_00000001/Newtonsoft.Json.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/c42b1071/847a0757_40511726_00000001/System.Net.Http.Formatting.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/7d43cc82/3d12dba4_40511726_00000001/System.Web.Helpers.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/5cf10065/1ca01743_40511726_00000001/System.Web.Http.WebHost.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/04011557/44500271_40511726_00000001/System.Web.Http.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/133f36d7/536e21f1_40511726_00000001/System.Web.Mvc.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/d06db68b/903ca1ad_40511726_00000001/System.Web.Razor.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/1f09ef40/5f58f866_40511726_00000001/System.Web.WebPages.Deployment.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/26197e1f/66486939_40511726_00000001/System.Web.WebPages.Razor.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/9198bd1f/d1c9aa39_40511726_00000001/System.Web.WebPages.dll
Comment 5 Chris Leow 2013-05-08 14:24:29 UTC
Just tried commenting out target framework, still get the failure, with this application error:

User assembly '/Users/chrisleow/Projects/BlastOutServer/BlastOutServer.Worker/bin/Debug/BlastOutServer.Worker.exe' is missing. Debugger will now debug all code, not just user code.
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/xsp4/2.11.0.0__0738eb9f132ed756/xsp4.exe
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.WebServer2/0.4.0.0__0738eb9f132ed756/Mono.WebServer2.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
Adding applications '/:.'...
Registering application:
    Host:          any
    Port:          any
    Virtual path:  /
    Physical path: /Users/chrisleow/Projects/BlastOutServer/HelloWorld/
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll
Loaded assembly: __MetadataTypes
Loaded assembly: __MetadataTypes
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Mono.Web/4.0.0.0__0738eb9f132ed756/Mono.Web.dll
xsp4
Listening on address: 127.0.0.1
Root directory: /Users/chrisleow/Projects/BlastOutServer/HelloWorld
Thread started:  #2
Listening on port: 8080 (non-secure)
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Thread started: <Thread Pool> #6
Thread started:  #7
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll
Loaded assembly: /Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/55a50ff6/15f418d0_40511726_00000001/HelloWorld.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/ccf6c053/8ca7d775_40511726_00000001/Microsoft.Web.Infrastructure.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/f3d12b6a/b3803c4c_40511726_00000001/Microsoft.Web.Mvc.FixedDisplayModes.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/a19d874f/e1cc9069_40511726_00000001/Newtonsoft.Json.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/c42b1071/847a0757_40511726_00000001/System.Net.Http.Formatting.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/7d43cc82/3d12dba4_40511726_00000001/System.Web.Helpers.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/5cf10065/1ca01743_40511726_00000001/System.Web.Http.WebHost.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/04011557/44500271_40511726_00000001/System.Web.Http.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/133f36d7/536e21f1_40511726_00000001/System.Web.Mvc.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/d06db68b/903ca1ad_40511726_00000001/System.Web.Razor.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/1f09ef40/5f58f866_40511726_00000001/System.Web.WebPages.Deployment.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/26197e1f/66486939_40511726_00000001/System.Web.WebPages.Razor.dll
Loaded assembly: /private/var/folders/g_/8gtgzb3s5k5bxw8yc7h4wxj40000gn/T/chrisleow-temp-aspnet-0/53a82e13/assembly/shadow/9198bd1f/d1c9aa39_40511726_00000001/System.Web.WebPages.dll

And a "Disassembly+" window with the following:

00000000   ldarg.0 
00000001   call Void System.Object:.ctor ()
00000006   ldarg.2 
00000007   call String Microsoft.Win32.KeyHandler:GetVolatileDir (String)
0000000c   stloc.0 
0000000d   ldarg.2 
0000000e   stloc.1 
0000000f   ldarg.2 
00000010   call Boolean System.IO.Directory:Exists (String)
00000015   brfalse 00000022
0000001a   ldc.i4.0 
0000001b   starg.s 3
0000001d   br 0000003f
00000022   ldloc.0 
00000023   call Boolean System.IO.Directory:Exists (String)
00000028   brfalse 00000037
0000002d   ldloc.0 
0000002e   stloc.1 
0000002f   ldc.i4.1 
00000030   starg.s 3
00000032   br 0000003f
00000037   ldarg.3 
00000038   brfalse 0000003f
0000003d   ldloc.0 
0000003e   stloc.1 
0000003f   ldloc.1 
00000040   call Boolean System.IO.Directory:Exists (String)
00000045   brtrue 00000063
0000004a   ldloc.1 
0000004b   call DirectoryInfo System.IO.Directory:CreateDirectory (String)
00000050   pop 
00000051   leave 00000063
00000056   stloc.2 
00000057   ldstr "No access to the given key"    <!-- still fails here
0000005c   ldloc.2 
0000005d   newobj Void System.Security.SecurityException:.ctor (String, Exception)
00000062   throw 
00000063   ldarg.0 
00000064   ldarg.2 
00000065   stfld 
0000006a   ldarg.0 
0000006b   ldloc.1 
0000006c   stfld 
00000071   ldarg.0 
00000072   ldarg.3 
00000073   stfld 
00000078   ldarg.0 
00000079   ldarg.0 
0000007a   ldfld 
0000007f   ldstr "values.xml"
00000084   call String System.IO.Path:Combine (String, String)
00000089   stfld 
0000008e   ldarg.0 
0000008f   call Void Microsoft.Win32.KeyHandler:Load ()
00000094   ret
Comment 6 Mikayla Hutchinson [MSFT] 2013-05-08 14:42:57 UTC
What class/method does the stack pad indicate you're in when you get that error? I really think it looks like ASP.NET MVC 4 is depending on a Windows registry key but ti's hard to be sure without knowing where the error is coming from.

The httpRuntime/targetFramework error is referring to a configuration setting new in .NET 4.5 which is probably not yet implemented in Mono's ASP.NET implementation: http://stackoverflow.com/questions/11890565/unrecognized-attribute-targetframework-note-that-attribute-names-are-case-sen
Comment 7 Chris Leow 2013-05-08 14:49:57 UTC
This is my printout from the stack pad:

Microsoft.Win32.KeyHandler..ctor (rkey={HKEY_LOCAL_MACHINE}, basedir="/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/../etc/mono/4.5/../registry/LocalMachine", is_volatile=false) in 
Microsoft.Win32.KeyHandler..ctor (rkey={HKEY_LOCAL_MACHINE}, basedir="/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/../etc/mono/4.5/../registry/LocalMachine") in 
Microsoft.Win32.KeyHandler.Lookup (rkey={HKEY_LOCAL_MACHINE}, createNonExisting=true) in 
Microsoft.Win32.UnixRegistryApi.OpenSubKey (rkey={HKEY_LOCAL_MACHINE}, keyname="SOFTWARE\\Microsoft\\ASP.NET\\Security\\DisableLoadList\\", writable=false) in 
Microsoft.Win32.RegistryKey.OpenSubKey (name="SOFTWARE\\Microsoft\\ASP.NET\\Security\\DisableLoadList\\", writable=false) in 
Microsoft.Win32.RegistryKey.OpenSubKey (name="SOFTWARE\\Microsoft\\ASP.NET\\Security\\DisableLoadList\\") in 
Microsoft.Web.Infrastructure.RegistryKeyWrapper.OpenSubKey (name="SOFTWARE\\Microsoft\\ASP.NET\\Security\\DisableLoadList\\") in 
Microsoft.Web.Infrastructure.KillBitHelper.GetKillBittedVersions () in 
Microsoft.Web.Infrastructure.KillBitHelper.IsThisAssemblyKillBitted () in 
Microsoft.Web.Infrastructure.KillBitHelper.ThrowIfKillBitIsSet () in 
Microsoft.Web.Infrastructure.ModuleInitializer.CriticalInitializer.CheckKillBit () in 
Microsoft.Web.Infrastructure.ModuleInitializer.CriticalInitializer.Initialize () in 
Microsoft.Web.Infrastructure.ModuleInitializer.Initialize () in 
<Module>..cctor () in 
System.Web.WebPages.PreApplicationStartCode.Start () in 
System.Web.Mvc.PreApplicationStartCode.Start () in 
Microsoft.Web.Mvc.ViewEngineFix.PreAppStart () in 
System.Reflection.MonoMethod.InternalInvoke () in 
System.Web.Compilation.BuildManager.CallPreStartMethods () in 
System.Web.HttpApplicationFactory.InitType (context={System.Web.HttpContext}) in 
System.Web.HttpApplicationFactory.GetApplication (context={System.Web.HttpContext}) in 
System.Web.HttpRuntime.Process (req={Mono.WebServer.XSPWorkerRequest}) in 
System.Web.HttpRuntime.RealProcessRequest (o={Mono.WebServer.XSPWorkerRequest}) in 
System.Web.HttpRuntime.ProcessRequest (wr={Mono.WebServer.XSPWorkerRequest}) in 
Mono.WebServer.MonoWorkerRequest.ProcessRequest () in 
Mono.WebServer.BaseApplicationHost.ProcessRequest (mwr={Mono.WebServer.XSPWorkerRequest}) in 
Mono.WebServer.XSPApplicationHost.ProcessRequest (reqId=131073, localEP={127.0.0.1:8080}, remoteEP={127.0.0.1:52236}, verb="GET", path="/favicon.ico", queryString=(null), protocol="HTTP/1.1", inputBuffer={byte[311]}, redirect=(null), socket=0xa, ssl=(null)) in 
Mono.WebServer.XSPWorker.RunInternal (state=(null)) in
Comment 8 Mikayla Hutchinson [MSFT] 2013-05-08 15:03:07 UTC
Yup, as I suspected. Microsoft.Web.Infrastructure.dll is trying to load the "SOFTWARE\Microsoft\ASP.NET\Security\DisableLoadList" registry key.

Basically, your project includes a MS binary dll that depends on Windows.

See http://lists.ximian.com/pipermail/mono-devel-list/2011-May/037558.html
Comment 9 PJ 2013-06-24 16:18:48 UTC
This bug was marked as fixed for Xamarin Studio 4.0.9, which is currently in the beta channel. Try it out!