Skip to content

Commit

Permalink
Attempted fix at .NET5 issue; try as .NET6
Browse files Browse the repository at this point in the history
  • Loading branch information
unquietwiki committed Feb 19, 2023
1 parent eadf205 commit edf7d35
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
17 changes: 10 additions & 7 deletions CKAN.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30225.117
# Visual Studio Version 17
VisualStudioVersion = 17.5.33402.96
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-core", "Core\CKAN-core.csproj", "{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CKAN-core", "Core\CKAN-core.csproj", "{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-autoupdate", "AutoUpdate\CKAN-autoupdate.csproj", "{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CKAN-autoupdate", "AutoUpdate\CKAN-autoupdate.csproj", "{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-cmdline", "Cmdline\CKAN-cmdline.csproj", "{E97D81F6-85E2-4F1F-906D-BE21766602E5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CKAN-cmdline", "Cmdline\CKAN-cmdline.csproj", "{E97D81F6-85E2-4F1F-906D-BE21766602E5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-ConsoleUI", "ConsoleUI\CKAN-ConsoleUI.csproj", "{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CKAN-ConsoleUI", "ConsoleUI\CKAN-ConsoleUI.csproj", "{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-GUI", "GUI\CKAN-GUI.csproj", "{A79F9D54-315C-472B-928F-713A5860B2BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CKAN-netkan", "Netkan\CKAN-netkan.csproj", "{4336F356-33DB-442A-BF74-5E89AF47A5B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{4F41255E-8BC1-465B-82D5-1C5665BC099A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{4F41255E-8BC1-465B-82D5-1C5665BC099A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -75,6 +75,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F1CF2029-80B8-41D0-97E9-0403923F85BE}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.TextStylePolicy = $1
Expand Down
7 changes: 2 additions & 5 deletions Core/CKAN-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Choose>
<When Condition="$(Configuration.EndsWith('NetCore'))">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
Expand All @@ -39,7 +39,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
<PackageReference Include="ChinhDo.Transactions.FileManager" Version="1.2.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
Expand All @@ -51,9 +50,7 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<PackageReference Include="ChinhDo.Transactions.FileManager" Version="1.2.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="System.Security.Permissions" Version="4.7.0" />
<PackageReference Include="TxFileManager.NETStandard" Version="2.0.0" />
</ItemGroup>
Expand Down
17 changes: 9 additions & 8 deletions Core/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ public static ICollection<T> AsCollection<T>(this IEnumerable<T> source)
return source is ICollection<T> collection ? collection : source.ToArray();
}

#if NET45
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
// This wasn't being used in the 4.7.2 build, and conflicts with LINQ otherwise.
/* #if NET45
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
return new HashSet<T>(source);
}
#endif
return new HashSet<T>(source);
}
#endif */

public static IEnumerable<T> Memoize<T>(this IEnumerable<T> source)
{
Expand Down
8 changes: 4 additions & 4 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Choose>
<When Condition="$(Configuration.EndsWith('NetCore'))">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
Expand All @@ -30,7 +30,7 @@
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<DefaultItemExcludes>$(DefaultItemExcludes);NetKAN\**;CmdLine\**;ConsoleUI\**;GUI\**;AutoUpdate\**</DefaultItemExcludes>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug_NetCore' ">
Expand Down Expand Up @@ -60,8 +60,8 @@
<Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\_build\meta\GlobalAssemblyVersionInfo.cs">
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text.RegularExpressions;
using Semver;

var buildNetCore = "net5.0";
var buildNetCore = "net6.0";
var buildNetFramework = "net472";

var target = Argument<string>("target", "Default");
Expand Down

0 comments on commit edf7d35

Please sign in to comment.