Upgrade to .NET 6.0 with updated project file

This commit is contained in:
cygon 2024-07-25 13:07:52 +02:00
parent 6d6c382870
commit 063099b0c9
7 changed files with 84 additions and 200 deletions

21
Directory.Build.props Normal file
View File

@ -0,0 +1,21 @@
<Project>
<!--
This file is required to work around one of the many issues with NuGet.
https://github.com/NuGet/Home/issues/4463
If you place two project files side by side, NuGet dumps its 'project.assets.json' file
into the root 'obj' directory (instead of the intermediate directory below it),
causing one project to overwrite the other project's dependencies.
There won't be any buld warning, just suddenly one of the projects won't be able to
access its dependencies and fail to build.
Why such a lackluster system was integrated at that level rather than just left to
(mis)manage the references by updating the project file as needed, I don't know.
files and
-->
<PropertyGroup>
<MSBuildProjectExtensionsPath>obj\$(MSBuildProjectName)</MSBuildProjectExtensionsPath>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net6.0-windows</TargetFrameworks>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<AssemblyName>Nuclex.Windows.Forms</AssemblyName>
<RootNamespace>Nuclex.Windows.Forms</RootNamespace>
<IntermediateOutputPath>obj\source</IntermediateOutputPath>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Tests\**" />
<EmbeddedResource Remove="Tests\**" />
<None Remove="Tests\**" />
</ItemGroup>
<ItemGroup>
<None Remove=".git" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nuclex.Support\Nuclex.Support (netstandard-2.0).csproj" />
</ItemGroup>
</Project>

View File

@ -1,158 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B2BFA3EC-3B7B-4EE0-8395-8426B5C7A8B8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Nuclex.Windows.Forms</RootNamespace>
<AssemblyName>Nuclex.Windows.Forms</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\net-4.0\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNITTEST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\net-4.0\Debug\Nuclex.Windows.Forms.xml</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\net-4.6\Release\</OutputPath>
<DefineConstants>TRACE;UNITTEST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\net-4.6\Release\Nuclex.Windows.Forms.xml</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<NuGetPackageRoot>$(SolutionDir)third-party\</NuGetPackageRoot>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\Foundation.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=2.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\third-party\NUnit.2.7.1\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Source\AutoBinding\ConventionBinder.cs" />
<Compile Include="Source\AutoBinding\IAutoBinder.cs" />
<Compile Include="Source\CommonDialogs\CommonDialogManager.cs" />
<Compile Include="Source\CommonDialogs\ICommonDialogService.cs" />
<Compile Include="Source\Controls\ProgressSpinner.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Source\Controls\ProgressSpinner.Designer.cs">
<DependentUpon>ProgressSpinner.cs</DependentUpon>
</Compile>
<Compile Include="Source\LateCheckedSynchronizer.cs" />
<Compile Include="Source\Messages\IMessageService.cs" />
<Compile Include="Source\Messages\MessageEventArgs.cs" />
<Compile Include="Source\Messages\MessageServiceHelper.cs" />
<Compile Include="Source\Messages\MessageText.cs" />
<Compile Include="Source\Messages\StandardMessageBoxManager.cs" />
<Compile Include="Source\NullActiveWindowTracker.cs" />
<Compile Include="Source\ViewModels\DialogViewModel.cs" />
<Compile Include="Source\ViewModels\IMultiPageViewModel.cs" />
<Compile Include="Source\ViewModels\MultiPageViewModel.cs" />
<Compile Include="Source\ViewModels\ThreadedAction.cs" />
<Compile Include="Source\ViewModels\ThreadedDialogViewModel.cs" />
<Compile Include="Source\ViewModels\ThreadedViewModel.cs" />
<Compile Include="Source\IActiveWindowTracker.cs" />
<Compile Include="Source\Views\IView.cs" />
<Compile Include="Source\IWindowManager.cs" />
<Compile Include="Source\Views\MultiPageViewForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\Views\ViewControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Source\Views\ViewForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\WindowManager.cs" />
<EmbeddedResource Include="Source\Controls\ProgressSpinner.resx">
<DependentUpon>ProgressSpinner.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Source\ProgressReporter\ProgressReporterForm.resx">
<DependentUpon>ProgressReporterForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Source\AsyncProgressBar\AsyncProgressBar.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Source\AsyncProgressBar\AsyncProgressBar.Designer.cs">
<DependentUpon>AsyncProgressBar.cs</DependentUpon>
</Compile>
<Compile Include="Source\ContainerListView\ContainerListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Source\ContainerListView\ContainerListView.Designer.cs">
<DependentUpon>ContainerListView.cs</DependentUpon>
</Compile>
<Compile Include="Source\ContainerListView\ListViewEmbeddedControl.cs" />
<Compile Include="Source\ProgressReporter\ProgressReporterForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Source\ProgressReporter\ProgressReporterForm.Designer.cs">
<DependentUpon>ProgressReporterForm.cs</DependentUpon>
</Compile>
<Compile Include="Source\TrackingBar\ToolStripTrackingBar.cs" />
<Compile Include="Source\TrackingBar\TrackingBar.cs" />
<Compile Include="Source\TrackingBar\TrackingBar.Designer.cs">
<DependentUpon>TrackingBar.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="..\Foundation.snk">
<Link>Foundation.snk</Link>
</None>
<None Include="Dependencies.md" />
<None Include="License.md" />
<None Include="Notice.md" />
<None Include="packages.config" />
<None Include="ReadMe.md" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nuclex.Support\Nuclex.Support %28net-4.6%29.csproj">
<Project>{00567408-4f44-4c00-866e-b04a99e482f2}</Project>
<Name>Nuclex.Support %28net-4.6%29</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net6.0-windows</TargetFrameworks>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<AssemblyName>Nuclex.Windows.Forms.Tests</AssemblyName>
<RootNamespace>Nuclex.Windows.Forms.Tests</RootNamespace>
<IntermediateOutputPath>obj\tests</IntermediateOutputPath>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Source\**" />
<EmbeddedResource Remove="Source\**" />
<None Remove="Source\**" />
</ItemGroup>
<ItemGroup>
<None Remove=".git" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.14.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Nuclex.Windows.Forms (net-4.6)(net-6.0).csproj" />
</ItemGroup>
</Project>

View File

@ -18,7 +18,6 @@ limitations under the License.
#endregion // Apache License 2.0 #endregion // Apache License 2.0
using System; using System;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Linq; using System.Linq;
@ -27,6 +26,9 @@ using System.Windows.Forms;
namespace Nuclex.Windows.Forms.Controls { namespace Nuclex.Windows.Forms.Controls {
/// <summary>Displays a progress spinner to entertain the user while waiting</summary> /// <summary>Displays a progress spinner to entertain the user while waiting</summary>
#if NET6_0_OR_GREATER
[SupportedOSPlatform("windows")]
#endif
public partial class ProgressSpinner : UserControl { public partial class ProgressSpinner : UserControl {
/// <summary>Number of dots the progress spinner will display</summary> /// <summary>Number of dots the progress spinner will display</summary>

View File

@ -1,37 +0,0 @@
#region Apache License 2.0
/*
Nuclex .NET Framework
Copyright (C) 2002-2024 Markus Ewald / Nuclex Development Labs
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#endregion // Apache License 2.0
using System;
using System.Windows.Forms;
namespace Nuclex.Windows.Forms {
/// <summary>Enables consumer to look up the currently active window</summary>
public interface IActiveWindowTracker {
/// <summary>The currently active top-level or modal window</summary>
/// <remarks>
/// If windows live in multiple threads, the property change notification for
/// this property, if supported, might be fired from a different thread.
/// </remarks>
Form ActiveWindow { get; }
}
} // namespace Nuclex.Windows.Forms

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.7.1" targetFramework="net462" />
</packages>