I managed to cobble together a suitable implementation of a sample game in F# with xna. However when i try to instantiate my derived game class, the code throws a FileNotFound exception trying to access the Microsoft.Xna.Framework assembly. Why does this happen?
Code:
#light
open System
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Audio
open Microsoft.Xna.Framework.Content
open Microsoft.Xna.Framework.Design
open Microsoft.Xna.Framework.GamerServices
open Microsoft.Xna.Framework.Graphics
open Microsoft.Xna.Framework.Input
type SampleGame() as self =
class
inherit Game()
let mutable manager : GraphicsDeviceManager = null
let mutable spriteBatch : SpriteBatch = null
do
manager <- new GraphicsDeviceManager(self)
override Game.Initialize() =
base.Initialize()
override Game.LoadContent() =
spriteBatch <- new SpriteBatch(manager.GraphicsDevice)
base.LoadContent()
override Game.Update(gameTime) =
base.Update(gameTime)
if GamePad.GetState(PlayerIndex.One).Buttons.Back = ButtonState.Pressed then
self.Exit()
override Game.Draw(gameTime) =
manager.GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime)
end
let game = new SampleGame()
game.Run()
I have added the proper references by the way. Edit: after some exploration, i found that my F# project is being compiled to 64 bit, which does not work with the 32 bit XNA dlls. However VS 2010 doesnt let me change the solution platform. How do i fix this?