我们有一个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的问题
发布评论