Bug Report T398272
Visible to All Users

NUnit 3.4 integration doesn't work

created 9 years ago

CR/R can't run NUnit 3.4 unit tests.
Repro: create a .net 4.6.1.class library, nuget NUnit 3.4, create a dummy test and try to run it. TestRunner starts test but does nothing for a long time.

Works fine with 3.2.

Here is the sample test:

C#
[TestFixture] public class Class1 { [Test] public void Test() { Assert.That(true, Is.True); } }

Here is the log:
Information: Runner arguments: /baseuri=net.pipe://localhost/trwcfservice2c34bfffbc7c4d6299f5dbae6a9afb81 /uniquename=TestRunnerWCFService /runnerAssembly="C:\USERS\MIHA\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\14.0\EXTENSIONS\QLCI215T.5PM\NUnit30\DevExpress.CodeRush.TestRunner.NUnit30.dll" /projectassembly="G:\Temp\TempProjects\ClassLibrary16\bin\Debug\ClassLibrary16.dll" /runnerid="NUnit|Main|3.4.0.0|20024|False|ClassLibrary16" /frameworkpaths="G:\Temp\TempProjects\ClassLibrary16\packages\NUnit.3.4.0\lib\net45"

Error: Message: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Error: Type: System.Reflection.ReflectionTypeLoadException
Error: Source: mscorlib
Error: StackTrace:    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
   at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.Hosting.CompositionService.SatisfyImportsOnce(ComposablePart part)
   at DevExpress.CodeRush.TestRunner.Core.TestRunnerCompositionService.SatisfyImportsOnce(ComposablePart part)
   at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)
   at DevExpress.CodeRush.TestRunner.Executor45.DefaultTestFrameworkExecutorProvider.GetTestFrameworkExecutor(String runnerAssembly)
   at DevExpress.CodeRush.TestRunner.Executor45.TestRunnerExecutor.StartClient(TestRunnerCommandLineArguments args)
Information: Couldn't find executor in assembly 'C:\USERS\MIHA\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\14.0\EXTENSIONS\QLCI215T.5PM\NUnit30\DevExpress.CodeRush.TestRunner.NUnit30.dll'

Comments (1)
AE AE
Alex Eg (DevExpress) 9 years ago

    Hi Miha,
    I have reproduced this issue and we are working on it. Thank you for your patience.

    Answers approved by DevExpress Support

    created 9 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.

      Show previous comments (1)
      DevExpress Support Team 9 years ago

        Hi Ben,

        We have already fixed this issue on our side and published the next release containing this fix. Would you please download it from the Visual Studio Gallery and let us know how it works on your side?

          I installed the VSIX as requested. I'm still getting an error though:

          System.MissingMethodException
          Method not found: 'NUnit.Framework.Interfaces.ITest NUnit.Framework.Api.NUnitTestAssemblyRunner.Load(System.Reflection.Assembly, System.Collections.IDictionary)'.

          I'm not sure if there's some possibility of conflict between the full version of CodeRush I already had installed (16.1.4) with the VSIX update? The test icons in my code window changed, which I'm guessing came with the update, but if I go to DevExpress > CodeRush > About, it's still reporting 16.1.4.0.

          DevExpress Support Team 9 years ago

            Hi Ben,

            This ticket is related to CodeRush for Roslyn. CodeRush Classic and CodeRush for Roslyn are different products. The installed VSIX  has updated only CodeRush for Roslyn on your side but the 'DevExpress | CodeRush | About' menu shows the CodeRush Classic version (to see information about CodeRush for Roslyn, use the 'CodeRush | About' menu).

            At the moment, NUnit 3.4 support is implemented only for CodeRush for Roslyn. We are working on implementing this functionality for CodeRush Classic in the context of the following ticket: Code Rush Test Runner and NUnit 3.4 Not Working

            I suggest you temporarily disable CodeRush Classic Unit Test Runner and use CodeRush for Roslyn for running tests. For this, perform the following steps:

            1. From the DevExpress menu, select "CodeRush\Options…".
            2. In the tree view on the left, navigate to the "Unit Testing" folder.
            3. Select the "Test Runner" options page.
            4. Uncheck the "Enable Unit Test Service" item.

            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.