FileConfigurationSource in VS Unit Tests

Topics: Enterprise Library Core, General discussion
Sep 25, 2007 at 1:20 AM
The FileConfigurationSource is using AppDomain.CurrentDomain.BaseDirectory as the path where to find the file when the filePath is not "rooted".

Running VS tests in 2005, it will correspond ...\TestResults\"Guid"\Out folder which is fine.

However in 2008, it corresponds to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\, throwing a FileNotFoundException.

Can it be something incorrecly configured in my VS2008 test-related settings? As I look through AppDomain.CurrentDomain properties, the only path pointing to the appropriate TestResults\...\Out folder would have to be the SetupInformation.ConfigurationFile property.

Any clues?
Sep 25, 2007 at 12:12 PM
Hi Francois,

This seems like a bug in VS2008's unit test runner, and it's pretty serious in my opinion. They did some changes to make deployment optional that might be related to this behavior; however I tried running the tests with and without deployment and neither worked as expected.

I couldn't find the bug in Connect; the closest match was http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=122822.
If you're willing to log the bug yourself, please do it asap so it has a fighting chance of being fixed for RTM.

Thanks,
Fernando
Sep 25, 2007 at 2:45 PM
I've logged feedback here.

People should go and vote!

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299578
Sep 25, 2007 at 3:04 PM
You've got my vote ;)

They have a new feature to avoid deploying the tests and run them in place instead. I would expect the BaseDirectory to be appropriately set according to this "deploy" configuration.

Thanks,
Fernando