开发者

VS2008 Update Web Reference creates naming conflicts in Reference.cs

开发者 https://www.devze.com 2022-12-16 17:34 出处:网络
I have a Web service which, when updated on one computer with VS2008 works perfectly fine, but on another computer does not. The critical difference is the contents of the auto-generated Reference.cs.

I have a Web service which, when updated on one computer with VS2008 works perfectly fine, but on another computer does not. The critical difference is the contents of the auto-generated Reference.cs.

In the correctly functioning environment, the methods have fully qualified class names, refering to classes in a class library. However, in the problem environment, the class names are unqualified and partial classes are declared near the end of the file. E.g.

public string MyMethod(MyClass pr_Class)
...
public partial class MyClass {
}

versus

public string MyMethod(Class.Library.Namespace.MyClass pr_Class)

This causes errors such as:

'<ClassType>' is an ambiguous reference between <ClassLibraryNamespace>.ClassType and <WebReferenceNamespace>.ClassType

The code is under source control. Checking out to the working environment works straight away, checking out to the problem environment will only work if the reference.cs is manually edited to be like the working enviro开发者_StackOverflow中文版nments. Transferring the project manually from problem environment to the working one only requires an "Update Web Reference" to be performed to allow compilation. Both Reference.cs files claim to be auto-generated by the same tool version. The settings from the good environment have been exported to the other. No success so far...

Any ideas would be greatly appreciated!

Matt


Ok, so I have the answer. The working environment has a long forgotten extension library for importing web references. Customizing generated Web Service proxies explains the procedure. I'm new to the project and so had no idea about this!

0

精彩评论

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