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

前提是你 提交于 2020-01-17 01:19:09

问题


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.

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:

<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:

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. When we compile this in VS 2017 we get thousands of BC30653 errors in the presentation layer:

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. And why is this different in VS 2017?

[Edit:] Things that I have tried:

  • Clean and rebuild
  • Changing references to the DLL instead of the projects
  • I get the same error in a new solution with the code above, so it is not specific to our solution.

回答1:


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?

It seems like it has to do with how the new compiler in VS 2015 handles transitive references. So I will just have to add the reference it asks for.



来源:https://stackoverflow.com/questions/53538749/problem-with-moving-vb-net-project-from-vs-2010-to-vs-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!