在c#控制台应用程序中,名称空间无法识别(即使它存在) [英] namespace not recognized (even though if it is there) in c# console application

查看:76
本文介绍了在c#控制台应用程序中,名称空间无法识别(即使它存在)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是错误,



Program.cs(9,7):错误CS0246:类型或命名空间名称'Newtonsoft'无法

被找到(你是否缺少using指令或程序集引用?)

Program.cs(10,7):错误CS0246:类型或命名空间名称'PushSharp'不能

可以找到(你是否缺少using指令或程序集引用?)

Program.cs(11,7):错误CS0246:类型或命名空间名称'PushSharp '无法找到
(您是否缺少using指令或汇编引用?)

Program.cs(12,7):错误CS0246:类型或命名空间名称'PushSharp'无法找到
(您是否缺少使用指令或汇编参考?)







(我搜索了许多网站,他们这样说(将项目目标框架设置为.Net Framework 4 Client Profile)我将其更改为.Net Framework 4。但是真的这是不对的为我工作...

and this is the error,

Program.cs(9,7): error CS0246: The type or namespace name 'Newtonsoft' could not
be found (are you missing a using directive or an assembly reference?)
Program.cs(10,7): error CS0246: The type or namespace name 'PushSharp' could not
be found (are you missing a using directive or an assembly reference?)
Program.cs(11,7): error CS0246: The type or namespace name 'PushSharp' could not
be found (are you missing a using directive or an assembly reference?)
Program.cs(12,7): error CS0246: The type or namespace name 'PushSharp' could not
be found (are you missing a using directive or an assembly reference?)



(And i searched many sites, they telling like this(set project target framework to ".Net Framework 4 Client Profile" I changed it to ".Net Framework 4"). but really its not worked for me...

推荐答案

确保将程序集(json.net和pushsharp)添加到项目引用中:

https://msdn.microsoft.com/en-us/library/wkze6zky.aspx [ ^ ]
Make sure the assemblies (json.net and pushsharp) are added to your projects references :
https://msdn.microsoft.com/en-us/library/wkze6zky.aspx[^]

您是否添加了对这些程序集的引用?使用xxx 添加是不够的,但你还必须添加对dll文件的引用。
Did you add a reference to these assemblies? It's noth enough to add using xxx but you also have to add a reference to the dll - files.


这篇关于在c#控制台应用程序中,名称空间无法识别(即使它存在)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆