如何调试“在全局名称空间中找不到类型或名称空间名称'X'”?

时间:2019-12-24 08:29:31

标签: asp.net-core .net-core

由于某种原因,我找不到我尝试运行应用程序的错误:

One or more compilation failures occurred:
tjh2c1pv.qau(4,20): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(4,82): error CS0518: Predefined type 'System.Type' is not defined or imported
tjh2c1pv.qau(4,123): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(4,140): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(8,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(9,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(10,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(11,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(12,11): error CS0246: The type or namespace name 'Microsoft' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(13,11): error CS0246: The type or namespace name 'Microsoft' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(14,11): error CS0246: The type or namespace name 'Microsoft' could not be found (are you missing a using directive or an assembly reference?)
tjh2c1pv.qau(15,14): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(15,78): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(15,87): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(15,132): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(16,49): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(16,90): error CS1980: Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?
tjh2c1pv.qau(16,90): error CS0518: Predefined type 'System.Boolean' is not defined or imported
tjh2c1pv.qau(19,39): error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(25,24): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(25,118): error CS0518: Predefined type 'System.Void' is not defined or imported
tjh2c1pv.qau(27,24): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(27,71): error CS0518: Predefined type 'System.Void' is not defined or imported
tjh2c1pv.qau(29,24): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(29,87): error CS0518: Predefined type 'System.Void' is not defined or imported
tjh2c1pv.qau(31,24): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(31,83): error CS0518: Predefined type 'System.Void' is not defined or imported
tjh2c1pv.qau(33,24): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(33,71): error CS0518: Predefined type 'System.Object' is not defined or imported
tjh2c1pv.qau(33,71): error CS1980: Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?
tjh2c1pv.qau(33,71): error CS0518: Predefined type 'System.Boolean' is not defined or imported
tjh2c1pv.qau(33,92): error CS0518: Predefined type 'System.Void' is not defined or imported
tjh2c1pv.qau(19,67): error CS0115: '_Views_Default_Index.ExecuteAsync()': no suitable method found to override
tjh2c1pv.qau(24,18): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(26,18): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(28,18): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(30,18): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(32,18): error CS0400: The type or namespace name 'Microsoft' could not be found in the global namespace (are you missing an assembly reference?)
tjh2c1pv.qau(21,13): error CS0518: Predefined type 'System.Object' is not defined or imported
tjh2c1pv.qau(21,13): error CS0103: The name 'WriteLiteral' does not exist in the current context
tjh2c1pv.qau(21,26): error CS0518: Predefined type 'System.String' is not defined or imported
tjh2c1pv.qau(19,67): error CS0161: '_Views_Default_Index.ExecuteAsync()': not all code paths return a value

我不知道,我也找不到原因。

我该怎么办?我试图删除NugetFallbackFolder并关闭/重新打开解决方案文件并使用dotnet restore。但这没用。

0 个答案:

没有答案