gpt4 book ai didi

c# - 在 IIS 6.0 中启动 Web 服务 (.asmx)

转载 作者:行者123 更新时间:2023-11-30 20:09:54 26 4
gpt4 key购买 nike

我已经使用 C# 开发了一个带有 .asmx 扩​​展名的 Web 服务,我想将它部署到我的 VPS 中,它有带 IIS 6 的 Windows Server 2003。

服务使用 Framework 4.0 运行,并且它也安装在 VPS 中。当我将预编译版本上传到 VPS 时,它显示运行时错误

Server Error in '/' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>

谁能帮我解决这个问题?

更新

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to >service this request. Please review the specific error details below and modify your >configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names >are case-sensitive.

Source Error:

Line 26: Line 27:
Line 28: Line 29: Line 30: Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Source File: C:\Inetpub\vhosts\akashvahini.com\httpdocs\web.config
Line: 28

Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET >Version:2.0.50727.3053

这是在 web.config 中启用调试后的新错误消息

最佳答案

您应该启用调试以诊断问题。
微软对如何通过here启用详细调试有非常详细的解释。 .

Server Error in '/' Application.

该错误太笼统了,请在启用调试后检查输出并发布结果。
并且不要忘记在您的网站上线后禁用调试。

更新:
似乎与权限相关:
http://forums.iis.net/p/1042369/1454379.aspx
ASPNET 用户帐户需要包含您的 asmx 服务的文件夹的权限。

更新 2:您可以使用文件系统权限对话框授予 ASPNET 用户权限:
http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories

在较新版本的 Windows 上看起来可能有所不同。

关于c# - 在 IIS 6.0 中启动 Web 服务 (.asmx),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5610733/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com