Ask a Question related to ASP.NET Web Services, Design and Development.
-
hs #1
class convertion compilation error
I have a ClassLibrary(ClassLibrary1) with 2 classes (MyClass1, MyClass2).
(one inherits a DataSet, and the other requires a DataSet in its
constructor).
My Winform project and Asp.Net Web service both reference my
ClassLibrary1.dll.
My webservice has 2 methods (one returns MyClass1, the other MyClass2).
I keep getting compilation error -
Cannot implicitly convert Cannot implicitly convert type
'TestBed.localhost.MyClass1' to 'ClassLibrary1.MyClass1'
for this line of code -
MyClass1 mc = ws.GetMyClass1(); //ws = webservice
Any Help appreciated.
hs Guest
-
error message: Microsoft JScript compilation error '800a03ec'
Recieved following error message: Microsoft JScript compilation error '800a03ec' Expected ';' ... -
#25580 [WFx]: set_error_handler to a class/method resets class properties when error occurs
ID: 25580 Updated by: sniper@php.net Reported By: paul dot liversidge at recycledpixels dot com Status: Wont... -
#25580 [Opn]: set_error_handler to a class/method resets class properties when error occurs
ID: 25580 User updated by: paul.liversidge@recycledpixels.com Reported By: paul dot liversidge at recycledpixels dot com... -
#25580 [NEW]: set_error_handler to a class/method resets class properties when error occurs
From: paul dot liversidge at recycledpixels dot com Operating system: Windows XP PHP version: 4.3.2 PHP Bug Type: ... -
Server Error in '/' Application - Compilation Error - Temporary ASP.NET Files
I have a site that works fine on my local box. I then copy it to my production server (Win2003) and when I try to access the site I get: Server... -
hs #2
Re: class convertion compilation error
Found the answer. (not sure why though)
I was doing -
TestBed.localhost.Service1 ws = new TestBed.localhost.Service1();
MyClass1 mc = ws.GetMyClass1();
should be -
TestBed.localhost.Service1 ws = new TestBed.localhost.Service1();
TestBed.localhost.MyClass1 mc = ws.GetMyClass1();
"hs" <hs@nospam.syn> wrote in message
news:%23fi8otcUDHA.1004@TK2MSFTNGP12.phx.gbl...> I have a ClassLibrary(ClassLibrary1) with 2 classes (MyClass1, MyClass2).
> (one inherits a DataSet, and the other requires a DataSet in its
> constructor).
>
> My Winform project and Asp.Net Web service both reference my
> ClassLibrary1.dll.
>
> My webservice has 2 methods (one returns MyClass1, the other MyClass2).
>
> I keep getting compilation error -
>
> Cannot implicitly convert Cannot implicitly convert type
> 'TestBed.localhost.MyClass1' to 'ClassLibrary1.MyClass1'
>
> for this line of code -
>
> MyClass1 mc = ws.GetMyClass1(); //ws = webservice
>
> Any Help appreciated.
>
>
hs Guest
-
Tian Min Huang #3
Re: class convertion compilation error
Hello,
The error message showed the reason. :-)
After adding reference the web service, the return type of ws.GetMyClass1()
is TestBed.localhost.MyClass1. It is not ClassLibrary1.MyClass1. Yes, we
know that the two classes are the same. However, for the compiler, it has
no knowledge of it. What it knows is that these two classes have the same
name but belong to different namespaces. So it feels that they are
different classes. That is why you got that error message.
Did this answer your question?
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! ¨C [url]www.microsoft.com/security[/url]
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Tian Min Huang Guest



Reply With Quote

