简体   繁体   中英

Weird compile error in Visual C#

I'm starting to think that Visual Studio is genuinly messing with me. My solution won't compile because of this one error:

The type "OpenTK.GameWindow" is defined in a unreferenced assembly. Add a reference to the assembly "OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4".

The problem is, I'm not even trying to use the OpenTK.GameWindow type. Furthermore, the 'error' occurs on a completely unrelated line of code:

Velocity.Y -= PhysicsSettings.Gravity * (float)VenCore.FrameTime;

If I comment out that line, the error moves to another line... ???

I've restarted my computer and VS multiple times. I've tried deleting all of the .suo's to no avail....

Try to completely rebuild your solution. It sometimes makes weird errors go away :-)

If a type you are using is it self using OpenTK.GameWindow and you haven't included that DLL you'll get an error message like the one you mention. If you comment out the line where you use the type that uses OpenTK.GameWindow you will get it at the next line the compiler sees that has the same problem

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