473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Could not create type 'xxx' (trying to add web reference to project)

JT
Okay, I've seen about 4 years' worth of posts about this with no
viable solutions. I've spent 9 hours today trying to fix this. It
works BEAUTIFULLY on my local IIS installation, but when I publish to
my web host and try to add a web reference I get the following:

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 'BaseTaskWS'.

Source Error:
Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/
BaseTaskWS.cs" Class="BaseTaskWS" %>

Source File: /Services/BaseTask/BaseTaskWS.asmx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210

I have created plenty of web services. I have had two hosted by my
web host for months. They worked fine. Now I've published this and
tested it and I get that error. Also, my original two give me the
exact same error. I can see that the overall site is set to .NET 2.0,
but I can't see what the virtual directories are set to. The tech
support guy says that it defaults to the same as the overall site, but
he hasn't verified that it really is the same. Either this is the
worst initiation joke ever, or no one really knows how to fix it or
ever posts the true fix. Could some MS MVP or other guru please help
me out with this? I promise I'll post the answer for everyone else
that stumbles into this. I've tried just about everything I've seen
in all the posts in this forum and as many others as I could find in a
day and nothing fixes it.

I have a really big magnet, and I'm not afraid to use it! Don't make
me go there...

Thanks,

JT

Feb 20 '07 #1
2 9172
Hi,

JT wrote:
Okay, I've seen about 4 years' worth of posts about this with no
viable solutions. I've spent 9 hours today trying to fix this. It
works BEAUTIFULLY on my local IIS installation, but when I publish to
my web host and try to add a web reference I get the following:

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 'BaseTaskWS'.

Source Error:
Line 1: <%@ WebService Language="C#" CodeBehind="~/App_Code/
BaseTaskWS.cs" Class="BaseTaskWS" %>
How did you publish the code-behind to the web? The class BaseTaskWS is
not found.

In ASP.NET 2.0, there are three ways to publish web services:

1) Using the "New website" menu to create your project, you then copy
the source code files to the web server together with your other, usual
files (ASPX, ASMX...). No DLL involved here, the source code files will
be compiled on the fly. In that case, the reference to the class is
added using the same syntax as you copied above, but the class file must
be copied to the web server too.

2) Using the same option, but then using the "Build / Publish" menu.
This will precompile the site, creating a DLL. In this process, you
cannot specifiy the DLL's name. If you used the "publish" option, then a
"bin" folder is created and the DLL is found in that.

3) Using the Web Application Project (WAP) add-on. In this case you use
the menu "New project" and then under "Web" you select the "Web service
application" template. In that case, it's much more like ASP.NET 1.1,
and it's rather recommend to work with that add-on.

The WAP add-on is part of VS2005 SP1, but if you don't have SP1, you can
also install it separately from here:
http://webproject.scottgu.com/

I realize that this information might not be the cause of the problem,
but it's a start, so don't hesitate to ask more if that doesn't solve
your problem.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 20 '07 #2
JT
Hi Laurent,

Thanks for your reply. I used method 2.

Here's what caused my problem:
I created my virtual directory using the Helm control panel. The
instructions in my web host's knowledge base were very clear. I
didn't refer to the knowledge base. The path to my directory was
wwwroot/Services/BaseSecurity. The virtual directory was called
BaseSecurity, meaning I would reference it by wwwroot/BaseSecurity. I
was referencing it by wwwroot/Services/BaseSecurity. It didn't know
that was the same thing. I was giving it a true physical path, not a
virtual directory path. I've made them all the same so I don't forget
in the future and waste another day.

Note: No hard drives were harmed in the development of this web
service.

JT

Feb 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kevin Rose | last post by:
I upgraded by VS.NET to v2003 and I'm now attempting to upgrade all my project files. I have a solution with several projects. In project A is a interface called IForm which has 2 events:...
1
by: Rob R. Ainscough | last post by:
I keep getting this error message when I build my solution: Error: The dependency 'xxx.xx.xx, Version=1.0.2067.27633, Culture=neutral' in project 'xxx.xx.xx' cannot be copied to the run directory...
2
by: Richard Lewis Haggard | last post by:
I know this is a really simple thing but it is not intuitively obvious on how to do this the first time. I've created a remote server which lives in an EXE. This compiles. I've create a client...
0
by: Jahyen | last post by:
I'm trying to create a new web project using File...New...Project. The web server is on the internet and has FP2002 extensions installed. I can connect to the server using FP2002. If I try to...
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
17
by: Chris Podmore | last post by:
When I perform: EventLog.WriteEntry(strSource, strEntry, EventLogEntryType.Error, intEventID) The event viewer reports The description for Event ID ( 234 ) in Source ( Siclops_WS_Mobile )...
4
by: vncntj | last post by:
I've tested this project locally, by running it http://localhost:1436/Data/gift.aspx and everything is perfect. But if it onto the remote server I get "The type or namespace name could not be...
0
by: Rubber_Soul | last post by:
Hi, I create an application in VS2005 C#. There is some data which I send to a WebService to a company XXX. In my project I've added a Web reference to their WebServices and everything works...
4
by: RSH | last post by:
Hi, I have a situation where I have a class which manages different data connections. In trying to enforce encapsulation I have a member field called connection which could be a type of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.