天天看点

如何在windows2003(IIS6)下配置IIS,使其支持cshtml

在开发环境机器上,安装WEB PAGES 后,会在 C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages 的下产生DLL

如何在windows2003(IIS6)下配置IIS,使其支持cshtml

其中

Microsoft.Web.Infrastructure.dll

System.Web.Helpers.dll

System.Web.Razor.dll

System.Web.WebPages.Administration.dll

System.Web.WebPages.Deployment.dll

System.Web.WebPages.dll

System.Web.WebPages.Razor.dll

是运行webpage必须的。

另外,web.config里增加

<compilation targetFramework="4.0">
        <assemblies>
          <add assembly="System.Web.WebPages.Razor" />
        </assemblies>
        <buildProviders>
          <add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
        </buildProviders>
      </compilation>
            

附件是一个DEMO,演示了IIS6可以运行cshtml

https://files.cnblogs.com/files/mqingqing123/webpagedemo.rar