Unable to use FileFormatException (?)

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

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

Here's the throw statement:

 namespace TetrominoImporter { public class TetrominoReader : ContentImporter<Tetromino> { public const string blockFileName = "blocks.txt"; public override Tetromino Import(string filename, ContentImporterContext context) { // HERE 
+8
c # exception xna
source share
1 answer

You need to include WindowsBase in your links since this assembly defines a FileFormatException. After you have added this, you should be able to resolve System.IO.FileFormatException

+16
source share

All Articles