Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net 8.0 Xunit-Testproject Throws InvalidOperationException #447

Closed
2 tasks
Nepitwin opened this issue Feb 2, 2024 · 2 comments
Closed
2 tasks

.Net 8.0 Xunit-Testproject Throws InvalidOperationException #447

Nepitwin opened this issue Feb 2, 2024 · 2 comments

Comments

@Nepitwin
Copy link

Nepitwin commented Feb 2, 2024

I'm submitting a ...

  • [ x ] bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

  • Exception is throwed

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

  • Tests are executed without any InvalidOperationException

What is the motivation / use case for changing the behavior?

  • DotNet 8.0 can be used without any exception

Other information

dotnet test
  Wiederherzustellende Projekte werden ermittelt...
  Alle Projekte sind für die Wiederherstellung auf dem neuesten Stand.
  Allure.Examples.Xunit -> C:\Users\andreas.sekulski\Desktop\allure-xunit-main\tests\Allure.Examples.Xunit\bin\Debug\ne
  t8.0\Allure.Examples.Xunit.dll
Testlauf für "C:\Users\andreas.sekulski\Desktop\allure-xunit-main\tests\Allure.Examples.Xunit\bin\Debug\net8.0\Allure.Examples.Xunit.dll" (.NETCoreApp,Version=v8.0)
Microsoft (R) Testausführungs-Befehlszeilentool Version 17.8.0 (x64)
Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.

Die Testausführung wird gestartet, bitte warten...
Insgesamt 1 Testdateien stimmten mit dem angegebenen Muster überein.
[xUnit.net 00:00:00.20] Unable to patch XunitTestRunner's Void .ctor(Xunit.Abstractions.ITest, Xunit.Sdk.IMessageBus, System.Type, System.Object[], System.Reflection.MethodInfo, System.Object[], System.String, System.Collections.Generic.IReadOnlyList`1[Xunit.Sdk.BeforeAfterTestAttribute], Xunit.Sdk.ExceptionAggregator, System.Threading.CancellationTokenSource): System.TypeInitializationException: The type initializer for 'MonoMod.Utils.DMDEmitDynamicMethodGenerator' threw an exception.
 ---> System.InvalidOperationException: Cannot find returnType fieeld on DynamicMethod
   at MonoMod.Utils.DMDEmitDynamicMethodGenerator..cctor()
   --- End of inner exception stack trace ---
   at MonoMod.Utils.DMDEmitDynamicMethodGenerator.GenerateCore(DynamicMethodDefinition dmd, Object context)
   at MonoMod.Utils.DMDGenerator`1.Generate(DynamicMethodDefinition dmd, Object context)
   at MonoMod.Utils.DynamicMethodDefinition.Generate(Object context)
   at MonoMod.Utils.DynamicMethodDefinition.Generate()
   at HarmonyLib.MethodPatcher.CreateReplacement(Dictionary`2& finalInstructions)
   at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
   at HarmonyLib.PatchProcessor.Patch()
   at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)
   at Allure.XUnit.AllureXunitPatcher.PatchXunitTestRunnerCtors(Harmony patcher)
[xUnit.net 00:00:00.20] No constructors of XunitTestRunner were pathched. Some theories may miss their parameters in the report
[xUnit.net 00:00:00.39]     Add label to existing issue by authorized user [FAIL]
  Fehler Add label to existing issue by authorized user [6 ms]
  Fehlermeldung:
   System.Exception : Element not found for xpath [//div[@class='something']]
  Stapelverfolgung:
     at Allure.Examples.NUnit3.WebUITests.WebUITestFixtureBase.MaybeThrowElementNotFoundException() in C:\Users\andreas.sekulski\Desktop\allure-xunit-main\tests\Allure.Examples.Xunit\WebUITests\WebUITestBase.cs:line 30
   at Allure.Examples.NUnit3.WebUITests.LabelTests.FilterIssuesByLabel(String labelTitle) in C:\Users\andreas.sekulski\Desktop\allure-xunit-main\tests\Allure.Examples.Xunit\WebUITests\LabelTests.cs:line 78
   at Allure.Net.Commons.Steps.AllureAbstractStepAspect.WrapAsync(Func`2 target, Object[] args, MethodBase metadata, String stepName, List`1 stepParameters)
   at Allure.Examples.NUnit3.WebUITests.LabelTests.AddLabelToExistingIssueByAuthorizedUser() in C:\Users\andreas.sekulski\Desktop\allure-xunit-main\tests\Allure.Examples.Xunit\WebUITests\LabelTests.cs:line 31
--- End of stack trace from previous location ---

Fehler!      : Fehler:     1, erfolgreich:     6, übersprungen:     0, gesamt:     7, Dauer: 46 ms - Allure.Examples.Xunit.dll (net8.0)
@TonEnfer
Copy link
Contributor

TonEnfer commented Feb 7, 2024

As a workaround, you can specify links to specific versions of libraries in the project

<PackageReference Include="Lib.Harmony" Version="2.3.0-prerelease.5" />
<PackageReference Include="MonoMod.Utils" Version="25.0.4" />

@delatrie
Copy link
Contributor

delatrie commented Mar 1, 2024

Duplicate of #434
It will be fixed soon (the next week, presumably).

@delatrie delatrie closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants