May 2, 2012 at 7:18 PM
Edited May 2, 2012 at 7:38 PM
Thanks for the advice. Unfortunately (or fortunately, depending on your point of view ; ) ), I'm using some generic tests to invoke Statlight. I find it easier to get some build result and consequently I didn't had to modify my build
Unfortunately, variables like $(ConfigurationName) are not available in GenericTests, so no way to specify, as a QueryString argument, which Url to use depending on configuration
I think I found a solution though and here it is, maybe it could help others...
I was able to achieve my goal by implementing a silverlight app.config Configuration reader. I felt inspired by this post (http://andrewtokeley.net/archive/2011/01/23/silverlight-4-ndash-simple-configuration-manager.aspx).
I added multiple app.(ConfigName).config in a specific folder and created a pre-build action that overrides the required app.config file with the appropriate app.(ConfigName).config file.
copy "$(ProjectDir)Config\app.$(ConfigurationName).config" "$(ProjectDir)app.config" /Y
That way, my app.config file content changes automatically following my build configuration.
So now, the silverlight configuration is not handle anymore by the InitParams and I was able to remove the specific logic out of my App.xaml file.
Thanks again for your great contribution to the Silverlight TDD community!