开发者

ASP.NET MVC 2 in IIS 6 just work with .NET 4

I have set the wildcard, in a virtual directory in the IIS 6 Windows Server 2003, pointing to the C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll but it didn't work. Then I try to set to the C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll and it worked fine. But I don't want that to work in v4, because I have other applications in the same app pool that need to work in .NET2.

I did this walkthrough that is the best I found, but it continues just working with .NET 4.

My solution at the moment is set a new VirtualDirectory that has an AppPool with the .NET 4 version. But this don't seem right, because for MVC2 should be enough the .NET35 SP1.

Anybody cross wit开发者_Go百科h this issue?

It should work with 3.5... I use the Reflector to check if there is any dll that use .NET 4 that might being messing this up, but I didn't find any.

Thanks!


I followed many of this kind of instruction but none of them worked. Actually they worked if I point to C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll. It makes no sense to point to the v4 isapi since it suppose to not have anything in .NET 4.

I try to find some .dll that maybe was pushing the application to work in .NET4 instead of 3.5, but I couldn't find any.

The solution to this was migrate to MVC 3 and use a clear .NET4, with no doubts, working fine and most recent version.

All fine now, but no real solution to the problem above.


I was able to get it to run in IIS6 against ASP version 2 and framework 3.5 by following some of the instructions on http://go.microsoft.com/?LinkId=9394801.

I have a virtual directory that adds a new extension .* and executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll and unchecked the 'check if file exists' option under the Virtual Directory tab's Configuration... button. After the below updates, the mvc app worked without specifying any extensions such as .mvc or .aspx. I haven't tested if this caused a performance hit.

My default global.asax.cs file now looks like

        routes.MapRoute(
            "Default",
            "{controller}/{action}/{id}",
            new { action = "Index", id = "" }
        );

        routes.MapRoute(
              "Root",
              "",
              new { controller = "Home", action = "Index", id = "" }
        );

ASP2 didn't recognize the <%: script tag, so I had to remove those and wrap the content with Response.Write(). E.g.

<li><%: Html.ActionLink("Home", "Index", "Home") %></li>

becomes

<li><% Response.Write(Html.ActionLink("Home", "Index", "Home")); %></li>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜