TeamCity Unit Tests with WCF and IIS Express

My team and I are having trouble figuring out how to test our WCF services with TeamCity.  There are 2 main issues: IIS Express and Microsoft.VisualStudio.TestTools.UnitTesting.  What attributes do we set to get the unit tests to not fail in TeamCity?  Below are a few specs:

1. IIS Express URL: http://localhost:49663
2. We are using Unity for dependency injection with a custom ServiceHostFactory that maps the correct class.

I know where the files are placed on the TeamCity server when Commits are performed, but does that relate to [AspNetDevelopmentServer] somehow?

If more information is necessary, let me know.  Any suggestions are appreciated.  Thanks!

1 comment
Comment actions Permalink

Hello,

Please check user account that you use to run build agent windows service. There could be a user rights issue.
TeamCity MSTest runner simple starts MSTest.exe process for you. Please try running tests from MSTest.exe to check if MSTest.exe is simply able to run such tests without Visual Studio host. Another case could be that to start IIS under the tests it's required to have Visual Studio installed on the agent's machine.

0

Please sign in to leave a comment.