Fast Artificial Neural Network Library

Native C# .Net wrapper for FANN released

For a long time there has only been a SOAP wrapper to use from .Net languages, so there has been a need for creating a real native wrapper. Some people have created small custom wrappers for smaller parts of the FANN library (see here), but finally a full wrapper is available for .Net languages fanndotnetwrapper.


  1. Casper Casper
    February 18, 2011    

    Thank you! I have one, but your’s more better! Thus can you attach binary version of fanndoubleMT.dll to the downloads? I found it, but it is hard to find it of 2.1.0 version.

  2. April 9, 2011    

    can anyone explain me what a wrapper is. and what you are providing here also is it free for use.

  3. Wisard Wisard
    April 10, 2011    

    pleasee explain me how to use this, my c# project fails to run. do i need smth else except binding this dll and typing “using FANN.Net”? i’ve googled this all day long, but couldn’t find any little example.

    • October 18, 2011    

      There is an example c# program in the source code of the wrapper. This may help.

  4. jarek jarek
    December 6, 2011    

    I have some problems installing the wrapper.
    following readme file:

    1. i have downloaded fann and boost and put it in the folder with my project that will use fann.

    2. i have created a \Fann.Net directory

    3. went to to download a source code. It only lists a command to make a clone of repository and i cannot figure out what address to give to make my svn to download it locally (i usually use adress like ) but here it does not work.

    since i cannot download the source i tried downloading compiled version (file Fann.Net.dll and fanndoubleMT.dll right?) and put it instead of the code in folder. so far when i try to build the example program after including Fann.Net.dll in the project i get an error “Could not load file or assembly ‘Fann.Net.dll’ or one of its dependencies. The specified module could not be found.”

    since i have not downloaded the source properly i do not know if i follow the next steps right. is it ok to use compiled Fann.Net.dll and fanndoubleMT.dll to use the warper and fann?? how can i make it work? not sure how to continue

    also i’m not sure what they mean by “5. Set up your boost include path in the Fann.Net project”. in the boost docs they explain it for c++ environment. what path should I exactly include in my project?? hope someone can give me some light here…

    • Aaron Aaron
      April 28, 2012    

      I’m stuck right there… would love a step by step of what exactly to do with these in visual 2010.
      1) boost
      2) FANN 2.1.0
      3) wrapper source
      (They are sitting in a folder, ready to go)


      • Aaron Aaron
        April 28, 2012    

        I’ll write a lovely tutorial if someone helps me put this together…!

  5. jarek jarek
    December 6, 2011    

    also i cannot add reference to fanndoubleMT.dll in my vs2010 since it says: “please make sure this file is accesible and is COM component”. perhaps this is the dependency that is missing when i try to build?

  6. jarek jarek
    December 6, 2011    

    ok by coping Fann.Net.dll and fanndoubleMT.dll to my output folder i managed to reduce my problem to “Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.”

    i have found sth like that here:

    they say putting

    somewhere in configuration file helps. not sure what file and where in it they mean yet… hope my monologue will help someone…

  7. jarek jarek
    December 6, 2011    

    haha!!! i think it worked! I first found here:

    that configuration files should be created next to exe files plus “.config” after the name. so i created one for my application but then it would not lunch since it said it has been “externally changed”. true…

    so than i discovered i should actually create a configuration in my project ( and added the part mentioned in a previous link

    and it worked!! just giving details for those in the same situation, hope it helps!!!

  8. James James
    February 7, 2012    

    Another example of the configuration required to get .NET 4.0 projects working:

  9. Sergey Sergey
    May 13, 2012    

    here is an example for Fann.Net

  10. iskees iskees
    July 14, 2012    

    How to use. Net wrapper for FANN on 64 bit machine (Azure)?

  11. February 6, 2013    

    Hey, I know this topic is a bit old but I thought I’d give an answer here in case someone like me struggles to get a working version for 64 bit PCs !

    I only did it for Windows with VS2010 so I know nothing about how to do it for the other OS / compilers.

    First you need to download the FANN source code (2.1 or 2.2) and change the configuration Win32 to x64. With VS2010, you just have to create a new one, select x64, copy settings from win32, and select it for the project. This should change the target to /MACHINE:X64. Make sure that you don’t have WIN32 in your preprocessor directives. And change the output directory to /x64 or whatever you want so that it doesn’t override the 32 bit dll.
    If all goes well you should have your fann dll and lib files generated for x64.

    Now you need to recompile Fann.Net to use them. When you download the code, make sure you add an include folder which will contain the header files for fann & the boost library (if you don’t have it, you’ll need to download it as well), and that your library entry references the new x64 fann lib file. Change the configuration to x64 just like you did for the fann c++ project.

    If you use Visual Studio 2010, just know that by default, it will compile for the framework 4.0. For some obscure reason, it didn’t seem to work for me, so I needed to use the framework 3.5.
    To do that, you need to unload the project, modify the vcxproj and add v3.5 in the element , then save and reload the project. To get it to compile with the v90 tools, you need Visual Studio 2008. If you didn’t have it, you need to download and install Visual C++ Express 2008.
    Now the other issue is that if you didn’t have VS2008, chances are that the tools to compile for 64 bit environments were not installed. You’ll get them if you install the Windows SDK for Windows 7 and .NET Framework 3.5 SP1.
    And now, hopefully, you should have your Fann.Net.dll compiled for 64 bit :)

    • February 6, 2013    

      “and add v3.5 in the element” the tags were removed so I’ll use [ ] instead :

      and add [TargetFrameworkVersion]v3.5[/TargetFrameworkVersion] in the element [PropertyGroup Label=”Globals”]

  12. Felix Tafeu Felix Tafeu
    October 14, 2013    

    hey, i am new to .net. And i want to use wrapper.
    But i am having problems installing it and have it work.
    How can I include it my console application?

    I even tried to use the fann.dll but i keep getting the error message “The referenced component could not be found”. after i added the reference to my project.

    can someone please help? I am an amateur programmer and I am still trying to understand .net framework.

  13. Egon Egon
    December 7, 2014    

    Can me someone say, how to Programm a callback-routine. I want to use callback for the Training. thanks

  14. June 5, 2015    

    Github repo with fann 2.2, fann wrapper and boost 1.58 ready for x64 build on Visual Studio 2013 and 12.0 runtime. Instructions on github repo.

Leave a Reply