开发者

Why do I get this error in a WebServices project?

开发者 https://www.devze.com 2022-12-15 15:42 出处:网络
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.

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 projec开发者_Go百科t, 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消