Problem running MSTests with anonymous login

Hi,

we are migrating our old CruiseControl server to TeamCity but we are experiencing some problems running some test which need to connect to Sql Server. Our project is a .Net application + SQL Server, using Visual Studio 2008.

The error that TeamCity shows is:

System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'..

All the tests run succesfully from VisualStudio2008, but not from the agent. In the app.config file of the test project, we have explicitly indicated the user credentials to use in order to connect to the database, like this:

<DatabaseUnitTesting>
        <DataGeneration ClearDatabase="true" />
        <ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=BDSERVER;Initial Catalog=BD;User ID=user;Password=;Integrated Security=false;Pooling=False" />
        <PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=BDSERVER;Initial Catalog=BD;User ID=user;Password=;Integrated Security=false;Pooling=False" />
    </DatabaseUnitTesting>

but TC still tries to connect using anonymous NT login. Any idea why TC is not using the connection string provided?

Thanks a lot!!

Sergi

1 comment
Comment actions Permalink

Hi,

we solved the problem.

Actually, the connection string was fine, but in the config settings, we had specified a results file, and it seems that TC was reading the same results file once and again, even when in some step we eventually solved the problem when specified the correct connection string. We deleted the resultas file, and it began to show the correct results.

Thanks anyway.
Sergi

0

Please sign in to leave a comment.