0

In the image bellow (click the link), my System.Math class is not recognized.

I DO have Using System; at the beginning of my class. So Math should be available to me, should it not?

However,but Math isn't recognized by intellisense. Also, the Math.PI that I have in the image is not underlined in red.

This must mean that Math is available but also not recognized at the same time...?

Can somebody help me with this please?

Image link Below:

Math.PI is not underlined in red, but Math isn't recognized by intellisense.

Pierre Gravelle
  • 53
  • 2
  • 15
  • 1
    try restarting VS – user1336827 Jan 12 '17 at 17:39
  • I have already restarted it multiple times. This problem has been happening for the past 4 days. – Pierre Gravelle Jan 12 '17 at 17:40
  • 1
    What version of the framework are you using? And do you have your own `Math` class anywhere? A naming conflict might cause this. –  Jan 12 '17 at 17:41
  • I'm using .Net V.4.5.2 because that's the framework that my teacher used for his solution. – Pierre Gravelle Jan 12 '17 at 17:43
  • I also do not use a differnt math Class.... as for the "Using System;" yes, as stated in the question I do hacve it at the beginning of my .cs file – Pierre Gravelle Jan 12 '17 at 17:44
  • Here's a link to the top of my .CS file http://imgur.com/dtjQGh9 – Pierre Gravelle Jan 12 '17 at 17:46
  • In the image you posted, you haven't typed the `.` yet. You need to type the `.` before the intellisense kicks in. – Matthew Watson Jan 12 '17 at 17:50
  • Ah, sorry about that. I'll send a photo showing that the Intellisense doesn't show anything after I put the . http://imgur.com/KCEO5UE – Pierre Gravelle Jan 12 '17 at 17:54
  • Close Visual Studio and then delete your solution options file (.suo). It's a hidden file in the same folder as your project's solution file (.sln). Sometimes it gets corrupted or something... Visual Studio will recreate it the next time you open your project. This usually fixes Intellisense errors for me. EDIT: Also, note that Intellisense may have issues if your project doesn't compile. Make sure you've fixed any compilation errors. – RogerN Jan 12 '17 at 17:58
  • Posible duplicate http://stackoverflow.com/questions/17703004/visual-studio-displaying-errors-even-if-projects-build http://stackoverflow.com/questions/31943634/visual-studio-2015-intellisense-errors-but-solution-compiles – Bruno Guardia Jan 12 '17 at 18:01
  • Thank you for the reply, however deleting my .Suo file did not fix the problem. I even refreshed my intellisense. @BrunoGuardia those questions are not the same as mine. The first link doesn't have anything to do with Intellisense from what I can see, and the second link states that errors come up with the person's intellisense. My project doesn't underline Math.PI in red, which means there's no error. – Pierre Gravelle Jan 12 '17 at 18:01
  • You are right, I meant this one: http://stackoverflow.com/questions/31943634/visual-studio-2015-intellisense-errors-but-solution-compiles Update your references (you may see one that appears broken or with a warning, which is correctly resolved on build) – Bruno Guardia Jan 12 '17 at 18:05
  • @BrunoGuardia My project does have Reference warnings, however my teacher told me that this is to be expected because they are XML files. This is his MathPhysicsEngine that we're using for our Math and Physics for Games class. So I have a feeling updating references (which I don't know how to do) might break my teacher's engine. http://imgur.com/rIMNSbL – Pierre Gravelle Jan 12 '17 at 18:09
  • Just update references path directly in the XML. That shouldn't break anything, and is easy to revert if it causes a break – Bruno Guardia Jan 12 '17 at 19:27
  • @PierreGravelle, you can back up your solution then try to update the references. If not works, you can try to create a new C# project with the same project type and targets to the same .NET Framework version, then check this issue again. Or open an administrative CMD window and navigate to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE, run the command: devenv /safemode in the elevated command. If this works fine, it means the installed extensions affect this issue, go to Tools-Extension and updates-Installed, remove the installed extension one by one to find the culprit. – Sara Liu - MSFT Jan 13 '17 at 06:47
  • @PierreGravelle, does your issue persists or not? – Sara Liu - MSFT Jan 16 '17 at 07:26
  • My issue isn't happening anymore, sorry about that! Should've closed this question. Turns out my frameworks were bugged, so I had to delete them and copy/paste new ones from my Instructor's computer. The issue was fixed as soon as the frameworks were re-added. – Pierre Gravelle Jan 19 '17 at 18:55

1 Answers1

0

Turns out my frameworks were bugged, so I had to delete them and copy/paste new ones from my Instructor's computer. The issue was fixed as soon as the frameworks were re-added.

Pierre Gravelle
  • 53
  • 2
  • 15