diff --git a/README.md b/README.md index 0d50fd5..a519694 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ A class library for WPF applications providing several common dialogs. Included are classes for task dialogs, credential dialogs, progress dialogs, and common file dialogs. -[![NuGet Version](http://img.shields.io/nuget/v/Ookii.Dialogs.Wpf.svg?style=flat)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![NuGet Downloads](https://img.shields.io/nuget/dt/Ookii.Dialogs.Wpf.svg)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![.NET Framework](https://img.shields.io/badge/.NET%20Framework-%3E%3D%204.5-informational)](https://dotnet.microsoft.com/download) [![.NET Core](https://img.shields.io/badge/.NET%20Core-%3E%3D%203.1.0-informational)](https://dotnet.microsoft.com/download) - +[![NuGet Version](http://img.shields.io/nuget/v/Ookii.Dialogs.Wpf.svg?style=flat)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![NuGet Downloads](https://img.shields.io/nuget/dt/Ookii.Dialogs.Wpf.svg)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![.NET](https://img.shields.io/badge/.NET%20-%3E%3D%205.0-informational)](https://dotnet.microsoft.com/download) [![.NET Core](https://img.shields.io/badge/.NET%20Core-%3E%3D%203.1-informational)](https://dotnet.microsoft.com/download) [![.NET Framework](https://img.shields.io/badge/.NET%20Framework-%3E%3D%204.5-informational)](https://dotnet.microsoft.com/download) ## Give a Star! :star: @@ -82,9 +81,9 @@ The `Ookii.Dialogs.Wpf.VistaOpenFileDialog`, `Ookii.Dialogs.Wpf.VistaSaveFileDia The classes have been designed to resemble the original WPF classes to make it easy to switch. When the classes are used on Windows XP, they will automatically fall back to the old style dialog; this is also true for the `VistaFolderBrowserDialog`; that class provides a complete implementation of a folder browser dialog for WPF, old as well as new style. -## .NET Core 3.1 pre-requisites +## .NET Core 3.1 & .NET 5 pre-requisites -Ookii Dialogs leverages the components and visual styles of the Windows Common Controls library (`comctl32.dll`), and WPF applications targeting .NET Core 3.1 must add an [application manifest](https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests) (`app.manifest`) to their projects with a reference to `Microsoft.Windows.Common-Controls`. +Ookii Dialogs leverages the components and visual styles of the Windows Common Controls library (`comctl32.dll`), and WPF applications targeting .NET Core 3.1 and/or .NET 5 must add an [application manifest](https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests) (`app.manifest`) to their projects with a reference to `Microsoft.Windows.Common-Controls`. Without the application manifest, you'll get an error with a message similar to the below: diff --git a/global.json b/global.json index e3bbb00..5f35d39 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": false, - "version": "3.1.100", + "version": "5.0.100", "rollForward": "latestFeature" } } diff --git a/sample/Ookii.Dialogs.Wpf.Sample/Ookii.Dialogs.Wpf.Sample.csproj b/sample/Ookii.Dialogs.Wpf.Sample/Ookii.Dialogs.Wpf.Sample.csproj index 66e69f4..92c8cf5 100644 --- a/sample/Ookii.Dialogs.Wpf.Sample/Ookii.Dialogs.Wpf.Sample.csproj +++ b/sample/Ookii.Dialogs.Wpf.Sample/Ookii.Dialogs.Wpf.Sample.csproj @@ -1,8 +1,9 @@  - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0-windows WinExe + windows7 true true Ookii.Dialogs.Wpf.Sample diff --git a/src/Ookii.Dialogs.Wpf/.editorconfig b/src/Ookii.Dialogs.Wpf/.editorconfig new file mode 100644 index 0000000..8be2c70 --- /dev/null +++ b/src/Ookii.Dialogs.Wpf/.editorconfig @@ -0,0 +1,6 @@ +[*.cs] +# SYSLIB0003: Type or member is obsolete +dotnet_diagnostic.SYSLIB0003.severity = none + +# SYSLIB0004: Type or member is obsolete +dotnet_diagnostic.SYSLIB0004.severity = none diff --git a/src/Ookii.Dialogs.Wpf/Ookii.Dialogs.Wpf.csproj b/src/Ookii.Dialogs.Wpf/Ookii.Dialogs.Wpf.csproj index 901cddf..3e802f6 100644 --- a/src/Ookii.Dialogs.Wpf/Ookii.Dialogs.Wpf.csproj +++ b/src/Ookii.Dialogs.Wpf/Ookii.Dialogs.Wpf.csproj @@ -1,13 +1,14 @@  - netcoreapp3.1;net45 + net5.0-windows;netcoreapp3.1;net45 + windows7 true true Ookii.Dialogs.Wpf Ookii.Dialogs.Wpf - 2.0.0.0 + 3.0.0.0 true true false @@ -40,6 +41,10 @@ $(DefineConstants);NETCORE31 + + $(DefineConstants);NET5 + + 3.3 Ookii.Dialogs.Wpf diff --git a/src/Ookii.Dialogs.Wpf/VistaFolderBrowserDialog.cs b/src/Ookii.Dialogs.Wpf/VistaFolderBrowserDialog.cs index 991404c..e5adb76 100644 --- a/src/Ookii.Dialogs.Wpf/VistaFolderBrowserDialog.cs +++ b/src/Ookii.Dialogs.Wpf/VistaFolderBrowserDialog.cs @@ -232,13 +232,13 @@ private bool RunDialogDownlevel(IntPtr owner) } finally { - if( rootItemIdList != null ) + if( rootItemIdList != IntPtr.Zero ) { IMalloc malloc = NativeMethods.SHGetMalloc(); malloc.Free(rootItemIdList); Marshal.ReleaseComObject(malloc); } - if( resultItemIdList != null ) + if( resultItemIdList != IntPtr.Zero ) { Marshal.FreeCoTaskMem(resultItemIdList); }