Skip to content

Commit 84be8aa

Browse files
author
Steve Salas
committed
Update dotnet-symbol-service subtree
https://github.com/codedx/dotnet-symbol-service
2 parents 4182521 + fdc4c07 commit 84be8aa

File tree

6 files changed

+29
-35
lines changed

6 files changed

+29
-35
lines changed

dotnet-symbol-service/SymbolService/Controllers/MethodsController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
namespace SymbolService.Controllers
2929
{
30+
[ApiController]
3031
[Produces("application/json")]
3132
[Route("api/Methods")]
3233
public class MethodsController : Controller

dotnet-symbol-service/SymbolService/Program.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,23 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
using Microsoft.AspNetCore;
1817
using Microsoft.AspNetCore.Hosting;
18+
using Microsoft.Extensions.Hosting;
1919

2020
namespace SymbolService
2121
{
2222
public class Program
2323
{
2424
public static void Main(string[] args)
2525
{
26-
BuildWebHost(args).Run();
26+
CreateHostBuilder(args).Build().Run();
2727
}
2828

29-
public static IWebHost BuildWebHost(string[] args) =>
30-
WebHost.CreateDefaultBuilder(args)
31-
.UseStartup<Startup>()
32-
.Build();
29+
public static IHostBuilder CreateHostBuilder(string[] args) =>
30+
Host.CreateDefaultBuilder(args)
31+
.ConfigureWebHostDefaults(webBuilder =>
32+
{
33+
webBuilder.UseStartup<Startup>();
34+
});
3335
}
3436
}

dotnet-symbol-service/SymbolService/Startup.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using Microsoft.AspNetCore.Hosting;
1919
using Microsoft.Extensions.Configuration;
2020
using Microsoft.Extensions.DependencyInjection;
21-
using Microsoft.Extensions.Logging;
21+
using Microsoft.Extensions.Hosting;
2222

2323
namespace SymbolService
2424
{
@@ -34,21 +34,23 @@ public Startup(IConfiguration configuration)
3434
// This method gets called by the runtime. Use this method to add services to the container.
3535
public void ConfigureServices(IServiceCollection services)
3636
{
37-
services.AddMvc();
37+
services.AddControllers();
3838
}
3939

4040
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
41-
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
41+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
4242
{
43-
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
44-
loggerFactory.AddDebug();
45-
4643
if (env.IsDevelopment())
4744
{
4845
app.UseDeveloperExceptionPage();
4946
}
5047

51-
app.UseMvc();
48+
app.UseRouting();
49+
50+
app.UseEndpoints(endpoints =>
51+
{
52+
endpoints.MapControllers();
53+
});
5254
}
5355
}
5456
}

dotnet-symbol-service/SymbolService/SymbolService.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AssemblyName>SymbolService</AssemblyName>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.2" />
10-
</ItemGroup>
11-
12-
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
149
<PackageReference Include="Mono.Cecil" Version="0.10.0-beta7" />
1510
</ItemGroup>
1611

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"Logging": {
3-
"IncludeScopes": false,
43
"LogLevel": {
5-
"Default": "Debug",
6-
"System": "Information",
7-
"Microsoft": "Information"
4+
"Default": "Information",
5+
"Microsoft": "Warning",
6+
"Microsoft.Hosting.Lifetime": "Information"
87
}
98
}
10-
}
9+
}
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
22
"Logging": {
3-
"IncludeScopes": false,
4-
"Debug": {
5-
"LogLevel": {
6-
"Default": "Warning"
7-
}
8-
},
9-
"Console": {
10-
"LogLevel": {
11-
"Default": "Warning"
12-
}
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft": "Warning",
6+
"Microsoft.Hosting.Lifetime": "Information"
137
}
14-
}
8+
},
9+
"AllowedHosts": "*"
1510
}

0 commit comments

Comments
 (0)