Solved

.NET 2013 ASMX Web Service Could Not Create Type

Posted on 2015-01-19
11
453 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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