Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use FileFormatException (?)

Tags:

c#

exception

xna

I'm currently writing a custom importer for my small XNA project and am trying to do something as simple as throwing a FileFormatException in my importer Import method.

I have referenced WindowsBase.dll, so FileFormatException should be available under System.IO in IntelliSense, right? I type System.IO and there is no autocomplete with FileFormatException under System.IO.

Here is where the throw statement is located:

namespace TetrominoImporter
{
    public class TetrominoReader : ContentImporter<Tetromino>
    {
        public const string blockFileName = "blocks.txt";

        public override Tetromino Import(string filename, ContentImporterContext context)
        {
            // HERE
like image 312
Toto Avatar asked Mar 20 '13 20:03

Toto


1 Answers

You need to include WindowsBase in your references, as FileFormatException is defined within that assembly. Once you've added that, you should be able to resolve System.IO.FileFormatException

like image 176
tnw Avatar answered Oct 24 '22 10:10

tnw