I am trying to code ASP.NET MVC views (WebForms viewer) in F #. I can already write regular ASP.NET WebForms ASPX, and it works fine, for example.
<%@ Page Language="F#" %> <% for i in 1..2 do %> <%=sprintf "%d" i %>
therefore, I assume that I have everything installed correctly in my web.config.
However, when I inherit the page from ViewPage:
<%@ Page Language="F#" Inherits="System.Web.Mvc.ViewPage" %>
I get this error:
Compiler Error Message: FS0442: Duplicate Method. The abstract method "ProcessRequest" has the same name and signature as an abstract method in an inherited type.
The problem is that this part of the code is generated by the F # CodeDom provider:
[<System.Diagnostics.DebuggerNonUserCodeAttribute>] abstract ProcessRequest : System.Web.HttpContext -> unit [<System.Diagnostics.DebuggerNonUserCodeAttribute>] default this.ProcessRequest (context:System.Web.HttpContext) = let mutable context = context base.ProcessRequest(context) |> ignore
when I change the page directive to use C #, the generated code:
[System.Diagnostics.DebuggerNonUserCodeAttribute()] public new virtual void ProcessRequest(System.Web.HttpContext context) { base.ProcessRequest(context); }
which of course works fine, and AFAIK is not semantically the same as the generated F # code.
I am using .NET 4.0.30319.1 (RTM) and RTM MVC 2 RTM
asp.net-mvc f #
Mauricio Scheffer
source share