Solved

.NET 2013 ASMX Web Service Could Not Create Type

Posted on 2015-01-19
11
410 Views
Last Modified: 2015-01-29
I upgraded a .NET 2008 app to 2013.  There is a web service in the application.  I am receiving below error:

Could not create type 'PremiumAdmin.webService.getInsuredInfo'.      

I think the issue is associated with the class on the ASMX page.  

ASMX
<%@ WebService Language="c#" Codebehind="~/App_Code/webService/getInsuredInfo.asmx.cs" 
    Class="PremiumAdmin.webService.getInsuredInfo" %>

Open in new window


ASMX.cs
namespace PremiumAdmin.webService
{
	/// <summary>
	/// Summary description for getInsuredInfo.
	/// </summary>
	[WebService(Namespace="http://mywebsite.com/webservices/")]
	public class getInsuredInfo : System.Web.Services.WebService
	{
		public getInsuredInfo()
		{
			//CODEGEN: This call is required by the ASP.NET Web Services Designer
			InitializeComponent();
		}

Open in new window


This does not have issues in .NET 2008.  Any ideas?

Thanks
0
Comment
Question by:CipherIS
  • 6
  • 4
11 Comments
 
LVL 15

Accepted Solution

by:
navneethegde earned 250 total points
ID: 40559245
HI!

make that  markup as

<%@ WebService Language="c#" Codebehind="getInsuredInfo.asmx.cs" 
    Class="PremiumAdmin.webService.getInsuredInfo" %>

Open in new window






Thanks!
Navneet
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40559754
That is what I have.  It's not working.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40560090
How many web methods do you have?

How complex is the web service?

Would recreating in WCF be a possibility?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40560101
Can't create a WCF at the moment.  I created a web application.  I copied the .NET 2008 website to the .NET 2013 web app.  I included all the files.  When compiling I am getting that it can't create the type.

Also, on the asmx page it says on the codebehind="~/App_Code/webService/getInsurcedInfo.asmx.cs" (when I hover over it) that it can't find that file but the file is exactly there.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40560765
I believe that this is a case where migration doesn't work.

The attribute in your file is "Codebehind", but in the new file, it is "CodeBehind".  Try changing the attribute to "CodeBehind".

<%@ WebService Language="C#" CodeBehind="EchoWebService.asmx.cs" Class="EchoWebService.EchoWebService" %>

Open in new window

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:CipherIS
ID: 40561785
Changed it to "CodeBehind".  Doesn't work.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 40562103
Can you do a quick test, by creating a new web service, and adding a web method,

1) Create an empty ASP.NET web project

2) Set target framework to 4.5

3) Add an .asmx web service

4) Add a web method

5) Compile
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40573854
That works.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40574359
There is something going on that I can't see.  

What files are included in the project?

"I copied the .NET 2008 website to the .NET 2013 web app.  I included all the files.  When compiling I am getting that it can't create the type."
Can you explain how you did this?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40578292
I started the migration again and its working.  Don't know why now.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40578295
Thanks for your help.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Exception in Log4Net 1 20
C# Connection String for Oracle database is not working 22 52
VB.NET HttpWebRequest 12 34
Birthdays 3 21
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now