views:

31

answers:

1

I have a ClickOnce app that accesses a bunch of web services. On the client, I have one project that wraps all the web services.

In the Properties for that project, if Build/Generate Serialization Assembly is Auto (which is the default), then everything works fine. I set the option to On, it compiles fine, then during runtime I get this error:

Line 786:    [WebMethod]
Line 787:    public CC.DTO.AdvertiserAssignmentRevenueDTO[] SearchAdvertiserAssignmentRevenue(byte[] AdvAssgnRevenueSearchFilter)
Line 788:    {
Line 789:        try

The Detailed Compiler Output is basically "CS0234: The type or namespace name 'DTO' does not exist in the namespace 'CC' (are you missing an assembly reference?)"

Why is this happening? Just FYI, this is a .NET 2.0 project running in VS2008.

+2  A: 

I had a very similar error message with the same symptoms. For me it would even run locally but not on a different server. It turned out I was missing a data contract declaration on one of my methods.

[DataContract (Namespace = ...)]

Double check your methods on the service and client to ensure they have all the needed attributes and declarations.

Jason Rowe