c#生成的代码是指从项目中删除的程序集

时间:2017-10-18 15:16:40

标签: c# asp.net-mvc visual-studio-2017

编译项目时收到以下消息。

环境是Visual Studio Pro 2017.Net Framework 4.6

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required 
to service this request. Please review the following specific error details 
and modify your source code appropriately. 

Compiler Error Message: CS0234: The type or namespace name 'NAME' does not 
exist in the namespace 'FILE' (are you missing an assembly reference?)

Source Error:


Line 27:     using One.Assembly;
Line 28:     using Two.Assembly;
Line 29:     using NAME.FILE;

Source File: C:\LocalDisk\tempFile.cs  Line: 29 

它正在生成一个临时文件,该文件引用了一个程序集' NAME.FILE'已从解决方案中删除。

2 个答案:

答案 0 :(得分:0)

让我来描述一下这个场景,AAA.dll依赖于BBB.dll而BBB.dll依赖于CCC.dll,你有BBB.dll,但你需要在CCC.dll中添加一个参考,而AAA则是。 dll不需要直接引用CCC.dll,但你仍然需要它。

答案 1 :(得分:0)

原来它是对web.config文件中文件的引用。