Skip to content

[NUnitLite] remove Assembly.CodeBase usage #9859

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

jonathanpeppers
Copy link
Member

Running Mono.Android-Tests on NativeAOT crashes with:

02-27 14:32:47.590  9008  9024 E NUnit   : Error: System.NotSupportedException: NotSupported_CodeBase (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at System.Reflection.Runtime.Assemblies.RuntimeAssemblyInfo.get_CodeBase() + 0x34 (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.AssemblyHelper.GetAssemblyPath(Assembly) + 0x10 (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.NUnitLiteTestAssemblyBuilder.Build(Assembly, IDictionary) + 0x8c (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.NUnitLiteTestAssemblyRunner.Load(Assembly, IDictionary) + 0x28 (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.NUnit.NUnitTestRunner.Run(IList`1) + 0x1ac (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.TestInstrumentation`1.RunTests(Bundle&) + 0xc8 (TaskId:30)
02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.TestInstrumentation`1.OnStart() + 0x48 (TaskId:30)

It appears we can just remove all usage of Assembly.CodeBase from this file to get past this error.

Running `Mono.Android-Tests` on NativeAOT crashes with:

    02-27 14:32:47.590  9008  9024 E NUnit   : Error: System.NotSupportedException: NotSupported_CodeBase (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at System.Reflection.Runtime.Assemblies.RuntimeAssemblyInfo.get_CodeBase() + 0x34 (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.AssemblyHelper.GetAssemblyPath(Assembly) + 0x10 (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.NUnitLiteTestAssemblyBuilder.Build(Assembly, IDictionary) + 0x8c (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at NUnit.Framework.Internal.NUnitLiteTestAssemblyRunner.Load(Assembly, IDictionary) + 0x28 (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.NUnit.NUnitTestRunner.Run(IList`1) + 0x1ac (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.TestInstrumentation`1.RunTests(Bundle&) + 0xc8 (TaskId:30)
    02-27 14:32:47.590  9008  9024 E NUnit   :    at Xamarin.Android.UnitTests.TestInstrumentation`1.OnStart() + 0x48 (TaskId:30)

It appears we can just remove all usage of `Assembly.CodeBase` from
this file to get past this error.
@jonpryor jonpryor merged commit c429ec0 into main Feb 28, 2025
58 checks passed
@jonpryor jonpryor deleted the dev/peppers/NUnitLiteNativeAOT branch February 28, 2025 02:02
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants