加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 为什么Intellisense会看到命名空间,但编译器却没有?

发布时间:2020-12-15 22:33:45 所属栏目:百科 来源:网络整理
导读:下面的屏幕截图显示VS 2012 intellisense从SendGrid名称空间中获取Helpers名称空间,但是仍然存在编译时错误说明 The type or namespace name 'Helpers' does not exist in the namespace 'SendGrid'(are you missing an assembly reference?) 我检查了什么:
下面的屏幕截图显示VS 2012 intellisense从SendGrid名称空间中获取Helpers名称空间,但是仍然存在编译时错误说明

The type or namespace name 'Helpers' does not exist in the namespace 'SendGrid'
(are you missing an assembly reference?)

SendGrid.Helpers intellisense

我检查了什么:

>该项目是.NET 4.5,从未改变过.
> SendGrid和SendGrid.CSharp.HTTP.Client引用都有
v4.0.30319运行时版本,与其余引用相同.
> SendGrid使用的Newtonsoft.JSON也是相同的运行时版本.
>两者都设置为复制本地True.
>项目中没有其他错误.
> F12跟随SendGrid.Helpers命名空间中的方法成功导航到它的定义,所以我猜测引用的DLL没有问题???
>清理并重建解决方案,重启VS和机器.
>来回切换3.5到4.5之间的项目的.NET版本.

使用Nuget将SendGrid添加到现有项目中.

解决方法

按照Hans的说法安装旧版本的SendGrid-4.0解决了这个问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读