【发布时间】:2019-07-24 17:58:57
【问题描述】:
我的代码开头有using System.Deployment.Application; 行。 Application 下有一条红色波浪线,将鼠标悬停在它上面会给我以下信息:
The type or namespace name 'Application' does not exist in the namespace 'System.Deployment' (are you missing an assembly reference?) (CS0234)
当我使用ApplicationDeployment 时,这当然会给我带来问题,上面写着The name 'ApplicationDeployment' does not exist in the current context (CS0103)
为什么 Visual Studio 告诉我 Application 不是 System.Deployment 的一部分?
【问题讨论】:
-
您是否引用了包含该命名空间的程序集?
-
@DanielA.White 我不这么认为...这是项目中唯一引用 System.Deployment.Application 的文件
-
@DanielA.White 我只是尝试运行
dotnet add package System.Deployment.dll行,终端说该项目不支持通过添加包命令添加包引用
标签: c# visual-studio-code