Skip to content

Commit

Permalink
Target newest Elmah.Io.Client prerelease and .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasArdal committed Nov 15, 2023
1 parent 446eac3 commit e8503a6
Show file tree
Hide file tree
Showing 29 changed files with 265 additions and 228 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
Expand Down
16 changes: 8 additions & 8 deletions Elmah.Io.AspNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elmah.Io.AspNetCore.Tests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elmah.Io.AspNetCore.HealthChecks.Example", "samples\Elmah.Io.AspNetCore.HealthChecks.Example\Elmah.Io.AspNetCore.HealthChecks.Example.csproj", "{A4DDFAB9-076D-4CA4-9A6E-EF5550605BD3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elmah.Io.AspNetCore31.Example", "samples\Elmah.Io.AspNetCore31.Example\Elmah.Io.AspNetCore31.Example.csproj", "{6AF05883-55D8-4952-94E8-A5BF00F393A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elmah.Io.AspNetCore60.Example", "samples\Elmah.Io.AspNetCore60.Example\Elmah.Io.AspNetCore60.Example.csproj", "{44812DB3-4FAD-4BF4-83D6-0807886A042B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elmah.Io.AspNetCore70.Example", "samples\Elmah.Io.AspNetCore70.Example\Elmah.Io.AspNetCore70.Example.csproj", "{C7C799CD-1C2A-4170-91B2-268060D99427}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Elmah.Io.AspNetCore70.Example", "samples\Elmah.Io.AspNetCore70.Example\Elmah.Io.AspNetCore70.Example.csproj", "{C7C799CD-1C2A-4170-91B2-268060D99427}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elmah.Io.AspNetCore80.Example", "samples\Elmah.Io.AspNetCore80.Example\Elmah.Io.AspNetCore80.Example.csproj", "{96D3E57A-3734-4049-BAEA-E97A405AE4EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -60,10 +60,6 @@ Global
{A4DDFAB9-076D-4CA4-9A6E-EF5550605BD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4DDFAB9-076D-4CA4-9A6E-EF5550605BD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4DDFAB9-076D-4CA4-9A6E-EF5550605BD3}.Release|Any CPU.Build.0 = Release|Any CPU
{6AF05883-55D8-4952-94E8-A5BF00F393A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AF05883-55D8-4952-94E8-A5BF00F393A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AF05883-55D8-4952-94E8-A5BF00F393A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AF05883-55D8-4952-94E8-A5BF00F393A8}.Release|Any CPU.Build.0 = Release|Any CPU
{44812DB3-4FAD-4BF4-83D6-0807886A042B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44812DB3-4FAD-4BF4-83D6-0807886A042B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44812DB3-4FAD-4BF4-83D6-0807886A042B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -72,6 +68,10 @@ Global
{C7C799CD-1C2A-4170-91B2-268060D99427}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7C799CD-1C2A-4170-91B2-268060D99427}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7C799CD-1C2A-4170-91B2-268060D99427}.Release|Any CPU.Build.0 = Release|Any CPU
{96D3E57A-3734-4049-BAEA-E97A405AE4EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96D3E57A-3734-4049-BAEA-E97A405AE4EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96D3E57A-3734-4049-BAEA-E97A405AE4EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96D3E57A-3734-4049-BAEA-E97A405AE4EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -82,9 +82,9 @@ Global
{143AD06F-4F57-4E6B-9C09-A38005E5C025} = {B9EC1066-4F47-4310-9553-1298325321D8}
{7F9CB9B1-BDB3-430B-84AF-0BCD8CE1C4F3} = {E0D4A60F-5411-4587-A085-D41117F83905}
{A4DDFAB9-076D-4CA4-9A6E-EF5550605BD3} = {AEAB4533-28CE-4CA9-9CD7-FC7FEF911204}
{6AF05883-55D8-4952-94E8-A5BF00F393A8} = {AEAB4533-28CE-4CA9-9CD7-FC7FEF911204}
{44812DB3-4FAD-4BF4-83D6-0807886A042B} = {AEAB4533-28CE-4CA9-9CD7-FC7FEF911204}
{C7C799CD-1C2A-4170-91B2-268060D99427} = {AEAB4533-28CE-4CA9-9CD7-FC7FEF911204}
{96D3E57A-3734-4049-BAEA-E97A405AE4EE} = {AEAB4533-28CE-4CA9-9CD7-FC7FEF911204}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DAE57CF5-2DDC-4EF5-85A3-BDA571A8E9A9}
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions samples/Elmah.Io.AspNetCore31.Example/Models/ErrorViewModel.cs

This file was deleted.

26 changes: 0 additions & 26 deletions samples/Elmah.Io.AspNetCore31.Example/Program.cs

This file was deleted.

91 changes: 0 additions & 91 deletions samples/Elmah.Io.AspNetCore31.Example/Startup.cs

This file was deleted.

8 changes: 0 additions & 8 deletions samples/Elmah.Io.AspNetCore31.Example/Views/Home/Index.cshtml

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion samples/Elmah.Io.AspNetCore70.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
//{
// o.OnMessage = msg =>
// {
// msg.Version = "6.0.0";
// msg.Version = "7.0.0";
// };
//});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@model ErrorViewModel
@page
@model ErrorModel
@{
ViewData["Title"] = "Error";
}
Expand All @@ -15,7 +16,7 @@

<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
Expand Down
28 changes: 28 additions & 0 deletions samples/Elmah.Io.AspNetCore80.Example/Pages/Error.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Diagnostics;

namespace Elmah.Io.AspNetCore80.Example.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);

private readonly ILogger<ErrorModel> _logger;

public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}

public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}

}
10 changes: 10 additions & 0 deletions samples/Elmah.Io.AspNetCore80.Example/Pages/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}

<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
26 changes: 26 additions & 0 deletions samples/Elmah.Io.AspNetCore80.Example/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Elmah.Io.AspNetCore;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Elmah.Io.AspNetCore80.Example.Pages
{
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;

public IndexModel(ILogger<IndexModel> logger)
{
_logger = logger;
}

public void OnGet()
{
// Logging can be used for breadcrumbs
_logger.LogInformation("Requesting the frontpage");

// Breadcrumbs can also be added manually
//ElmahIoApi.AddBreadcrumb(new Client.Breadcrumb(action: "Navigation", message: "Requesting the frontpage"), HttpContext);

throw new Exception("Do you know what happened to the neanderthals, Bernard? We ate them.");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@{
@page
@model PrivacyModel
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
Expand Down
Loading

0 comments on commit e8503a6

Please sign in to comment.