我的 ASP.NET 应用程序在 Web 服务器上的 IIS 中运行,并使用 Microsoft .NET Framework 4 Beta 2。(其应用程序池设置为 .NET Framework 版本 .NET Framework v4.0.21006。)
它给出了这个新错误:
A potentially dangerous Request.Form value was detected from the client...
这是由于a breaking change在 .NET 4 中。
为了恢复 ASP.NET 2.0 请求验证功能的行为,我在 Web.config 文件中添加了以下设置:
<httpRuntime requestValidationMode="2.0" />
现在 Visual Studio 2008 抛出编译时错误:
The 'requestValidationMode' attribute is not declared.
而且我无法再使用 Visual Studio 附带的 ASP.NET 开发服务器在我的开发计算机上进行调试。
我需要 Visual Studio 及其 ASP.NET 开发服务器来识别新的 .NET Framework 4 requestValidationMode 属性。
如何在 .NET 4 中调试我的应用程序?我必须从 Visual Studio 2008 切换到 Visual Studio 2010 Beta 2 吗?
最佳答案
您无法使用 Visual Studio 2008 以受支持的方式开发 4.0 应用程序。目前只有 Visual Studio 2010 可用于开发 4.0 应用程序。从 2008 年开始,您可以使用它来开发框架的早期版本,但不能用于更高版本。
关于.net - 我可以在 Visual Studio 2008 中针对 .NET Framework 4 进行开发吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1836410/