The type 'x' in 'x.cs' conflicts with the imported type 'x' [closed]
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.
This happens when a Type namespace in your code has the same signature as a namespace in an imported DLL.
So in your case it seems you have a namespace AriaLibrary.AriaBL.Book
in your code which also exists in a referenced assembly
精彩评论