Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions ProxyAgent.Test/ProxyAgent.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<LangVersion>7</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Moq" Version="4.7.145" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ProxyAgent\ProxyAgent.csproj" />
Expand Down
14 changes: 6 additions & 8 deletions ProxyAgent/ProxyAgent.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>Microsoft.Azure.IoTSolutions.ReverseProxy</AssemblyName>
<RootNamespace>Microsoft.Azure.IoTSolutions.ReverseProxy</RootNamespace>
<LangVersion>7</LangVersion>
Expand All @@ -15,13 +15,11 @@
<LaunchUrl>http://localhost:9000/</LaunchUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.6.2" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.1" />
<PackageReference Include="Autofac" Version="4.9.2" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Content Update="web.config">
Expand Down
12 changes: 8 additions & 4 deletions ProxyAgent/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Builder;
Expand All @@ -9,6 +8,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using ILogger = Microsoft.Azure.IoTSolutions.ReverseProxy.Diagnostics.ILogger;

namespace Microsoft.Azure.IoTSolutions.ReverseProxy
Expand All @@ -34,6 +34,12 @@ public Startup(IHostingEnvironment env)
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc();
// Moving the Logger.AddConsole() from Configure to ConfigureServices by using Services.
services.AddLogging(loggingBuilder =>
{
loggingBuilder.AddConfiguration(this.Configuration.GetSection("Logging"));
loggingBuilder.AddConsole();
});

this.ApplicationContainer = DependencyResolution.Setup(services);

Expand All @@ -51,8 +57,6 @@ public void Configure(
ILoggerFactory loggerFactory,
IApplicationLifetime appLifetime)
{
loggerFactory.AddConsole(this.Configuration.GetSection("Logging"));

// Uncomment these lines if you want to host static files in wwwroot/
// More info: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware
// app.UseDefaultFiles();
Expand All @@ -76,4 +80,4 @@ private static void PrintBootstrapInfo(IContainer container)
logger.Info("Max payload size: " + config.MaxPayloadSize, () => { });
}
}
}
}