Server Error in ‘/’ Application. Parser Error Message: Could not create type xxx.xx

Posted: 2012-05-15 in .Net

Recently after moving some projects around we ran into a simple error on our web service pages:

Server Error in ‘/’ 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 ‘xxx.xDAG.Services’.

Source Error:

Line 1: <%@ WebService Language="C#" CodeBehind="Service.asmx.cs" Class="xxx.xDAG.Services"%> 

Source File: /Service.asmx    Line:

Solution

Right click on the asmx class (or asax class) in question (not the cs file)

select “view markup”

You should be presented with the same line as the error message.

What is wrong is the class attribute is incorrect.
Fix this by appending on the class name as well. For me VS had just inserted the namespace and not the class.
<%@ WebService Language=”C#” CodeBehind=”Service.asmx.cs” Class=”xxx.xDAG.Services.Service“%>

 

 

Advertisements

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 )

Google+ photo

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

Connecting to %s