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 6 Upgrade #1480

Closed
wants to merge 22 commits into from
Closed

Conversation

fortsnek9348
Copy link
Contributor

@fortsnek9348 fortsnek9348 commented Apr 27, 2022

PR for bounty MatterHackers/MatterControl#5252.

Depends on PR for MatterControl.

  • All projects upgraded to .NET 6, except GLFW.NETStandard as I'm not sure if modifications to that one are desired.
  • DataConverters2D's ImageSharp NuGet package upgraded to 2.1.0. This appears to fix an image loading/alignment bug on a startup button. Code in ImageIO.cs updated.
  • Namespace "RayTracer" renamed to "RayTracerNS" to avoid conflicts. Stops errors in test compilation (just test compilation?).
  • GLFW and OpenTK window providers (WinformsEventSink) will not inject real user input during testing (EnablePlatformWindowInput).
  • StaticData no longer has debug-specific functionality. MatterControl will use the project root's StaticData directory if ran from the build output directory.
    • This would be better as a command-line option or environment variable.
  • Testing:
    • The open/save dialog for testing no longer uses spaces to separate paths. This could be improved further by adding a method to the class that knows how to properly escape a file list for itself.
    • Various default waits refactored to DefaultWidgetWaitSeconds.
    • WaitforDraw can now handle a closed window.
    • WaitForWidgetEnabled waits for a draw, in case it was called after a "Reload All".
    • ShowWindowAndExecuteTests will now disallow real user input.
    • ShowWindowAndExecuteTests fixed to use a single source of truth to determine when and if a test timed out.
    • ResolveProjectPath rewritten to use source-relative paths with CallerFilePath.
    • Tests are now annotated to use the new TestInvoker from the MatterControl PR.
      • Process isolation for testing is required as .NET Core has no support for multiple AppDomains, and there are a lot statics.
      • Because tests are now process-isolated, most are now annotated to run in parallel.
      • Importantly, this made failures happen more often due to timing and other bugs. Comments scattered throughout. But tests for Agg-Sharp are relatively reliable compared to MatterControl.
  • PlatformWin32 can now use OpenTK 4 (pre-release on NuGet).
    • Selection between OpenTK 3 and 4 is implemented as a conditional reference.
    • Switch between them by changing "<UsingOpenTK4>false</UsingOpenTK4>" in the project file.
    • Defaulting to .NET Framework OpenTK 3 because OpenTK 4 has minor issues:
      • It has less configurability. No colour, depth, stencil bits.
      • No vsync setting. And it seems to be on for me.
      • Keyboard input bug: Keyboard Event Disabled opentk/GLControl#18. Worked around in OnShown.
      • OpenTK 4 uses GLFW which must create a new window, OpenTK 4 GLControl will always have its native window kludge unless GLFW can ever attach to a HWND.
      • But, OpenTK 4 GLControl does work. No other problems seen.
    • The one downside of OpenTK 3 is that it may crash at runtime if it ever uses .NET Framework-specific APIs. And you get build warnings.
  • PlatformWin32 will now throw an exception if OpenTK 3 fails to create a context. This won't happen often.
    • OpenTK 4 already throws an exception. This is much more likely as it needs a proper GPU driver.

Draft until all PRs are good to go.

@fortsnek9348 fortsnek9348 marked this pull request as draft April 27, 2022 17:07
@fortsnek9348
Copy link
Contributor Author

AppVeyor problems:

The current .NET SDK does not support targeting .NET 6.0

@fortsnek9348
Copy link
Contributor Author

Rebased.

@fortsnek9348
Copy link
Contributor Author

fortsnek9348 commented Apr 29, 2022

Is AppVeyor trying to target net472?

*Probably just the examples still.

@fortsnek9348 fortsnek9348 marked this pull request as ready for review April 29, 2022 16:39
@larsbrubaker
Copy link
Member

It looks like this is now having a build problem with the outstanding project files that are part of the agg-sharp.sln solution.

@fortsnek9348
Copy link
Contributor Author

I've got these sample projects to build and run, but there are some odd bugs that seem to exist in the original code. DemoRunner has some unusable widgets and RockBlaster has a mouse offset.

@fortsnek9348
Copy link
Contributor Author

Gaming project uses OpenTK 1. Which has ALUT, which OpenTK 4 doesn't have.

@larsbrubaker
Copy link
Member

We can disable, unload, both of these projects for this as long as the demos themselves are running.

Thank you.

@fortsnek9348
Copy link
Contributor Author

I'll leave the audio code disabled in Gaming. And the only user of AForgeCamera, GuiTester, doesn't appear to be functional. null ref in UI code. So that will be left untested.

@fortsnek9348
Copy link
Contributor Author

And before this gets merged: Let's wait for MatterControl first.

@larsbrubaker
Copy link
Member

Sounds good

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

Successfully merging this pull request may close these issues.

None yet

2 participants