简体   繁体   中英

Why does Intellisense see a namespace, but compiler does not?

The screen shot below shows that VS 2012 intellisense picks up Helpers namespace from SendGrid namespace, but there is still a compile time error stating

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

SendGrid.Helpers intellisense

What I checked:

  • The project is .NET 4.5 and that never changed.
  • SendGrid and SendGrid.CSharp.HTTP.Client references both have v4.0.30319 runtime version, same as the rest of references.
  • Newtonsoft.JSON used by SendGrid is also the same runtime version.
  • Both are set to copy local True.
  • There are no other errors in the project.
  • F12 following a method from SendGrid.Helpers namespace navigates to its definition successfully, so I surmise there is no issue with the referenced DLL???
  • Cleaned and rebuilt the solution, restarted VS and machine.
  • Switched .NET version of the project between 3.5 and 4.5 several times back and forth.

SendGrid was added using Nuget to an existing project.

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

很多时候这是由设计时构建期间的构建中断引起的,请参阅https://github.com/dotnet/roslyn-project-system/blob/master/docs/design-time-builds.md#diagnosing-设计时构建有关诊断这些的说明。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM