开发者

The type 'x' in 'x.cs' conflicts with the imported type 'x' [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜