Skip to content

Add support for NativeAOT #1837

Open
@nohwnd

Description

@nohwnd

Originally posted by @dotMorten in: https://github.com/nohwnd/mstest-runner-examples/issues/1

Summary

One of my biggest griefs with MSTest is I can't test if my stuff works right in an AoT build.
Try building your project with dotnet publish -c Release -p PublishAot=true -r win-x64 and run it, and you'll get loads of build warnings, and a runtime crash.

Now I understand why it currently doesn't work (too much reflection and datacontract serializers), but solving this would be huge for ensuring AoT compatibility.

It would likely require a little code generator for each TestMethod attribute instead of relying on reflection discovery, and using the new System.Text.Json serializers.

AB#1950768

### Tasks
- [ ] https://github.com/microsoft/testfx/issues/2293
- [ ] https://github.com/microsoft/testfx/issues/2754
- [ ] https://github.com/microsoft/testfx/issues/2755
- [ ] https://github.com/microsoft/testfx/issues/2756

Blog post: https://devblogs.microsoft.com/dotnet/testing-your-native-aot-dotnet-apps/

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions