VS2008 更新 Web 参考在 Reference.cs 中创建命名冲突

发布于 2024-08-17 06:08:33 字数 784 浏览 3 评论 0原文

我有一个 Web 服务,当在一台计算机上使用 VS2008 更新时,该服务工作得很好,但在另一台计算机上则不然。关键区别在于自动生成的 Reference.cs 的内容。

在正确运行的环境中,这些方法具有完全限定的类名,引用类库中的类。然而,在问题环境中,类名是不合格的,并且部分类是在文件末尾附近声明的。例如

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

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

这会导致错误,例如:

''是.ClassType 和.ClassType 之间的不明确引用

该代码受源代码控制。签出到工作环境可以立即生效,只有在手动编辑 reference.cs 使其与工作环境相似时,签出到问题环境才有效。将项目手动从问题环境转移到工作环境只需要执行“更新 Web 引用”即可进行编译。这两个 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 environments. 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

躲猫猫 2024-08-24 06:08:33

好的,我有答案了。工作环境有一个早已被遗忘的扩展库,用于导入网络引用。 自定义生成的 Web 服务代理解释了该过程。我是这个项目的新手,所以对此一无所知!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文