将VB.Net项目从VS 2010移动到VS 2017的问题 [英] Problem with moving VB.Net project from VS 2010 to VS 2017

查看:64
本文介绍了将VB.Net项目从VS 2010移动到VS 2017的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个15年的项目,要从Visual Studio 2010迁移到Visual Studio2017.该项目在VS 2010中可以正常编译,但是当我们尝试将其迁移到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.

基本上,我们有一个名为Security的业务层:

Basically, we have a Businesslayer with a class called Security:

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

然后我们有了一个Domainlayer,其中包含一堆使用安全性的类:

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

最后,我们有了一个使用DomainClass函数的Asp.Net项目:

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

很明显,Asp.net项目引用了Domain,而Domain引用了Businesslayer.当我们在VS 2017中进行编译时,在表示层中会出现数千个BC30653错误:

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.

我们该如何解决?我们希望避免在Asp.net层中添加对Businesslayer的引用.为什么在VS 2017中有什么不同?

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?

我尝试过的事情:

  • 清洁并重建
  • 更改对DLL而不是项目的引用
  • 在新的解决方案中,与上面的代码相同的错误,因此它并非特定于我们的解决方案.

推荐答案

我认为我在此线程中找到了问题的答案:

I think I found the answer to my question in this thread :

似乎与VS 2015中的新编译器如何处理传递引用有关.因此,我只需要添加它所要求的参考即可.

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.

这篇关于将VB.Net项目从VS 2010移动到VS 2017的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆