c# - Web 服务仅适用于根文件夹

标签 c# web-services

所以我有一个 Web 服务,当我将它上传到根目录时可以正常工作

www.mysite.com/service.asmx

但是如果我将它上传到另一个文件夹,我会得到以下结果。

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /test/service.asmx

如果它们同时上传,测试文件夹中的那个指的是根目录,即使它们可能包含不同的代码。

任何想法,如果这还不够清楚,请写下您的问题和错误的回复。

最佳答案

您需要创建虚拟文件夹(在本例中为“测试”),然后您需要上传到该文件夹​​。

这就像告诉服务器将文件夹路径(例如 c:\web\mysite\test)解释为\test 上下文路径。

假设您使用的是 IIS,您可以使用 this 创建一个虚拟目录

关于c# - Web 服务仅适用于根文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14272591/

相关文章:

c# - Double.Epsilon 表示相等、大于、小于、小于或等于、大于或等于

c# - ASP.net c#,采用不同参数类型的同名方法

android - 使用 asp.net WebService 和 Android 将图像上传到 Azure Blob 存储?

java - 我的 eclipse IDE 中缺少 Webservice 选项

web-services - 这是网络服务的良好候选者吗?

c# - SendGrid 给邮件添加类别

c# - 我如何将字符串散列到特定数量的桶中

c# - 如何在 C# 中将 Array 转换为 List<object>?

android - 针对 Android、iPhone 等集成的 .NET Web 服务格式/协议(protocol)的建议

java - 如何在J2ME中读取和解析PHP对象