Home > Misc > “Could not create type” error while browsing a web service

“Could not create type” error while browsing a web service

Hi,

You may come across below error after you deploy a web service application on IIS and try to browse the .asmx file.

Could not create type error

Could not create type error

Fix :-

Below are few reasons that cause this issue

  • Check your Application Pool of your hosted site is of .Net Framework 2.0 or higher
App pool framework

App pool framework

  • Verify all your web service  methods preceded with [WebMethod] tag
  • Add a Namespace tag to your web service class; (It should mostly resolve the problem)
    • Go to “.asmx.cs” file and set Namespace & Name
    • ‘Name’ value should match with your class name; In my case its “MyService”

[WebService(Namespace = “MyDomain”, Name = “MyService“)]

public MyService TelefonicService : System.Web.Services.WebService

{

[WebMethod]

public string HelloWorld()

{

return “Hello World”;

}

}

  • Clean, rebuild and deploy the web service

Below is a useful article that talks about the same issue

Link

Hope it helps 🙂

Advertisement
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: