[🚀 Feature]: Add .NET 6.0 to dotnet project build targets
See original GitHub issueFeature and motivation
.NET 6.0 SDK was recently publicly released, so we should consider adding .NET 6 to the list of target frameworks for each dotnet project.
Not much has changed from NET 5 to NET 6 in terms of required source changes, however .NET 6 lists Visual Studio 2022 as a requirement so keep that in mind.
Usage example
I was able to successfully update the following projects and build .NET 6 DLLs from Visual Studio 2022:
- WebDriver
- WebDriver.Support
- WebDriverBackedSelenium
Rough steps on updating project to support .NET 6 (Note VS2022 is required for full .NET 6 support):
- Install latest .NET 6.0 SDK and latest Visual Studio 2022
- Edit each project and nuspec file to specify
net6.0
where applicable. - Edit preprocessor directives in relevant sources to include
NET6_0_OR_GREATER
(orNET6_0
) where applicable or you will encounter an error when building sources that use system drawing methods (like screenshotting)
You may be able to get around installing VS2022, if one were to just perform the above changes and then build with the NET 6 SDK installed, however I have not tried this myself so cannot speak to how this workaround might work.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (6 by maintainers)
Top Results From Across the Web
How to target .NET 6.0 with Visual Studio 2019? - Microsoft Q&A
Under Options, Environment, Preview Features set Use previews of the .NET SDK to true, restart Visual Studio. Restart, in a Visual Studio ...
Read more >Target frameworks in SDK-style projects - .NET | Microsoft Learn
When you target a framework in an app or library, you're specifying the set of APIs that you'd like to make available to...
Read more >Port from .NET Framework to .NET 6 - .NET Core
Understand the porting process and discover tools you may find helpful when porting a .NET Framework project to .NET 6.
Read more >dotnet build command - .NET CLI | Microsoft Learn
The dotnet build command builds the project and its dependencies into a set of binaries. The binaries include the project's code in ...
Read more >Targeted .NET Frameworks - Visual Studio (Windows)
Learn how to specify the version of the .NET Framework that you want your project to target so the application can only use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Given that the .NET bindings are not moving away from Bazel as the build tool, Bazel will need to support VS 2022 before this can be done properly. As of January 2022, Bazel did not offer that support; I have not been able to get back to inquire as to whether that support has yet been added. Once it is, it will be reasonably easy to add that as a build target to the existing build.
I think I got everything else covered with this - d2838e1291032fde9e0da47ad6bb809f03c53deb
I built the solution and tested it in Mac, Win10 & Win11 without issues.