簡體   English   中英

將VB.Net項目從VS 2010移動到VS 2017的問題

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

我們有一個15年的項目,要從Visual Studio 2010遷移到Visual Studio2017。該項目在VS 2010中可以正常編譯,但是當我們嘗試將其遷移到VS 2017時,遇到了很多錯誤。

基本上,我們有一個名為“安全性”的類的業務層:

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

然后,我們有了一個Domainlayer,其中包含一堆使用Security的類:

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

最后,我們有一個使用DomainClass函數的Asp.Net項目:

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

顯然,Asp.net項目引用了Domain,而Domain引用了Businesslayer。 當我們在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.

我們該如何解決? 我們要避免在Asp.net層中添加對Businesslayer的引用。 為什么在VS 2017中有什么不同?

[編輯:]我嘗試過的事情:

  • 清理並重建
  • 更改對DLL而不是項目的引用
  • 在上述代碼的新解決方案中,我遇到了相同的錯誤,因此它並非特定於我們的解決方案。

我想我在這個線程中找到了問題的答案:

為什么VS 2015需要引用System.Data.Entity但VS 2013不需要?

似乎與VS 2015中的新編譯器如何處理傳遞引用有關。 因此,我只需要添加它要求的參考即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM