Bug 4450 - MVC3 solution and compiler crashes
Summary: MVC3 solution and compiler crashes
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-04-15 16:57 UTC by pinggi
Modified: 2012-05-02 03:26 UTC (History)
2 users (show)

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

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 GitHub or Developer Community 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 FIXED

Description pinggi 2012-04-15 16:57:50 UTC
1. I open in Monodevelop MVC 3 solution created in VS2010.
2. Rebuild all. Everything ok.
3. Run it and I get:

Server Error in '/' Application
Unrecognized attribute 'targetFramework'. (C:\MVC3Playground\MVC3Playground\Web.config line 1)

Description: HTTP 500. Error processing request.

Stack Trace:

System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'targetFramework'. (C:\MVC3Playground\MVC3Playground\Web.config line 1)
  at System.Configuration.ConfigurationElement.DeserializeElement (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSection.DoDeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  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, System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.get_CompilationConfig () [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 

Version information: Mono Runtime Version: 2.10.8 (tarball); ASP.NET Version: 2.0.50727.1433


It is because xsp2 is used. But how I can force Monodevelop to use xsp4?
In Options:

Build->General->Target framework: Mono / .Net 4.0
Build->ASP.NET Options: nothing interesting
Run->XSP Web Server: no section about version

Ok, so let's change runtime to "Mono 2.10.8" and Rebuild all.
One bug appears:

The compiler appears to have crashed. Check the build output pad for details.

So here is the output pad content:




Building: MVC3Playground.Data (Debug)

Performing main compilation...

C:\Program Files (x86)\Mono-2.10.8\bin\dmcs.bat /noconfig "/out:C:\MVC3Playground\MVC3Playground.Data\bin\Debug\MVC3Playground.Data.dll"
 "/r:C:\MVC3Playground\packages\EntityFramework.4.2.0.0\lib\net40\EntityFramework.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.ComponentModel.DataAnnotations.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Configuration.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Core.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Xml.Linq.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Data.DataSetExtensions.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\Microsoft.CSharp.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Data.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Xml.dll"
 /nologo
 /warn:4
 /debug:full
 /optimize-
 /codepage:utf8
 "/define:DEBUG;TRACE"
 
 /t:library
 "C:\MVC3Playground\MVC3Playground.Data\AppConfiguration.cs"
 "C:\MVC3Playground\MVC3Playground.Data\DataContext.cs"
 "C:\MVC3Playground\MVC3Playground.Data\DB.cs"
 "C:\MVC3Playground\MVC3Playground.Data\Entities\Deal.cs"
 "C:\MVC3Playground\MVC3Playground.Data\IAppConfiguration.cs"
 "C:\MVC3Playground\MVC3Playground.Data\Properties\AssemblyInfo.cs"
 "C:\MVC3Playground\MVC3Playground.Data\Repositories\DealRepository.cs"
 "C:\MVC3Playground\MVC3Playground.Data\Repositories\IDbContextRepository.cs"
 





Unhandled Exception: Mono.CSharp.InternalErrorException: C:\MVC3Playground\MVC3Playground.Data\DataContext.cs(10,18): MVC3Playground.Data.DataContext ---> System.MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext'.



  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_parameter_info (intptr,System.Reflection.MemberInfo)



  at System.Reflection.MonoMethodInfo.GetParametersInfo (IntPtr handle, System.Reflection.MemberInfo member) [0x00000] in <filename unknown>:0 



  at System.Reflection.MonoMethod.GetParameters () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.MetadataImporter.CreateMethod (System.Reflection.MethodBase mb, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeSpec.get_MemberCache () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.MemberCache.GetInterfaceMethods (Mono.CSharp.TypeSpec iface) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.PendingImplementation..ctor (Mono.CSharp.TypeContainer container, .MissingInterfacesInfo[] missing_ifaces, Mono.CSharp.MethodSpec[] abstract_methods, Int32 total) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.PendingImplementation.GetPendingImplementations (Mono.CSharp.TypeContainer container) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ClassOrStruct.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 



  --- End of inner exception stack trace ---



  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: C:\MVC3Playground\MVC3Playground.Data\DataContext.cs(10,18): MVC3Playground.Data.DataContext ---> System.MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext'.



  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_parameter_info (intptr,System.Reflection.MemberInfo)



  at System.Reflection.MonoMethodInfo.GetParametersInfo (IntPtr handle, System.Reflection.MemberInfo member) [0x00000] in <filename unknown>:0 



  at System.Reflection.MonoMethod.GetParameters () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.MetadataImporter.CreateMethod (System.Reflection.MethodBase mb, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeSpec.get_MemberCache () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.MemberCache.GetInterfaceMethods (Mono.CSharp.TypeSpec iface) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.PendingImplementation..ctor (Mono.CSharp.TypeContainer container, .MissingInterfacesInfo[] missing_ifaces, Mono.CSharp.MethodSpec[] abstract_methods, Int32 total) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.PendingImplementation.GetPendingImplementations (Mono.CSharp.TypeContainer container) [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ClassOrStruct.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 



  --- End of inner exception stack trace ---



  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 







Unhandled Exception: Mono.CSharp.InternalErrorException: C:\MVC3Playground\MVC3Playground.Data\DataContext.cs(10,18): MVC3Playground.Data.DataContext ---> System.MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext'.


  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_parameter_info (intptr,System.Reflection.MemberInfo)


  at System.Reflection.MonoMethodInfo.GetParametersInfo (IntPtr handle, System.Reflection.MemberInfo member) [0x00000] in <filename unknown>:0 


  at System.Reflection.MonoMethod.GetParameters () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.MetadataImporter.CreateMethod (System.Reflection.MethodBase mb, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeSpec.get_MemberCache () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.MemberCache.GetInterfaceMethods (Mono.CSharp.TypeSpec iface) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.PendingImplementation..ctor (Mono.CSharp.TypeContainer container, .MissingInterfacesInfo[] missing_ifaces, Mono.CSharp.MethodSpec[] abstract_methods, Int32 total) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.PendingImplementation.GetPendingImplementations (Mono.CSharp.TypeContainer container) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ClassOrStruct.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 


  --- End of inner exception stack trace ---


  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

[ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException: C:\MVC3Playground\MVC3Playground.Data\DataContext.cs(10,18): MVC3Playground.Data.DataContext ---> System.MissingMethodException: Method not found: 'System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext'.


  at (wrapper managed-to-native) System.Reflection.MonoMethodInfo:get_parameter_info (intptr,System.Reflection.MemberInfo)


  at System.Reflection.MonoMethodInfo.GetParametersInfo (IntPtr handle, System.Reflection.MemberInfo member) [0x00000] in <filename unknown>:0 


  at System.Reflection.MonoMethod.GetParameters () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.MetadataImporter.CreateMethod (System.Reflection.MethodBase mb, Mono.CSharp.TypeSpec declaringType) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ImportedTypeDefinition.LoadMembers (Mono.CSharp.TypeSpec declaringType, Boolean onlyTypes, Mono.CSharp.MemberCache& cache) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeSpec.InitializeMemberCache (Boolean onlyTypes) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeSpec.get_MemberCache () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.MemberCache.GetInterfaceMethods (Mono.CSharp.TypeSpec iface) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.PendingImplementation..ctor (Mono.CSharp.TypeContainer container, .MissingInterfacesInfo[] missing_ifaces, Mono.CSharp.MethodSpec[] abstract_methods, Int32 total) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.PendingImplementation.GetPendingImplementations (Mono.CSharp.TypeContainer container) [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ClassOrStruct.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 


  --- End of inner exception stack trace ---


  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Build complete -- 1 error, 1 warning



---------------------- Done ----------------------


Assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.
Build: 1 error, 1 warning



So conclusion is:

1. Common user doesn't know how to switch to web server version.
2. Compiler shouldn't crash I think.
Comment 1 Mikayla Hutchinson [MSFT] 2012-05-01 20:29:47 UTC
I think I fixed the first part (using xsp4 when targeting .NET) in MD master. Please file a new bug if it still happens for you with MD 3.0, when that's released.

The second part - when targeting Mono - is because Mono does not support entity framework. But the compiler shouldn't have crashed. Reassigning to compiler.
Comment 2 Marek Safar 2012-05-02 03:26:11 UTC
Already fixed in Mono 2.11