c# - 当我更改实时服务器 asp.net 上的根目录时,我的 Web 服务页面未运行
问题描述
当我在实时服务器中更改项目的根目录时,我的 Web 服务页面无法正常工作。
我使用的第一个目录是
https://ezitasker.com/App/Allporject.asmx
这工作正常。现在我只是将我的根目录更改为https://ezitasker.com/cp/App/Allproject.asmx
. 现在我的所有项目文件都可以正常工作,除了引发错误的 asmx 文件:
无法创建类型“Time_Doctor_WebApp.App.Allproject”。
第 1 行:<%@ WebService Language="C#" Codebehind="Allproject.asmx.cs" Class="Time_Doctor_WebApp.App.Allproject" %>
源文件:/Cp/App/allproject.asmx 行:1
版本信息:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.7.3690.0
代码隐藏文件是:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.Services;
namespace Time_Doctor_WebApp.App
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Allproject : System.Web.Services.WebService
{
[webmethod]
}
我搜索了很多东西,但没有得到任何帮助。更改到以前的根目录可以完美地工作,但我需要在新的根目录中处理我的文件。
谁能帮我?
解决方案
再看看错误——问题出在 asmx 文件中:
Source File: /Cp/App/allproject.asmx Line: 1
检查 asmx 文件的第一行并确保CodeBehind="..."
仍然指向正确的位置。
推荐阅读
- ssl - 如何在 IBm Cloud CloudFoundry 应用程序中激活证书?
- css - 圆角时如何调整下拉列表中的滚动条?
- java - mysql 10.1.21-MariaDB 的方言类名称是什么
- python - zapier - IOError:[Errno 30] 只读文件系统:'products.cvs'
- excel - 循环通过宏调用的 Excel 2013 宏仅适用于一张工作表
- sql - Hadoop SQL - Impala 和计算字段
- reactjs - React-Table 从状态打开子组件
- reactjs - 如何使用 TypeScript 正确键入 React 连接的组件
- php - Ajax Zip 文件下载 - WordPress Guru
- excel - 构建一个直到循环以循环一列直到空单元格