Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

C#
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.

XML
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


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

Regards
Carl
Posted
Updated 20-Apr-15 5:10am
v2

1 solution

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.
 
Share this answer
 
Comments
Richard Deeming 20-Apr-15 13:36pm    
Don't post questions or comments as new answers. Use the "Have a Question or Comment?" button under the question.
Carl Mailey 22-Apr-15 4:15am    
I created a website on the IIS 7.5 server, then right clicked it and selected Deploy>Configure Web Deploy Publishing. Exported the deploy file, then right clicked my project in visual studio and selected publish. Then imported my deploy file.

The website has a dedicated application pool and once the project is published the web service appears as a sub-application of the main one.

I have tried browsing to the web address and using localhost and both produce the same Error.

If any more information is needed please ask. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900