1
\$\begingroup\$

I am not too sure what I have done to cause this, but even after undoing all my edits, this error still appears

Error 1 Cannot autodetect which importer to use for "Program.cs". There are no importers which handle this file type. Specify the importer that handles this file type in your project. (filepath)\Advanced Pong\AdvancedPongContent\Program.cs Advanced Pong

After receiving this error, everything between #if and #endif in the program.cs fades grey

using System;

namespace Advanced_Pong
{
#if WINDOWS || XBOX
static class Program
 {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static void Main(string[] args)
    {
        using (Game1 game = new Game1())
        {
            game.Run();
        }
    }
 }
#endif
}

I have searched this and could not find a solution anywhere. Any help is appreciated.

\$\endgroup\$
5
  • \$\begingroup\$ This is something for stackoverflow. It's not gamedev related. offtopic though: might I ask why you are checking if it's for xbox or windows...I mean if it's not, your program would never run anyways. \$\endgroup\$
    – Sidar
    Commented Nov 6, 2013 at 8:24
  • \$\begingroup\$ this is what XNA produces every time. I haven't touched anything in the program.cs file \$\endgroup\$
    – Evan
    Commented Nov 6, 2013 at 8:50
  • 2
    \$\begingroup\$ Is the Program.cs in the Content Project or in the actual code project? From the error, it sounds like it is in the content project. \$\endgroup\$
    – user9790
    Commented Nov 6, 2013 at 9:19
  • \$\begingroup\$ @Jaako Wow... Thank you. Turns out there was a duplicate of the original file in the content project area, where all the images are. Much appreciated. How did you realise this? \$\endgroup\$
    – Evan
    Commented Nov 6, 2013 at 9:28
  • \$\begingroup\$ @EvanKohilas Well the error was talking about (content) importers, so I just guessed that the file was in the content project :) \$\endgroup\$
    – user9790
    Commented Nov 6, 2013 at 13:09

1 Answer 1

0
\$\begingroup\$

A copy of the file was created and left in the content area of the project where all the images/sounds are. After removing the file, the game executed as per normal. Thanks to jaakko lipsanen

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .