简体   繁体   中英

Error CS0234 When Running Racing Game Demo

Hi I'm trying to run the Racing Game starter kit windows version when the multiple of these errors pop up:

C:\\Users\\IDMC\\Documents\\Visual Studio 2008\\Templates\\ProjectTemplates\\Visual C#\\XNA Game Studio 3.0\\RacingGame\\Shaders\\ShaderEffect.cs(11,17): error CS0234 : The type or namespace name 'Xna' does not exist in the namespace ' Microsoft ' (are you missing an assembly reference?)

I tried running the game c# project and have even created a project from existing code. I haven't touched xna in a long while so I'm kinda rusty...

Thanks in advance for your help.

Here are a few things you can check to try and rectify the error:

-Check if the correct version of XNA is installed

-Check if the correct version of the .NET framework is installed

-Check if you have the XNA dll in the references section of the solution explorer

-Check if the shader "ShaderEffect.cs" is in the same project/content project as the rest of your code

If all of this is true, try deleting the shader, commenting out all references to it, and building the program. If that doesn't work, you have a serious problem. If it does work, the shader file is broken. To fix it, I would recommend just creating a new blank shader file, copy pasting the code from the old one into the new, and then adding that to your project. If it still doesn't work, i'd have to look at the shader file's code to answer this.

This is quite straight forward. Download XNA Game Studio 3.0 here and then this will work. You may have XNA 4.0 installed, but this project is looking for XNA 3.0.

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