无法在webconfig中设置httpRuntime requestValidationMode =“2.0”

问题描述 投票:0回答:1

我已将 Web 应用程序从 2.0 切换到 4.0。

我有一个 validateRequest="false" 问题,我需要从 aspx 页面读取 xml 文件(该页面被另一个网站调用,用户看不到)。在2.0中它运行得很好。现在另一个网站返回错误500。 我在 google 上发现,在 webconfig system.web 中,我必须设置,但属性 requestValidationMode 无效(并且智能感知在 VS 中没有向我显示它)...

我怎样才能做到这一点?

谢谢

asp.net .net .net-4.0
1个回答
0
投票

您添加此代码

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime requestValidationMode="2.0" />
</system.web>

Nota : On IIS :  Right click on WebSite 
                 - Select> Properties > ASP.NET > Version > 
                 - Select 4.0.21006 not 2.0
© www.soinside.com 2019 - 2024. All rights reserved.