Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"WebServiceBindingAttribute is required on proxy classes"

I'm working on an application that makes asynchronous calls to the WebService.

I added a proxy class to make asynchronous calls. The code compiles and runs properly, however whenever I try to double-click the proxy class in solution explorer (Visual Studio 2008) I am presented with a page

To prevent possible data loss before loading the designer, the following errors must be resolved: WebServiceBindingAttribute is required on proxy classes.

My proxy class is already defined this way

namespace AsyncCaller
{
    [WebServiceBindingAttribute(Name = "AsyncRequestSoap", Namespace = "http://tempuri.org/")]
    public class AsyncCallerProxy : SoapHttpClientProtocol
    {
        public AsyncCallerProxy()
        {
            this.Url = "http://localhost/MyAsyncService/AsyncService.asmx";
        }

So I can't see the reason for the error.

This is a very minor issue since I can still run the application, but I'm curious.

like image 365
Evgeny Avatar asked Dec 09 '08 22:12

Evgeny


2 Answers

Same problem here..
Just decorate your proxy class with the following attribute

[System.ComponentModel.DesignerCategoryAttribute("code")]

to get rid of the useless design mode.

like image 128
Gian Marco Avatar answered Nov 05 '22 18:11

Gian Marco


In the properties for the project. In the Build Tab. Select "Generate Serialization assembly:" to Off.

like image 13
AnthonyLambert Avatar answered Nov 05 '22 17:11

AnthonyLambert