SFML community forums

Bindings - other languages => DotNet => Topic started by: First on August 24, 2013, 05:09:54 pm

Title: How to connect SFML.NET to Visual Studio 2012?
Post by: First on August 24, 2013, 05:09:54 pm
Hello. When I plug in the VS2012 project SFML.NET library, displaying the error that the file is not available.

(RUSSIAN)- The library is not connected)
(http://s2.ipicture.ru/uploads/20130824/ZCw9Xwqr.jpg)

How to connect SFML.NET in VS2012? Tell me, please.
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: AleVerDes on August 24, 2013, 05:21:57 pm
I'm using this link to setting up my MSVS2012 for SFML.NET-development^ http://instilledbee.wordpress.com/2013/05/12/setting-up-sfml-net-2-0-to-work-with-visual-studio-2012-c-projects/
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: First on August 24, 2013, 07:11:40 pm
Tried it, does not work.  Writes:

Could not load file or assembly "sfmlnet-graphics-2, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null" or one of its dependencies. Attempt was made to load a program with an incorrect format.
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: First on August 24, 2013, 07:21:46 pm
Ray I fixed the problem. We had to use the x86
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: Curlybrace on August 28, 2013, 08:58:26 pm
Bump.

I cannot resolve this issue even with x86.

Seems its a standart problem. What i am doing wrong? I can't add external libraries to my probject. I am using C#.

Should i rebuild this libs or something?
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: SymegPL on August 28, 2013, 09:14:44 pm
csfml-window2.dll, csfml-graphics2.dll and csfml-audio2.dll are NATIVE dll's. You should add to references only MANAGED libraries (sfmlnet-window2.dll, sfmlnet-graphics2.dll and sfmlnet-audio)2.dll . NATIVE dlls must be in working directory.
Quote
http://www.sfml-dev.org/download/sfml.net/

(...)Since it's a .Net library, there's only one archive per architecture, which works for any OS and compiler. However, since the name of CSFML libraries appear in the source code, and are different on each OS, for OS X and Linux you will have to write a special configuration file which maps the names of the CSFML DLLs to the names of the corresponding CSFML shared libraries on your OS (for example, "csfml-graphics-2.dll" -> "libcsfml-graphics.so.2"); see the Mono documentation for more details.(...)
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: Curlybrace on August 28, 2013, 09:39:42 pm
csfml-window2.dll, csfml-graphics2.dll and csfml-audio2.dll are NATIVE dll's. You should add to references only MANAGED libraries (sfmlnet-window2.dll, sfmlnet-graphics2.dll and sfmlnet-audio)2.dll . NATIVE dlls must be in working directory.
Thanks. Solved.

Actually i don't underastand dll mapping,

I added all libs to my project, at extlib folder and made them always copy.
Added config file.
Map to /extlib/ (<dllmap dll="csfml-graphics-2.dll" target="/extlibs/csfml-graphics-2.dll"/>
???
Still Error.

So i just added this 5 libs tothe root of my project and made them copy themselfs as a content.
Title: Re: How to connect SFML.NET to Visual Studio 2012?
Post by: Drakmyth on September 16, 2013, 06:52:46 am
Looks like you're all set up and running but I wanted to post this here in case people come across it with the same problem. Since it looks like the other SFML.NET Project Template published in the gallery dropped support for VS2012, I went ahead and made one myself. It's not terribly hard to set it up yourself if you know what to do, but I thought I'd share this for a little extra convenience.

http://visualstudiogallery.msdn.microsoft.com/9b4ad5fc-e786-4cc2-9e48-9d3ced32d496