I now found out if i reference to a older version of the SourceCode.HostClientAPI.Dll, the above code works.
The version 4.10320.10304.2 did not work.
The version 4.9152.1.0 works.
Are there any important changes between this two versions?
I was experiencing the same problem when specifying a username, password and windows domain.
I resolved the issue by including the domain in the username: Was using just "username", now "domainusername".
So, when using the SCConnectionStringBuilder, do the following:
connectionString.UserID = "domainusername";
connectionString.Password = "password";
connectionString.WindowsDomain = "domain";
New solution for a old problem.
The user, which will log on to the management server needs log on as a batch job permissions
Regards
uekur