Skip to content

Commit

Permalink
Add changes to make it work on .NET 8 RC 2
Browse files Browse the repository at this point in the history
  • Loading branch information
krompaco committed Oct 19, 2023
1 parent fea4e92 commit c45b1b6
Show file tree
Hide file tree
Showing 31 changed files with 52 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23364.2">
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0-2.final" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23472.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-preview.7.23375.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="8.0.0-preview.7.23375.6" />
<PackageReference Include="System.Text.Json" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Tomlyn" Version="0.16.2" />
<PackageReference Include="YamlDotNet" Version="13.3.1" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23364.2">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23472.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-preview.7.23375.9" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
10 changes: 1 addition & 9 deletions src/Krompaco.RecordCollector.Generator/Workers.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
using Krompaco.RecordCollector.Content.IO;
using Krompaco.RecordCollector.Content.Languages;
using Krompaco.RecordCollector.Content.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Xunit;
using Xunit.Abstractions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
@using Krompaco.RecordCollector.Content.Models;
@using Krompaco.RecordCollector.Web.Extensions
@using Krompaco.RecordCollector.Web.Models
@using Krompaco.RecordCollector.Web.Shared
@using Krompaco.RecordCollector.Web.Components
@using Krompaco.RecordCollector.Web.Components.Content
@using Krompaco.RecordCollector.Web.Components.Layout
@using Krompaco.RecordCollector.Web.Components.Navigation
@using Markdig;
@using Microsoft.Extensions.Caching.Distributed
@using Microsoft.AspNetCore.Authorization
Expand Down
13 changes: 11 additions & 2 deletions src/Krompaco.RecordCollector.Web/Controllers/ContentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
using Krompaco.RecordCollector.Content.IO;
using Krompaco.RecordCollector.Content.Languages;
using Krompaco.RecordCollector.Content.Models;
using Krompaco.RecordCollector.Web.Components.Pages;
using Krompaco.RecordCollector.Web.Extensions;
using Krompaco.RecordCollector.Web.ModelBuilders;
using Krompaco.RecordCollector.Web.Models;
using Krompaco.RecordCollector.Web.Pages;
using Krompaco.RecordCollector.Web.Resources;
using Microsoft.AspNetCore.Components.Endpoints;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.StaticFiles;
Expand Down Expand Up @@ -140,6 +141,14 @@ public IResult Properties()
[HttpGet]
public IResult Files(string? path)
{
// Hack to avoid error in large pages (?) with .NET 8 RC 1
var syncIOFeature = this.HttpContext.Features.Get<IHttpBodyControlFeature>();

if (syncIOFeature != null)
{
syncIOFeature.AllowSynchronousIO = true;
}

var siteUrl = this.config.GetAppSettingsSiteUrl();
var rqf = this.Request.HttpContext.Features.Get<IRequestCultureFeature>();
this.currentCulture = rqf?.RequestCulture.Culture ?? CultureInfo.CurrentCulture;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Markdig;
using Markdig.Extensions.Tables;
using Markdig.Parsers;
using Markdig.Renderers;

namespace Krompaco.RecordCollector.Web.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Markdig.Extensions.Tables;
using Markdig.Extensions.Tables;
using Markdig.Renderers;

namespace Krompaco.RecordCollector.Web.Extensions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Globalization;
using System.Linq;
using System.Globalization;

namespace Krompaco.RecordCollector.Web.Extensions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.52" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.54" />
<PackageReference Include="Markdig.Signed" Version="0.33.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23364.2">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23472.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0-preview.7.23375.6" />
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0-rc.2.23479.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Globalization;
using System.Text.RegularExpressions;
using Krompaco.RecordCollector.Web.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

namespace Krompaco.RecordCollector.Web.Models;
namespace Krompaco.RecordCollector.Web.Models;

public class CategoryItemViewModel
{
Expand Down
3 changes: 1 addition & 2 deletions src/Krompaco.RecordCollector.Web/Models/LayoutViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Globalization;
using Krompaco.RecordCollector.Content.Models;
using Markdig;
Expand Down
3 changes: 1 addition & 2 deletions src/Krompaco.RecordCollector.Web/Models/ListPageViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Krompaco.RecordCollector.Content.Models;
using Krompaco.RecordCollector.Content.Models;

namespace Krompaco.RecordCollector.Web.Models;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Krompaco.RecordCollector.Web.Models;
namespace Krompaco.RecordCollector.Web.Models;

public class PaginationItemViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Krompaco.RecordCollector.Web.Models;
namespace Krompaco.RecordCollector.Web.Models;

public class PaginationViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Krompaco.RecordCollector.Content.Models;
using Krompaco.RecordCollector.Content.Models;

namespace Krompaco.RecordCollector.Web.Models;

Expand Down
2 changes: 1 addition & 1 deletion src/Krompaco.RecordCollector.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
pattern: "rc-content-properties",
defaults: new { controller = "Content", action = "Properties" });

// This is the catch all action used to serve the correct content or static file
// This is the catch all action used to serve the correct content, image or document
app.MapControllerRoute(
name: "files",
pattern: "{**path}",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using System;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using System.Globalization;
using Krompaco.RecordCollector.Content.IO;
using Krompaco.RecordCollector.Content.Languages;
using Krompaco.RecordCollector.Web.Extensions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging.Abstractions;

namespace Krompaco.RecordCollector.Web;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Krompaco.RecordCollector.Content.Tests.Converters;
namespace Krompaco.RecordCollector.Content.Tests.Converters;

public class StringToStreamConverter
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Krompaco.RecordCollector.Content.Tests/JsonTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.Models;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-preview.7.23375.9" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-preview.7.23375.9" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23364.2">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23472.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0-preview-23503-02" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.Models;
using Krompaco.RecordCollector.Content.Tests.Converters;
using Xunit;
Expand Down
4 changes: 1 addition & 3 deletions tests/Krompaco.RecordCollector.Content.Tests/TomlTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.Models;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.Models;
using Krompaco.RecordCollector.Content.Tests.Converters;
using Xunit;
Expand Down
4 changes: 1 addition & 3 deletions tests/Krompaco.RecordCollector.Content.Tests/YamlTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.IO;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.FrontMatterParsers;
using Krompaco.RecordCollector.Content.Models;
using Xunit;

Expand Down

0 comments on commit c45b1b6

Please sign in to comment.