Bug Report T515045
Visible to All Users

Unit Test Runner cannot run tests in multi-framework test projects

created 8 years ago

Build type: csproj for dotnet core.
Test framework: xUnit (v2.2 or v2.3)

Most of the projects I work with use multi-targeting - so a TargetFrameworks (plural) property rather than TargetFramework.

I have *sometimes* seen such projects manage to run tests - but most of the time they're broken. The tests themselves show up (so whatever analysis is being done to find the tests appears to work). Hitting "run tests" (either in the Test Runner, or Solution Explorer, or in source code) forces a build if necessary, but then no tests are actually run. Importantly (I suspect), the Output window does *not* show "Test started…" which it does when everything is working.

Restarting Visual Studio sometimes appears to "unstick" this, but not always. At one point I believed the problem was the order of the target frameworks (desktop first vs core first) but that appears not to be the case now…

The tests run fine from the command line.

Reducing the TargetFrameworks property to only have a single target (but keeping the property itself plural) makes everything work again.

Comments (1)
DevExpress Support Team 8 years ago

    Hi Jon,
    Thanks for the attached project. I have managed to reproduce the issue.
    Please give us some time to research the issue in detail.

    Answers approved by DevExpress Support

    created 8 years ago (modified 8 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Additional information:

    Hi Jon,
    We have resolved this issue and now tests in your project are running correctly. Please try this build and inform us about your results:
    http://downloads.devexpress.com/Share/IDE/170519/DevExpress.CodeRush.Roslyn-17.1.3.17139.vsix

      Comments (2)

        It's definitely better - on my tiny test project it's working fine.

        In my real projects, one of them hung when running tests, but then worked after I stopped and restarted the tests.

        Will see how it plays out when using it over the next few weeks, and I'll add another comment if any problems persist - thanks so much!

        Jon

        AE AE
        Alex Eg (DevExpress) 8 years ago

          Jon,
          Thank you for the update! We will be happy to help you if you need any assistance.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.