Skip to content

Commit

Permalink
Updated samples to .net core 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Jan 25, 2019
1 parent e0e2627 commit 6073a8d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
1 change: 1 addition & 0 deletions Exceptionless.Net.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PropertyGroup Label="Package">
<Product>Exceptionless</Product>
<Description>Exceptionless is a cloud based error reporting service that sends your exceptions to https://exceptionless.com and provides aggregated views and analytics.</Description>
<Copyright>Copyright (c) 2018 Exceptionless. All rights reserved.</Copyright>
<Copyright>Copyright (c) 2019 Exceptionless. All rights reserved.</Copyright>
<Authors>Exceptionless</Authors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Exceptionless.SampleAspNetCore</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>Exceptionless.SampleAspNetCore</PackageId>
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

Expand All @@ -18,6 +17,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
</Project>
13 changes: 5 additions & 8 deletions samples/Exceptionless.SampleAspNetCore/Program.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
using System;
using System.IO;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;

namespace Exceptionless.SampleAspNetCore {
public class Program {
public static void Main(string[] args) {
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
CreateWebHostBuilder(args).Build().Run();
}

host.Run();
public static IWebHostBuilder CreateWebHostBuilder(string[] args) {
return WebHost.CreateDefaultBuilder(args).UseStartup<Startup>();
}
}
}
10 changes: 6 additions & 4 deletions samples/Exceptionless.SampleAspNetCore/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand All @@ -18,7 +19,11 @@ public Startup(IHostingEnvironment env) {
public IConfigurationRoot Configuration { get; }

public void ConfigureServices(IServiceCollection services) {
services.AddMvc();
services.AddLogging(b => b
.AddConfiguration(Configuration.GetSection("Logging"))
.AddDebug()
.AddConsole());
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
}

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

loggerFactory.AddExceptionless();
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

app.UseMvc();
}
}
Expand Down
6 changes: 4 additions & 2 deletions samples/Exceptionless.SampleAspNetCore/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables />
</aspNetCore>
</system.webServer>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>Exceptionless.SampleConsole</AssemblyName>
<OutputType>Exe</OutputType>
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static ExceptionlessLogLevel ToLogLevel(this LogLevel level) {
return ExceptionlessLogLevel.Off;
}

// TODO: Add support for ILoggingBuilder

/// <summary>
/// Adds Exceptionless to the logging pipeline using the default client.
/// </summary>
Expand Down

0 comments on commit 6073a8d

Please sign in to comment.