Skip to content

Commit 6073a8d

Browse files
committed
Updated samples to .net core 2.2
1 parent e0e2627 commit 6073a8d

File tree

8 files changed

+22
-20
lines changed

8 files changed

+22
-20
lines changed

Exceptionless.Net.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@
546546
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
547547
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
548548
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
549+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
549550
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
550551
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
551552
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<PropertyGroup Label="Package">
2929
<Product>Exceptionless</Product>
3030
<Description>Exceptionless is a cloud based error reporting service that sends your exceptions to https://exceptionless.com and provides aggregated views and analytics.</Description>
31-
<Copyright>Copyright (c) 2018 Exceptionless. All rights reserved.</Copyright>
31+
<Copyright>Copyright (c) 2019 Exceptionless. All rights reserved.</Copyright>
3232
<Authors>Exceptionless</Authors>
3333
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3434
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<DebugType>portable</DebugType>
66
<PreserveCompilationContext>true</PreserveCompilationContext>
77
<AssemblyName>Exceptionless.SampleAspNetCore</AssemblyName>
88
<OutputType>Exe</OutputType>
99
<PackageId>Exceptionless.SampleAspNetCore</PackageId>
10-
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
1110
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_0</DefineConstants>
1211
</PropertyGroup>
1312

@@ -18,6 +17,6 @@
1817
</ItemGroup>
1918

2019
<ItemGroup>
21-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
20+
<PackageReference Include="Microsoft.AspNetCore.App" />
2221
</ItemGroup>
2322
</Project>
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
using System;
2-
using System.IO;
2+
using Microsoft.AspNetCore;
33
using Microsoft.AspNetCore.Hosting;
44

55
namespace Exceptionless.SampleAspNetCore {
66
public class Program {
77
public static void Main(string[] args) {
8-
var host = new WebHostBuilder()
9-
.UseKestrel()
10-
.UseContentRoot(Directory.GetCurrentDirectory())
11-
.UseIISIntegration()
12-
.UseStartup<Startup>()
13-
.Build();
8+
CreateWebHostBuilder(args).Build().Run();
9+
}
1410

15-
host.Run();
11+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) {
12+
return WebHost.CreateDefaultBuilder(args).UseStartup<Startup>();
1613
}
1714
}
1815
}

samples/Exceptionless.SampleAspNetCore/Startup.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using Microsoft.AspNetCore.Builder;
33
using Microsoft.AspNetCore.Hosting;
4+
using Microsoft.AspNetCore.Mvc;
45
using Microsoft.Extensions.Configuration;
56
using Microsoft.Extensions.DependencyInjection;
67
using Microsoft.Extensions.Logging;
@@ -18,7 +19,11 @@ public Startup(IHostingEnvironment env) {
1819
public IConfigurationRoot Configuration { get; }
1920

2021
public void ConfigureServices(IServiceCollection services) {
21-
services.AddMvc();
22+
services.AddLogging(b => b
23+
.AddConfiguration(Configuration.GetSection("Logging"))
24+
.AddDebug()
25+
.AddConsole());
26+
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
2227
}
2328

2429
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
@@ -33,9 +38,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
3338
//loggerFactory.AddExceptionless((c) => c.ReadFromConfiguration(Configuration));
3439

3540
loggerFactory.AddExceptionless();
36-
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
37-
loggerFactory.AddDebug();
38-
3941
app.UseMvc();
4042
}
4143
}

samples/Exceptionless.SampleAspNetCore/web.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
<configuration>
33
<system.webServer>
44
<handlers>
5-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
5+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
66
</handlers>
7-
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
7+
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
8+
<environmentVariables />
9+
</aspNetCore>
810
</system.webServer>
911
</configuration>

samples/Exceptionless.SampleConsole/Exceptionless.SampleConsole.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
<AssemblyName>Exceptionless.SampleConsole</AssemblyName>
66
<OutputType>Exe</OutputType>
7-
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
87
</PropertyGroup>
98

109
<ItemGroup>

src/Platforms/Exceptionless.Extensions.Logging/ExceptionlessLoggerExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public static ExceptionlessLogLevel ToLogLevel(this LogLevel level) {
2424
return ExceptionlessLogLevel.Off;
2525
}
2626

27+
// TODO: Add support for ILoggingBuilder
28+
2729
/// <summary>
2830
/// Adds Exceptionless to the logging pipeline using the default client.
2931
/// </summary>

0 commit comments

Comments
 (0)