MSBUILD : warning : Specified cast is not valid

At my current project we use Team Foundation Server together with the possibility to have a daily build through MSBuild. Over the weekend, the build failed. Because our 'build master' called in sick this morning, I took it upon me to fix the build. But compiling the sources was no problem, because that finished without any errors. And there were no failing (unit)tests. Even better: there were no tests which had run at all! There were 'no test results to display'. The only thing I found in the build log (which is pretty big in a 70+ project solution!) that could indicate a problem was a warning from MSBuild:

MSBUILD : warning : Specified cast is not valid

And, just below that line, the following one:

The previous error was converted to a warning because the task was called with ContinueOnError=true.

After some searching and trying, I found out TFS / MSBuild doesn't like it when your vsmdi file contains a list or sublist that doesn't contain any tests to run. Somehow this feels like a bug, because parsing the testlist fails when it has no members. List != null && List.Count > 0 anyone?

Technorati tags: ,

Published Mon, May 21 2007 10:41 PM by Rick van den Bosch
Filed under:

Comments

# re: MSBUILD : warning : Specified cast is not valid

Hi Rick,

I am getting the same error. I have two Test Lists named UnitTests and IntegrationTests and both are not empty. But still i am getting the same error. I have even removed tests and added them again in Test Lists but the problem persists. Please let me know what exactly solved your problem

Regards,

Rehan bhombal

rehan.bhombal@hotmail.com

Wednesday, December 22, 2010 8:23 AM by Rehan Bhomabl

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 1 and 1 and type the answer here: