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

编程入门 行业动态 更新时间:2024-10-28 14:30:50
本文介绍了将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项目引用了Domain,而Domain引用了Businesslayer.当我们在VS 2017中进行编译时,在表示层中会出现数千个BC30653错误:

Obviously the Asp 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层中添加对Businesslayer的引用.为什么在VS 2017中有什么不同?

How do we solve this? We want to avoid adding a reference to Businesslayer in the Asp layer. And why is this different in VS 2017?

我尝试过的事情:

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

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

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

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

似乎与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的问题

本文发布于:2023-11-08 02:24:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568073.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   Net   VB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!