Skip to content

Commit 04bd0d8

Browse files
committed
Finalize build to .net 9
1 parent 1d003f6 commit 04bd0d8

File tree

12 files changed

+24
-59
lines changed

12 files changed

+24
-59
lines changed

DAL/PluginManager.DAL.TextFiles/Providers/ApplicationSettingsProvider.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ internal class SettingsProvider : IApplicationSettingsProvider
3737
{
3838
private readonly ISimpleDBOperations<SettingsDataRow> _settingsData;
3939

40-
public sealed class SettingValue
41-
{
42-
public string Value { get; set; }
43-
}
44-
4540
public SettingsProvider(ISimpleDBOperations<SettingsDataRow> settingsData)
4641
{
4742
_settingsData = settingsData ?? throw new ArgumentNullException(nameof(settingsData));

Demo/NetCorePluginDemoWebsite/Controllers/HomeController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
using Microsoft.AspNetCore.Mvc;
30-
using Microsoft.Extensions.Localization;
3130

3231
using Shared.Classes;
3332

Directory.Build.props

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup>
66
<RunAnalyzers>true</RunAnalyzers>
77
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
8-
<NoWarn>1701;1702;8032;8981;S125;S6967;S6964;S6670;S6934;S3267;S3431;IDE0290;S3904</NoWarn>
8+
<NoWarn>1701;1702;8032;8981;S125;S6967;S6964;S6670;S6934;S3267;S3431;IDE0290;IDE0130;IDE1100;S3904;S3358;S3400</NoWarn>
99
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
1010
<SignAssembly>false</SignAssembly>
1111
<AssemblyOriginatorKeyFile>Shared.Key.pfx</AssemblyOriginatorKeyFile>
@@ -25,7 +25,7 @@
2525
<PackageTags>Plugin Manager</PackageTags>
2626
<PackageProjectUrl>http://pluginmanager.website/</PackageProjectUrl>
2727
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
28-
<PackageReleaseNotes>Supports net 6.0 and net8.0</PackageReleaseNotes>
28+
<PackageReleaseNotes>Supports net 6.0, net8.0 and net9.0</PackageReleaseNotes>
2929
<PackageTags>asp net core plugin manager system admin internal statistics</PackageTags>
3030
</PropertyGroup>
3131

@@ -67,7 +67,21 @@
6767
<DebugType>embedded</DebugType>
6868
<DebugSymbols>true</DebugSymbols>
6969
</PropertyGroup>
70-
70+
71+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|net9.0'">
72+
<DefineConstants>CODE_ANALYSIS;DEBUG;TRACE;NET_CORE;ISO_WEEK;ATTR_OS;NET_6_ABOVE;NET_8_ABOVE;NET_9_ABOVE;NET_9_0;NET_9_X</DefineConstants>
73+
<CheckForOverflowUnderflow>$(CheckForOverflowUnderflow)</CheckForOverflowUnderflow>
74+
<DebugType>$(DebugType)</DebugType>
75+
<DebugSymbols>$(DebugSymbols)</DebugSymbols>
76+
</PropertyGroup>
77+
78+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|net9.0'">
79+
<DefineConstants>CODE_ANALYSIS;NET_CORE;ISO_WEEK;ATTR_OS;NET_6_ABOVE;NET_8_ABOVE;NET_9_ABOVE;NET_9_0;NET_9_X</DefineConstants>
80+
<CheckForOverflowUnderflow>$(CheckForOverflowUnderflow)</CheckForOverflowUnderflow>
81+
<DebugType>$(DebugType)</DebugType>
82+
<DebugSymbols>$(DebugSymbols)</DebugSymbols>
83+
</PropertyGroup>
84+
7185
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|net8.0'">
7286
<DefineConstants>CODE_ANALYSIS;DEBUG;TRACE;NET_CORE;ISO_WEEK;ATTR_OS;NET_5_ABOVE;NET_6_ABOVE;NET_7_ABOVE;NET_8_ABOVE;NET_8_0;NET_8_X</DefineConstants>
7387
<CheckForOverflowUnderflow>$(CheckForOverflowUnderflow)</CheckForOverflowUnderflow>

NetCorePluginManager/Classes/SystemAdmin/LoadedModulesMenu.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ public override string Data()
8686
string file = String.Empty;
8787
try
8888
{
89-
#if NET_5_ABOVE
9089
string path = assembly.Location;
91-
#else
92-
string path = String.IsNullOrEmpty(assembly.Location) ? assembly.CodeBase : assembly.Location;
93-
#endif
9490

95-
#if NET_7_ABOVE
91+
#if NET_6_ABOVE
9692
if (String.IsNullOrEmpty(path))
9793
continue;
9894
#endif

PluginManager/src/GlobalSuppressions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
using System.Diagnostics.CodeAnalysis;
77

88
[assembly: SuppressMessage("Minor Bug", "S2674:The length returned from a stream read should be checked", Justification = "Reads entire length in one go", Scope = "member", Target = "~M:PluginManager.BasePluginManager.ExtractResources(System.Reflection.Assembly@,PluginManager.PluginSetting@)")]
9+
[assembly: SuppressMessage("Reliability", "CA2022:Avoid inexact read with 'Stream.Read'", Justification = "Good as is", Scope = "member", Target = "~M:PluginManager.BasePluginManager.ExtractResources(System.Reflection.Assembly@,PluginManager.PluginSetting@)")]

Plugins/ApiAuthorization.Plugin/GlobalSuppressions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
using System.Diagnostics.CodeAnalysis;
77

88
[assembly: SuppressMessage("Minor Bug", "S2674:The length returned from a stream read should be checked", Justification = "Reads entire length of stream", Scope = "member", Target = "~M:ApiAuthorization.Plugin.Classes.HmacApiAuthorizationService.ValidateApiRequest(Microsoft.AspNetCore.Http.HttpRequest,System.String,System.Int32@)~System.Boolean")]
9+
[assembly: SuppressMessage("Reliability", "CA2022:Avoid inexact read with 'Stream.Read'", Justification = "Will only work with amount of data it gets back", Scope = "member", Target = "~M:ApiAuthorization.Plugin.Classes.HmacApiAuthorizationService.ValidateApiRequest(Microsoft.AspNetCore.Http.HttpRequest,System.String,System.Int32@)~System.Boolean")]

Plugins/Documentation.Plugin/Startup.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* 19/05/2019 Simon Carter Initially Created
2424
*
2525
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26+
using Microsoft.AspNetCore.Builder;
2627
using Microsoft.Extensions.Configuration;
2728
using Microsoft.Extensions.DependencyInjection;
2829

@@ -45,30 +46,22 @@ public static void ConfigureServices(IServiceCollection services)
4546
services.AddMemoryCache();
4647

4748
services.AddMvc(
48-
#if NET_CORE_3_X || NET_5_ABOVE
4949
option => option.EnableEndpointRouting = false
50-
#endif
5150
)
5251
.AddSessionStateTempDataProvider();
5352
}
5453

5554
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
5655
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA1801:ReviewUnusedParameters", MessageId = "Reviewed and ok in this context")]
57-
public static void Configure(
58-
#if !NET_CORE_3_X && !NET_5_ABOVE
59-
IApplicationBuilder app, IHostingEnvironment env
60-
#endif
61-
)
56+
public static void Configure(IApplicationBuilder app)
6257
{
6358

64-
#if !NET_CORE_3_X && !NET_5_ABOVE
6559
app.UseMvc(routes =>
6660
{
6761
routes.MapRoute(
6862
name: "default",
6963
template: "{controller=Login}/{action=Index}/{id?}");
7064
});
71-
#endif
7265
}
7366
}
7467
}

Plugins/DynamicContent.Plugin/Startup.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ public static void ConfigureServices(IServiceCollection services)
6161
PluginManagerService.ConfigureServices(services);
6262

6363
services.AddMvc(
64-
#if NET_CORE_3_X || NET_5_ABOVE
6564
option => option.EnableEndpointRouting = false
66-
#endif
6765
)
6866
.AddSessionStateTempDataProvider()
6967
.ConfigurePluginManager();

Plugins/ErrorManager.Plugin/Controllers/ErrorController.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,19 @@ public class ErrorController : BaseController
4949
{
5050
#region Private Members
5151

52-
#if NET_CORE_3_X || NET_5_ABOVE
5352
private readonly IWebHostEnvironment _hostingEnvironment;
54-
#else
55-
private readonly IHostingEnvironment _hostingEnvironment;
56-
#endif
5753

5854
private readonly ISettingsProvider _settingsProvider;
5955

6056
#endregion Private Members
6157

6258
#region Constructors
6359

64-
#if NET_CORE_3_X || NET_5_ABOVE
6560
public ErrorController(IWebHostEnvironment hostingEnvironment, ISettingsProvider settingsProvider)
6661
{
6762
_hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
6863
_settingsProvider = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
6964
}
70-
#else
71-
public ErrorController(IHostingEnvironment hostingEnvironment, ISettingsProvider settingsProvider)
72-
{
73-
_hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
74-
_settingsProvider = settingsProvider ?? throw new ArgumentNullException(nameof(settingsProvider));
75-
}
76-
#endif
77-
7865

7966
#endregion Constructors
8067

Plugins/ErrorManager.Plugin/Startup.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,22 @@ public Startup(IConfiguration configuration)
4545
public static void ConfigureServices(IServiceCollection services)
4646
{
4747
services.AddMvc(
48-
#if NET_CORE_3_X || NET_5_ABOVE
4948
option => option.EnableEndpointRouting = false
50-
#endif
5149
);
5250
}
5351

5452
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
5553
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA1801:ReviewUnusedParameters", MessageId = "Reviewed and ok in this context")]
56-
public static void Configure(IApplicationBuilder app,
57-
#if NET_CORE_3_X || NET_5_ABOVE
58-
IWebHostEnvironment env)
59-
#else
60-
IHostingEnvironment env)
61-
#endif
54+
public static void Configure(IApplicationBuilder app)
6255
{
6356
app.UseErrorManager();
6457

65-
#if !NET_CORE_3_X
6658
app.UseMvc(routes =>
6759
{
6860
routes.MapRoute(
6961
name: "default",
7062
template: "{controller=Home}/{action=Index}/{id?}");
7163
});
72-
#endif
7364
}
7465
}
7566
}

0 commit comments

Comments
 (0)