4

I just added a new reference and added a using statement for the assembly I want. However, intellisense isn't picking it up and gives me squigly lines when I try to use it. When I go to compile it corrects itself and everything is fine... for about 60 seconds then it starts complaining again as if it didn't just realize the reference was really there.

Anyone run into this before and know how I might go about figuring out why Intellisense is confused?

Brandon Moore
  • 8,590
  • 15
  • 65
  • 120
  • how big is the reference you've just added? – Dhaivat Pandya Mar 29 '12 at 22:14
  • 1
    Is this ASP.NET, Silverlight, WPF or WinForms? I've seen something like this with ASP.NET code but everything else is usually rock solid. – ChrisF Mar 29 '12 at 22:14
  • Do you use ReSharper? I had a similar problem http://stackoverflow.com/questions/2231731/why-cant-i-reference-my-class-library – Brandon Mar 29 '12 at 22:15
  • Visual Studio very occasionally used to do this to me (old version of Resharper installed). Running a clean build, then restarting Visual Studio used to fix it for me. – dash Mar 29 '12 at 22:16
  • @DhaivatPandya Not big, and it's a project reference (which compiles fine) – Brandon Moore Mar 29 '12 at 22:16
  • @Brandon Nope, only tool I'm using that could possibly be interfering would be PostSharp. I suppose it's possible that it could be causing this but I think probably not. – Brandon Moore Mar 29 '12 at 22:18
  • Visual Studio compiles the intellisense at project build. I believe there is a configuration setting to force it to rebuild the index of possible values. I ran into this while developing a game engine in C. VisualStudio kept complaining about some of my references not actually existing until I forced a rebuild of that file each and every time the application loaded. – Mike McMahon Mar 29 '12 at 22:24
  • +1 for the funny title and congrats on the new Privilages with 2000+. What happens if you run Process Monitor, are you able to see what Visual Studio is doing to the file system at that 60 second mark? Also can you confirm which .Net Framework your targeting - when you change the target from .Net 3.5 to 4.0, VS adds references - I'm sure you know what I'm talking about.. especially if your targeting the Client Profile.If you show the Warnings in the Build window, does it give you a an error about it? whats the error? – Jeremy Thompson Mar 30 '12 at 04:21
  • @JeremyThompson Thanks, 60 seconds was just a rounded guesstimate... not exactly a scientifically derived number :) – Brandon Moore Mar 30 '12 at 07:49

1 Answers1

1

Basically, building the project fixed the problem. It was definitely telling me it couldn't find a reference that was there in the beginning, but I tried to 'correct' it not realizing that it was already correct. And there was some other confusion involved that I won't go into.

Long story short, Intellisense is not the habitual liar I thought it was... just a casual liar.

Brandon Moore
  • 8,590
  • 15
  • 65
  • 120