.Netstandard2.0 Migration#30
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the Machina library from .NET Framework 4.6.1 to .NET Standard 2.0, while updating all test projects to .NET Framework 4.8.1. The migration enables broader compatibility with both .NET Framework and .NET Core/.NET applications, while maintaining support for ABB RobotStudio DLLs that require .NET Framework runtimes.
Changes:
- Migrated main Machina project to SDK-style project targeting .NET Standard 2.0
- Updated all test projects from .NET Framework 4.6.1 to 4.8.1
- Introduced Newtonsoft.Json dependency and added ToNullableDoubles utility function for JSON conversion
- Reorganized assembly references and removed auto-generated Properties files
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Machina/Machina.csproj | Converted to SDK-style project targeting .NET Standard 2.0 with PackageReferences for dependencies |
| src/Machina/Utilities/Conversion.cs | Added ToNullableDoubles function for JSON token conversion using Newtonsoft.Json |
| src/Machina/Properties/AssemblyInfo.cs | Removed attributes now specified in .csproj file, keeping only COM-related attributes |
| src/Machina/Properties/Resources.Designer.cs | Removed auto-generated file (will be regenerated by SDK-style project if needed) |
| src/Tests/TEST_Workbench/TEST_Workbench.csproj | Updated target framework to .NET Framework 4.8.1 |
| src/Tests/TEST_Workbench/App.config | Updated supported runtime to .NET Framework 4.8.1 |
| src/Tests/TEST_StreamAPITests/TEST_StreamAPITests.csproj | Updated target framework to .NET Framework 4.8.1 |
| src/Tests/TEST_StreamAPITests/App.config | Updated supported runtime to .NET Framework 4.8.1 |
| src/Tests/TEST_NewAPITests/TEST_OfflineAPITests.csproj | Updated target framework to .NET Framework 4.8.1 |
| src/Tests/TEST_NewAPITests/App.config | Updated supported runtime to .NET Framework 4.8.1 |
| src/Tests/RobotTests/RobotTests.csproj | Updated target framework to .NET Framework 4.8.1 |
| src/Tests/DataTypesTests/DataTypesTests.csproj | Updated target framework to .NET Framework 4.8.1 |
Files not reviewed (1)
- src/Machina/Properties/Resources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /// <summary> | ||
| /// Takes a Newtonsoft.Json JToken and converts it into an array of nullable doubles. | ||
| /// This is replacement for the NullableDoublesFromObjects function in .NetStandard and above. |
There was a problem hiding this comment.
The comment states "This is replacement for the NullableDoublesFromObjects function in .NetStandard and above" but this is confusing. The new ToNullableDoubles function actually works alongside NullableDoublesFromObjects (it calls it internally). The comment should clarify that this provides a convenient wrapper for JSON parsing scenarios in .NET Standard 2.0, rather than saying it's a replacement.
| /// This is replacement for the NullableDoublesFromObjects function in .NetStandard and above. | |
| /// Provides a convenient wrapper around NullableDoublesFromObjects for JSON parsing scenarios | |
| /// (for example when working with JSON in .NET Standard 2.0), rather than replacing it. |
Summary
The updates include
Machinamigrating from .NET Framework 4.6.1 to the SDK-style project targeting .NET Standard 2.0, and updates all sample and test projects to use .NET Framework 4.8.1. It also introduces a new utility function for JSON conversion that uses Newtonsoft.Json instead of the depricated json serializer.First migraiton step
The first migration was from .NF46 to NF481 to make it compatible with Microsoft's migration automation tools.
Dependency and reference management:
PackageReferencefor dependencies likeMicrosoft.CSharp,Newtonsoft.Json, andSystem.Data.DataSetExtensionsinMachina.csproj.Limitations
Direct Migration to .Net8.0 is impossible due to these ABB dll files that require .NetFramework runtimes.
Tests
The code is tested in Rhino 8 with .Net8.0 Runtime and the new Machina-Bridge.
Tests were successful and without noticable difference from the .NetFramework4.6.0 version.
Tests were conducted on a UR10e robot and ABB robot studio simulation environments.