locked
Assembly redirection in app.config not respected by vstest.console.exe RRS feed

  • Question

  • Hi guys

    In this day and age having modular setup using NuGet packages in various C# projects are very common.

    We have a particular problem that when running unit tests on our build system through vstest.console.exe, app.config files stored with the unit test projects are not respected.

    This gives a problem if our test project references one version of a nuget package say 3.4.0.0 and another NuGet package with a dependency to an older version of the first package e.g. 3.0.0.0. In this case in an application assembly redirection specified in app.config would make sure to load the same version of the assembly. However this doesn't work for vstest.console.exe

    I found this old thread https://social.msdn.microsoft.com/Forums/vstudio/en-US/234926d1-42c0-4ebb-af39-1626e72f6c39/why-does-assemblybinding-work-only-if-testsettings-file-is-used-vs2012rc?forum=vsunittest

    Where it is stated a bug was created, since it is more than 4 years ago, I would expect that it was solved already.

    Running in forcedlegacymode seems like something that should not happen anymore.

    Please advice.

    Best Regards

    Lars Jakobsen


    Tuesday, August 16, 2016 10:20 AM

All replies

  • Hi Lars Jakobsen,

    Could you please tell us which NuGet packages do you reference in your Unit Test and which version of Visual Studio do you use? Please provide the detailed steps to help us reproduce this issue in our side, which can let us verify whether this issue has been fixed or not.

    Before we verify this issue, I suggest you use the workaround of using testsettings for using app.config or assembly redirection that mentioned in the old thread.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, August 18, 2016 1:40 AM