SFML community forums

Bindings - other languages => DotNet => Topic started by: Richy19 on April 20, 2011, 04:58:29 pm

Title: SFML 2 problem
Post 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
Title: SFML 2 problem
Post by: Laurent on April 20, 2011, 05:10:42 pm
Is it located in the same directory as the executable, or in a path where the .Net framework can find it?
Title: SFML 2 problem
Post by: Richy19 on April 20, 2011, 05:38:20 pm
Yea its in the same place as the .exe
Title: SFML 2 problem
Post by: Richy19 on April 20, 2011, 05:59:26 pm
Also this is the code i have
Code: [Select]
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)
Title: SFML 2 problem
Post by: Laurent on April 20, 2011, 06:27:43 pm
The error complains about sfmlnet DLLs, not csfml.
Title: SFML 2 problem
Post by: Richy19 on April 20, 2011, 07:20:03 pm
Hmm It must be a problem with VS2010 or how I built it, I just downloaded the 1.6 version and it works fine
Title: SFML 2 problem
Post by: nonni on February 20, 2012, 11:26:38 pm
I'm having the same problem, Built it with VS2010 on Windows7 64bit.