简体   繁体   中英

My Web Services page not running when i change root directory on live server asp.net

My web services page not working when I change the root directory of my project in live server.

The first directory I was using is

       https://ezitasker.com/App/Allporject.asmx 

which was working fine. Now I just changed my root directory to https://ezitasker.com/cp/App/Allproject.asmx . Now all my project files working fine except the asmx file which throws an error:

Could not create type 'Time_Doctor_WebApp.App.Allproject'.

Line 1: <%@ WebService Language="C#" Codebehind="Allproject.asmx.cs" Class="Time_Doctor_WebApp.App.Allproject" %>

Source File: /Cp/App/allproject.asmx Line: 1

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3690.0

The code-behind file is:

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]
    }

I searched so many things but not get any help. Change to previous root directory work perfectly but I need at new root directory to work my files.

Can anyone help me?

Have another look at the error -- the problem is in the asmx file:

Source File: /Cp/App/allproject.asmx Line: 1

Check the first line of the asmx file and make sure CodeBehind="..." still points to the right place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM