Forum Article

Betfair BOT SDK Login Query

On the SDK I receive the following error message every time I try to run any solution in Visual Studio.

“An unhandled exception of type 'System.Exception' occurred in BetfairApiConsole.exe

 throw new Exception("Please enter your betfair user name and password!");”


Can you please explain how / where I input my username and password to start these? 

Thanks in advance

  • Add Your Comment


    Please login to your bfexplorer account, if you want to add a comment to this article.

Comments ( 3 )

  • Stefan
    7.8.2016 12:23:25

    Actually all you need is just to read the code. To any console application you can enter command line arguments, and in the code of the console application those arguments are passed as array of strings.


    static void Main(string[] args)
        if (args.Length != 2)
            throw new Exception("Please enter your betfair user name and password!");
        var username = args[0];
        var password = args[1];
        var task = ExecuteMyTest(username, password);


    In the code you can see that the first argument (args[0]) represents your username and the second  argument (args[1]) your password. 

    Go to the Solution Explorer and on the BetfairApiConsole project click with your right mouse button, select Properties menu item, and click on it. 

    In the project properties window select Dubug, and in the Start Options sections, in the Command line arguments, enter your username and password. (the argument separator character is space). 

    Execute your bot sdk project, and your betfair credentials will be used to login to betfair thriugh betfair api. You can debug your test bot project or create your own ones. 

    In bfexplorer bot sdk you can find projects in C# or F# programming languages. 

  • Archie
    1.9.2016 13:55:08

    Hi Stefan,

    Thanks for this information. Instructions worked well.

  • shokkem14
    23.10.2016 22:20:44

    cayou use the betfair api without having to pay the £300 activation fee