Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is ASP.NET trying to generate a temporary class for a Web Service reference?

In Visual Studio 2008 I have a Class Library project (called Media) to which I added a Web Reference (not a Service Reference) to a third-party web service (wsdl). In the Class Library project a proxy class is created for using the service along with several classes for the types used in that service.

I also have a second Class Library (called Sync) that references the first one. And then I have a Web Site project that references the second class library. All of this is .NET 3.5

So Web Site > Class Library (Sync) > Class Library with web service reference (Media)

I want to step into the generated code, so I fire up the web site in IIS 7.5 and trigger the call to a method in the second class library (Sync) that in turn should call the web service proxy. I was fully expecting to hit the breakpoint, but instead got an exception:

Unable to generate a temporary class (result=1). error CS0029: Cannot implicitly convert type Media.WebService.multiValuedAttribute to Media.WebService.multiValuedAttribute[]

Why is ASP.NET trying to generate a temporary class? Don't I already have the generated class from the first Class Library (Media)? What kind of class is it trying to generate?

Thanks!

like image 502
Michiel van Oosterhout Avatar asked Nov 05 '22 10:11

Michiel van Oosterhout


1 Answers

You have a generated class that allows you to call the web service. ASP.NET is auto-generating a temporary class to serialize/deserialize the XML into.

like image 51
Jason Berkan Avatar answered Nov 15 '22 05:11

Jason Berkan