Web服务错误无法创建类型“LookUp.LookUpService”。 [英] Web Service error Could not create type 'LookUp.LookUpService'.

查看:100
本文介绍了Web服务错误无法创建类型“LookUp.LookUpService”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在尝试托管一个网络服务,我可以将它部署到服务器上,但是当我尝试运行它时我会得到< b>无法创建类型'LookUp.LookUpService'。。



我已经在网上寻找解决方案,它不是命名空间问题,因为据我所知。它在调试中运行正常,但是当我尝试将其作为web服务添加到iis后尝试访问它时会抛出此错误。



这是我的代码。



Hi Guys,

I am trying to host a web service, i can deploy it to the server fine but when i try to run it i get "Could not create type 'LookUp.LookUpService'.".

I have scoured the web looking for a solution, it isnt a namespace issue as far as i can tell. it runs fine in debug but when im trying to reach it after adding it to iis as a webservice it throws this error.

Here is my Code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace LookUp
{
    /// <summary>
    /// Summary description for LookUpService
    /// </summary>
    [WebService(Namespace = "http://tempuri.com/")]
    [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 LookUpService : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
    }
}





这是我得到的错误。





And here is the error i get.

Server Error in '/LookUp' Application.

Parser Error
  Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

 Parser Error Message: Could not create type 'LookUp.LookUpService'.

Source Error:



Line 1:  <%@ WebService Language="C#" CodeBehind="LookUpService.asmx.cs" Class="LookUp.LookUpService" %>



 Source File:  /LookUp/LookUpService.asmx    Line:  1





任何人都可以给我一些关于我可能做错的建议吗?



问候

Carl



Can anyone give me some suggestions as to what i might be doing wrong?

Regards
Carl

推荐答案

您能否提供将此方法发布到IIS以及如何在浏览器中尝试访问它的方法。您是否使用专用应用程序池手动设置了应用程序。请提供尽可能多的数据。
Could you please provide the method in which you published this to IIS and how you are trying to access it in the browser. Did you set up the application manually with a dedicated application pool. Please provide as much data as possible.


这篇关于Web服务错误无法创建类型“LookUp.LookUpService”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆