该类型'x.cs“与进口类型冲突'X''X' [英] The type 'x' in 'x.cs' conflicts with the imported type 'x'

查看:158
本文介绍了该类型'x.cs“与进口类型冲突'X''X'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是导致此生成错误?




类型'的 AriaLibrary.AriaBL.Book 的'

我:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\AriaBL\AriaBL.cs


< /块引用>

与进口类型冲突




AriaLibrary .AriaBL.Book在



我:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\bin\Debug\AriaLibrary.exe



使用
定义的类型'我:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\AriaBL\AriaBL 。的.cs



我:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\UI\Document\Book\frm_AddNewBookISO.cs 24 16 AriaLibrary



解决方案

您已经添加到项目的输出提供参考。



在换句话说,试图编译项目,AriaLibrary,生产AriaLibrary.exe时,编译进口组装AriaLibrary.exe。在磁盘上,该文件从先前版本存在



因此,编译器发现两块类,一个它试图现在来编译的,以及一个从该前一建立,这样的话你得到警告。



由于是对具有项目将被导入为对自身的引用输出没有任何正当理由,你可以安全地删除该引用



检查AriaLibrary项目的引用列表,删除具有相同名称,AriaLibrary。


参考

What is causing this build error?

The type 'AriaLibrary.AriaBL.Book' in

'I:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\AriaBL\AriaBL.cs'

conflicts with the imported type

'AriaLibrary.AriaBL.Book' in

'i:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\bin\Debug\AriaLibrary.exe'.

Using the type defined in 'I:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\AriaBL\AriaBL.cs'.

I:\Programing\MyProgram\Library\AriaNetDelijanCorporation\AriaLibrary\UI\Document\Book\frm_AddNewBookISO.cs 24 16 AriaLibrary

解决方案

You have added a reference to the output of the project.

In other words, when trying to compile your project, AriaLibrary, to produce AriaLibrary.exe, the compiler imports the assembly AriaLibrary.exe. On disk, this file exists from a previous build.

As such, the compiler finds two of that class, one that it tries to compile now, and one from that previous build, and thus you get the warning.

Since there is no valid reason for having the output a project being imported as a reference to itself, you can safely remove that reference.

Check the references list of the AriaLibrary project and remove the reference with the same name, AriaLibrary.

这篇关于该类型'x.cs“与进口类型冲突'X''X'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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