Iis 如何在DotNetNuke上运行.cshtml

Iis 如何在DotNetNuke上运行.cshtml,iis,razor,dotnetnuke,Iis,Razor,Dotnetnuke,我正在尝试将网页添加到已安装在IIS 7.5上的网站。我在互联网上搜索了一个解决方案,试图更改.config文件,添加dll文件。当我将网页作为自己的网站运行时,该网页运行良好,但当我在已建立的网站上设置自己的url时,会产生错误 以下是错误: "The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for versio

我正在尝试将网页添加到已安装在IIS 7.5上的网站。我在互联网上搜索了一个解决方案,试图更改.config文件,添加dll文件。当我将网页作为自己的网站运行时,该网页运行良好,但当我在已建立的网站上设置自己的url时,会产生错误

以下是错误:

"The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' 
or later if you are compiling for version 4.0 or later of the .NET Framework. To 
compile this Web application for version 3.5 or earlier of the .NET Framework, 
remove the 'targetFramework' attribute from the <compilation> element of the 
Web.config file. Description: An unhandled exception occurred during the execution 
of the current web request. Please review the stack trace for more information 
about the error and where it originated in the code. 

Exception Details: System.Configuration.ConfigurationErrorsException: The value for 
the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if 
you are compiling for version 4.0 or later of the .NET Framework. To compile this 
Web application for version 3.5 or earlier of the .NET Framework, remove the 
'targetFramework' attribute from the <compilation> element of the Web.config file."
“提供程序选项中“compilerVersion”属性的值必须为“v4.0”
或更高版本(如果您是为.NET Framework 4.0或更高版本编译)。到
为.NET Framework的3.5版或更早版本编译此Web应用程序,
从的元素中删除“targetFramework”属性
Web.config文件.Description:执行期间发生未处理的异常
当前web请求的。有关详细信息,请查看堆栈跟踪
关于错误及其在代码中的起源。
异常详细信息:System.Configuration.ConfigurationErrorsException:的值
提供程序选项中的“compilerVersion”属性必须为“v4.0”或更高版本(如果需要)
您正在编译.NET Framework的4.0版或更高版本。若要编译此
对于.NET Framework 3.5或更低版本的Web应用程序,请删除
Web.config文件元素中的“targetFramework”属性。“

CSHTML文件可在DNN中的Razor主机模块中使用。您需要将该CSHTML文件添加到模块中,以便在DNN中显示该文件


也就是说,你确定这就是你真正想要做的吗?

。cshtml
本身并不是一个“网页”。这是一个MVC视图。它将不会解析为URL。