High-Performance Development - C#, VB, SQL, ASP.NET

Slogan Text

Problem: Can Not Create Type

When you attempt to access your .ASMX page ASP.NEt displays the error:

Parser Error Message: Could not create type 'MyWebService'.

Solution 1: Align Namespace Name

The name in your ASMX file must match the namespace in the web service code behind file. Normall, when you create a new .ASMX file Visual Studio will set the namespace names correctly. The names may accidentally be changed during development.

  1. In Visual Studio open your markup file. Right-click on the .ASMX file. Select View Markup. See code below.
  2. Open in a 2nd tab the code behind file for .ASMX.
  3. Compare the namespace and class name in the markup file to those in the code-behind.
  4. If different make the appropriate changes.
  5. Rebuild and try accessing your .ASMX page.

<%@ WebService Language="VB" CodeBehind="MyWebService.asmx.vb" Class="MyWebService.MyWebService" %>

Solution 2: ASP.NET Framework Version

When the ASP.NET framework of the project does not match the ASP.NET framework of the IIS application pool for the web service application the "Can not create type" error can occur.

  1. Right-click Solution Explorer and select Properties.
  2. Select Compile and Advanced Compiler Settings.
  3. Note Target Framework setting.
  4. Open IIS.

Problem: Duplicate 'criptResourceHandler' section defined

When you attempt to access your web service's .ASMX page the system displays this error about your Web.Config file:

There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

Solution: Remove Section

I removed the section. At the moment I'm not sure if removing this section causes other problems.