简体   繁体   English

ASP.NET MVC 3可以在ASP.NET 3.5网站中运行吗?

[英]Can ASP.NET MVC 3 run inside a ASP.NET 3.5 web site?

I would like to know if it is at all possible to get an MVC3 solution wrapped in a CWAB (Composite Web Application Block) solution built in 3.5? 我想知道是否可以将MVC3解决方案包含在3.5内置的CWAB(复合Web应用程序块)解决方案中?

I'm aware that in IIS, 2.0/3.5 and 4.0 sites can run next to each other (but in different application pools) but because of the CWAB layer I do not have this luxury. 我知道在IIS中,2.0 / 3.5和4.0站点可以彼此相邻(但在不同的应用程序池中),但由于CWAB层,我没有这种奢侈。 I got MVC2 running successfully before but MVC2 is on the 2.0 runtime if what I've read is true. 我之前成功运行了MVC2但是如果我读过的话,MVC2就在2.0运行时。

I would really like to use Razor as well so going back to MVC2 in this scenario is not really an option. 我真的很想使用Razor,所以在这种情况下回到MVC2并不是一个真正的选择。

It should be possible. 它应该是可能的。 Just set your application pool runtime to 4.0 instead of 2.0. 只需将应用程序池运行时设置为4.0而不是2.0。

.NET 4.0 runtime will be able to handle .NET 3.5 assemblies. .NET 4.0运行时将能够处理.NET 3.5程序集。

Razor requires features in .NET 4.0. Razor需要.NET 4.0中的功能。 However Tom Clarkson has a post called ASP.NET MVC 3 Razor View in SharePoint that talks about a (not-so-pretty) work-around. 然而,Tom Clarkson 在SharePoint中发布了一个名为ASP.NET MVC 3 Razor View的帖子,讨论了一个(不那么漂亮)的解决方法。 Basically, generate the view code from the cshtml files in .NET 4 and you can use them in .NET 3.5 (with a modified RazorEngine). 基本上,从.NET 4中的cshtml文件生成视图代码,您可以在.NET 3.5中使用它们(使用修改后的RazorEngine)。

I'm encountering the same issue. 我遇到了同样的问题。 The way I'm going to handle it is to write a WCF "front end" to SharePoint (.Net 3.5) and this will allow me to write the MVC app using MVC 3. 我将要处理它的方法是将一个WCF“前端”写入SharePoint(.Net 3.5),这将允许我使用MVC 3编写MVC应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM