简体   繁体   English

将VB.Net项目从VS 2010移动到VS 2017的问题

[英]Problem with moving VB.Net project from VS 2010 to VS 2017

We have a 15 year old project that we want to move from Visual Studio 2010 to Visual Studio 2017. The project compiles fine in VS 2010, but when we tried moving it to VS 2017 we got a bunch of errors. 我们有一个15年的项目,要从Visual Studio 2010迁移到Visual Studio2017。该项目在VS 2010中可以正常编译,但是当我们尝试将其迁移到VS 2017时,遇到了很多错误。

Basically, we have a Businesslayer with a class called Security: 基本上,我们有一个名为“安全性”的类的业务层:

<Serializable()> Public MustInherit Class Security
  Public Function GetPermission() As Boolean
  End Function
End Class

Then we have a Domainlayer with a bunch of classes that uses Security: 然后,我们有了一个Domainlayer,其中包含一堆使用Security的类:

<Serializable()> Public NotInheritable Class DomainClass
  Inherits BLL.Security
    Shadows Function GetPermission() As Boolean
    End Function
End Class

And finally we have an Asp.Net project using the DomainClass function: 最后,我们有一个使用DomainClass函数的Asp.Net项目:

Public Class PresentationLayerClass
   Private m_Domain As Domains.DomainClass
   m_Domain = new Domain.DomainClass()
   m_Domain.GetPermission()
End Class

Obviously the Asp.net project have a reference to the Domain and the Domain have a reference to the Businesslayer. 显然,Asp.net项目引用了Domain,而Domain引用了Businesslayer。 When we compile this in VS 2017 we get thousands of BC30653 errors in the presentation layer: 当我们在VS 2017中进行编译时,在表示层中会出现数千个BC30653错误:

BC30652 Reference required to assembly 'Business Logic Layer, Version=1.4.0.2, Culture=neutral, PublicKeyToken=null' containing the type 'Security'. Add one to your project.

How do we solve this? 我们该如何解决? We want to avoid adding a reference to Businesslayer in the Asp.net layer. 我们要避免在Asp.net层中添加对Businesslayer的引用。 And why is this different in VS 2017? 为什么在VS 2017中有什么不同?

[Edit:] Things that I have tried: [编辑:]我尝试过的事情:

  • Clean and rebuild 清理并重建
  • Changing references to the DLL instead of the projects 更改对DLL而不是项目的引用
  • I get the same error in a new solution with the code above, so it is not specific to our solution. 在上述代码的新解决方案中,我遇到了相同的错误,因此它并非特定于我们的解决方案。

I think I found the answer to my question in this thread : 我想我在这个线程中找到了问题的答案:

Why does VS 2015 need a reference to System.Data.Entity but VS 2013 does not? 为什么VS 2015需要引用System.Data.Entity但VS 2013不需要?

It seems like it has to do with how the new compiler in VS 2015 handles transitive references. 似乎与VS 2015中的新编译器如何处理传递引用有关。 So I will just have to add the reference it asks for. 因此,我只需要添加它要求的参考即可。

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

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