SFML community forums
Bindings - other languages => DotNet => Topic started by: Richy19 on April 20, 2011, 04:58:29 pm
-
Hi im trying to use SFML with C# but when i try to run my program i get:
Could not load file or assembly 'sfmlnet-window-2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I built the DLL's myself if it matters
-
Is it located in the same directory as the executable, or in a path where the .Net framework can find it?
-
Yea its in the same place as the .exe
-
Also this is the code i have
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFML.Audio;
using SFML.Window;
using SFML.Graphics;
namespace GameBase
{
class main
{
static void OnClose(object sender, EventArgs e)
{
// Close the window when OnClose event is received
RenderWindow window = (RenderWindow)sender;
window.Close();
}
static RenderWindow app;
static void Main(string[] args)
{
// Create the main window
app = new RenderWindow(new VideoMode(800, 600), "SFML window");
app.Closed += new EventHandler(OnClose);
// Start the game loop
while (app.IsOpened())
{
// Process events
app.DispatchEvents();
// Clear screen
app.Clear();
// Update the window
app.Display();
}
}
}
}
And this is how i have the CSFML DLL's set up
(http://img826.imageshack.us/img826/112/unledzv.png)
-
The error complains about sfmlnet DLLs, not csfml.
-
Hmm It must be a problem with VS2010 or how I built it, I just downloaded the 1.6 version and it works fine
-
I'm having the same problem, Built it with VS2010 on Windows7 64bit.