Asp.net Web Service references enumeration in external DLL

Source: Internet
Author: User

When using Web Service in. net, I first defined a common enumeration variable in a common DLL package.

Snet. Common. identifier. memberrole

{

Networkowner = 3,

/// <Remarks/>
Networkmember = 4,

/// <Remarks/>
Networkadmin = 5

}

After referencing this DLL in member web service, I publish it to IIS, and then reference this web service in the Web site.

This definition is also found in the Web servicer instance, which can be seen in its reference. CS

Public Enum memberrole {

Networkowner,

/// <Remarks/>
Networkmember,

/// <Remarks/>
Networkadmin

}

Memberrole is called on the page. networkmember it references the definition of the web service instance. The value is 0, but it is nothing more than a class, unless I write the full path snet. common. identifier. memberrole. memberrole, then fainted and asked some colleagues.

The Web Service reference automatically adds the available definition to its reference. CS file, but its value has changed, because their context is different, then what should we do? There is a way to call the interface definition, do not pass in the enumeration value, pass an enumeration variable, or directly use the const variable.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.