I hope some of you guys can help me with this problem ....
I have a class library containing, among other things, 1 complex class. this class library is used in two other projects in the solution. 1 = Console application, 2 = Web service application (website application).
In the console application, I created a link to the asmx web service, which passes my complex class as parameter 1 in a method call.
The class is of type: ScheduleSummaryTransport
The function that performs the work in the console application expects the object to be associated with the class library DLL, and not with a link to a web service. However, the web service call expects a parameter of type ... from the web service directory.
So how can i do
ClassLibrary.ScheduleSummaryTransport → WebService.ScheduleSummaryTransport?
I tried:
wsReporting.SendReportSummary( (Reporting.ScheduleSummaryTransport) scheduleSummary);
But in the visual studio a development-time error was detected: it is impossible to express an expression .....
Please help and thanks
Update
For completeness, more code:
private static void SendScheduleReport(ScheduleSummaryTransport scheduleSummary)
{
if (!Convert.ToBoolean(ConfigurationManager.AppSettings["EmailSummary"]))
{
return;
}
Trace.WriteLine(string.Empty);
Trace.WriteLine("Sending summary by email... please wait ");
Reporting.Reporting wsReporting = new Reporting.Reporting { Timeout = -1 };
wsReporting.SendReportSummary( (Reporting.ScheduleSummaryTransport) scheduleSummary);
Trace.WriteLine("Done...");
}
source
share