在 C# 中运行时 Web 应用程序中的服务器错误



我在2010年 ASP.NET 编写了Web应用程序。 在IIS中运行时,在Web配置中,显示服务器错误,第13()行身份验证模式)。我不知道原因,请帮助我。此代码为:

webconfig:
    Line 11:     <httpRuntime requestValidationMode="2.0" />
    Line 12:     <compilation debug="true" targetFramework="4.0"/>
    Line 13:        <authentication mode="Forms">
    Line 14:       <forms loginUrl="~/Login.aspx" defaultUrl="~/Home.aspx" timeout="30" protection="All" slidingExpiration="true"/>
    Line 15:        </authentication> 

尝试将.dll文件从 bin 文件夹(在源的位置)复制到 IIS 为项目创建的文件夹。不知道为什么在部署时有时会省略它的任何原因

您仍然没有发布"黄页"的确切错误

您可以尝试删除一些参数,例如

<forms loginUrl="~/Login.aspx" defaultUrl="~/Home.aspx" timeout="30" protection="All" slidingExpiration="true"/>

<forms loginUrl="~/Login.aspx"  timeout="30" slidingExpiration="true"/>

然后尝试删除完整的身份验证标记

<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" defaultUrl="~/Home.aspx" timeout="30" protection="All" slidingExpiration="true"/>
</authentication>

您可以逐步了解确切的错误。

您的系统中应该安装 .Net 4.0。

和 Nee 将项目的应用程序池更改为 .Net 4.0。目前DafultAppPool。

以更改值。在 ISS 管理器中选择您的网站,您可以在右侧看到高级设置。单击此选项将应用程序池更改为 .Net 4.0。

相关内容

最新更新