[Mono-bugs] [Bug 552457] New: MVC not using Views/Web.config

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 4 05:58:49 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=552457


           Summary: MVC not using Views/Web.config
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: jmiguel at sigma-data.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Description of Problem:


Steps to reproduce the problem:
1. Create a project ASP.NET MVC (with VS2008)
2. Create a class library (ie Config.cs) with a static class and a public
static string called 'zz', with a namespace name 'appnsname'
3. Edit the Web.config under the folder 'Views'
4. Under the section <pages>, add:
      <namespaces>
        <add namespace="appnsname"/>
      </namespaces> 
5. Edit the file Index.aspx under Views/Home, add <%= Config.zz %> to echo it's
value

If you run this project under VS2008 or in IIS, there is no error, and the page
has access to the namespace defined in the Web.config.

If you run this project with Mono you get:

Server Error in '/' Application

Compilation Error

Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error.

Compiler Error Message: CS0103: The name `Config' does not exist in the current
context

Source Error:

Line 13:     
Line 14:     <%= Config.zz %>
Line 15:     
Line 16: </asp:Content>

Source File: C:\Users\jmiguel\Documents\Visual Studio
2008\Projects\borrar_mvc_bug\borrar_mvc_bug\Views\Home\Index.aspx  Line: 15


Show Detailed Compiler Output:

C:\Program Files\Mono-2.4.2.3\bin\mono.exe "C:\Program
Files\Mono-2.4.2.3\lib\mono\2.0\gmcs.exe" /target:library
/lib:"C:\Users\jmiguel\Documents\Visual Studio
2008\Projects\borrar_mvc_bug\borrar_mvc_bug\Bin" /debug+ /optimize- /warn:4
/out:"C:\Users\jmiguel\AppData\Local\Temp\jmiguel-temp-aspnet-0\2858fb7f\App_Web_5c455977.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System\2.0.0.0__b77a5c561934e089\System.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web.Abstractions\3.5.0.0__31bf3856ad364e35\System.Web.Abstractions.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Web.Mvc\1.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll"
/r:"C:\Program
Files\Mono-2.4.2.3\lib\mono\gac\System.Data.Linq\3.5.0.0__b77a5c561934e089\System.Data.Linq.dll"
/r:"C:\Users\jmiguel\AppData\Local\Temp\jmiguel-temp-aspnet-0\2858fb7f\App_global.asax.3d0326c5.dll"
/r:"C:\Users\jmiguel\Documents\Visual Studio
2008\Projects\borrar_mvc_bug\borrar_mvc_bug\Bin\borrar_mvc_bug.dll"
/r:"C:\Users\jmiguel\AppData\Local\Temp\jmiguel-temp-aspnet-0\2858fb7f\App_Web_67464de7.dll"
 /nowarn:0169  --
"C:\Users\jmiguel\AppData\Local\Temp\jmiguel-temp-aspnet-0\2858fb7f\App_Web_5c455977_0.cs" 

C:\Users\jmiguel\Documents\Visual Studio
2008\Projects\borrar_mvc_bug\borrar_mvc_bug\Views\Home\Index.aspx(15,29): error
CS0103: The name `Config' does not exist in the current context


Show Complete Compilation Source:

Line 1: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage" %>
Line 2: 
Line 3: <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent"
runat="server">
Line 4:     Home Page
Line 5: </asp:Content>
Line 6: 
Line 7: <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent"
runat="server">
Line 8:     <h2><%= Html.Encode(ViewData["Message"]) %></h2>
Line 9:     <p>
Line 10:         To learn more about ASP.NET MVC visit <a
href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
Line 11:         
Line 12:     </p>
Line 13:     
Line 14:     <%= Config.zz %>
Line 15:     
Line 16: </asp:Content>
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433



How often does this happen? 

Allways

Additional Information:

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list