开发者

.Net webservice with name clash

I'm having trouble referencing a .Net web service within a web application. The problem arises because the webservice has another reference to an external dll with a class name identical to one of the classes within the webservice itself. Once I add开发者_开发技巧 that web service into my web application project, I get compilation errors from the generated class. It works fine within a website project (at least it compiles). However, if I understand correctly, a website project, unlike a web application project, compiles the code at run time. Would the webservice work in that kind of a project? And more importantly, how can I include external dlls in my webservice if they both share a class name that's identical?

Thanks


What you would do is when you add a service reference in Visual Studio, on the bottom of the Add Service Reference window, the Namespace field. Enter a different namespace here.

In a case where you have Ambiguous Types error, you specify the fully qualified name of the class you want.

Example : Add your service reference with the name "MyService"

Display(MyService.Product);

Display(MyProjectNamespace.Product);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜