简体   繁体   English

从VS2010 vb.net项目升级到dotnet 4上的VS 2013 Upd 4项目,导致服务引用出现问题

[英]Upgrade from VS2010 vb.net project to VS 2013 Upd 4 project on dotnet 4 causing issues with Service references

I have a WCF Service library built in Visual Studio 2010 targeting DotNet 4.0. 我有一个在Visual Studio 2010中构建的WCF服务库,目标是DotNet 4.0。

This WCF Service references an external service using service references to cause a windows service to do something when required. 此WCF服务使用服务引用引用外部服务,以使Windows服务在需要时执行某些操作。 All references were created through Visual Studio 2010 IDE. 所有引用都是通过Visual Studio 2010 IDE创建的。

The service reference is defined as MyService.Interface and this is how everything references it in code. 服务引用定义为MyService.Interface,这就是所有内容在代码中引用它的方式。

This all works great and no issues. 这一切都很好,没有问题。

Just installed a copy of visual studio 2013 Update 4 onto a virtual machine and imported a copy of the project. 刚刚将visual studio 2013 Update 4的副本安装到虚拟机上并导入了项目的副本。

Now, all my service references to this windows service in the code generated reference.vb file all are declared as global.MyService.Interface instead of just MyService.Interface. 现在,我在代码生成的reference.vb文件中对此Windows服务的所有服务引用都被声明为global.MyService.Interface,而不仅仅是MyService.Interface。

I now have hundreds of errors stating the type global.MyService.Interface is not defined. 我现在有数百个错误声明类型global.MyService.Interface未定义。

If I remove the root namespace of the WCF Project, this error is removed but the solution is then peppered with hundreds of other errors caused by removing the namespace. 如果我删除了WCF项目的根命名空间,则会删除此错误,但解决方案会因删除命名空间而导致数百个其他错误。

What I am wondering is what was added to VS2013 to make all service references have global. 我想知道的是VS2013添加了什么来使所有服务引用具有全局性。 added to the front of them in generated code (reference.vb), and is there a way to make it work like it used to so code generation doesn't include global. 在生成的代码(reference.vb)中添加到它们的前面,并且有一种方法使它像以前一样工作,因此代码生成不包括全局。 at the start of each reference? 在每个参考开始?

I have tried setting the namespace for the service reference in reference.svcmap but that made no difference. 我已经尝试在reference.svcmap中为服务引用设置名称空间,但这没有任何区别。

I have not yet tried svcutil as I don't want to have to go down a path of manually generating stuff that has worked for years just because VS2013 does something different now and there will be other developers who manage this and I don't want to have to have different methods of updating service references than they are used to just because of a version change in Visual Studio. 我还没有尝试过svcutil,因为我不想走这条路,手动生成已经工作多年的东西只因为VS2013现在做了不同的事情而且会有其他开发人员管理这个并且我不想要由于Visual Studio中的版本更改,必须使用不同的方法来更新服务引用。

I have done some searching and found plenty of cases where people had to add global. 我做了一些搜索,发现很多人不得不添加全局。 to their references, but in this case its the reverse - it was automatically added and I want to remove it from generated code but cant find where to do it. 他们的引用,但在这种情况下反过来 - 它是自动添加的,我想从生成的代码中删除它,但无法找到在哪里做。 I am hoping there is a check box that I can uncheck and it will magically go back to the way it was working. 我希望有一个我可以取消选中的复选框,它会神奇地回到它的工作方式。

Any assistance is greatly appreciated. 非常感谢任何帮助。

  • SAMPLE * Code from project opened in VS 2013 UPDATE 3. This code is generated as it always was... SAMPLE *在VS 2013 UPDATE 3中打开的项目代码。此代码始终生成...

 <System.Diagnostics.DebuggerStepThroughAttribute(), _ System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")> _ Partial Public Class ExternalInterfaceServiceClient Inherits System.ServiceModel.ClientBase(Of BOHInterface.IExternalInterfaceService) Implements BOHInterface.IExternalInterfaceService 

An the code that is generated for the same project in VS 2013 Update 4. The Global keyword has been added to the start of each reference of BOHInterface.IExternalinterface. 在VS 2013 Update 4中为同一项目生成的代码.Blobal关键字已添加到BOHInterface.IExternalinterface的每个引用的开头。

 <System.Diagnostics.DebuggerStepThroughAttribute(), _ System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")> _ Partial Public Class ExternalInterfaceServiceClient Inherits System.ServiceModel.ClientBase(Of Global.BOHInterface.IExternalInterfaceService) Implements Global.BOHInterface.IExternalInterfaceService 

The second one breaks everything and its the generated code in reference.vb. 第二个会破坏所有内容及其在reference.vb中生成的代码。

Any way to get code in VS2013 Update 4 to generate the same as in VS2013 Update 3? 有什么方法可以在VS2013 Update 4中获取代码以生成与VS2013 Update 3中相同的代码?

Incidentally - I am using VS2013 Update 3 until this is sorted :) 顺便说一下 - 我正在使用VS2013 Update 3,直到它被排序:)

Regards 问候

Rod. 竿。

I was having the same problem until the 10041 build of Windows 10. Try upgrading Windows 10 to the 10041 build. 直到10041版本的Windows 10,我遇到了同样的问题。尝试将Windows 10升级到10041版本。 I'm also using CTP 3 of Visual Studio 2013 Update 5. 我也在使用Visual Studio 2013 Update 5的CTP 3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM