Skip to content

Commit

Permalink
Merge pull request #8 from michaeldeongreen/michaeldeongreen/feature/…
Browse files Browse the repository at this point in the history
…dotnetcore-3

Upgraded the project to dotnet core 3.1.
  • Loading branch information
dbarkol authored May 27, 2020
2 parents 1d3f41f + bbea203 commit 1a37a85
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/viewer/bin/Debug/netcoreapp2.1/viewer.dll",
"program": "${workspaceFolder}/viewer/bin/Debug/netcoreapp3.1/viewer.dll",
"args": [],
"cwd": "${workspaceFolder}/viewer",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion viewer/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/viewer.dll",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/viewer.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
Expand Down
9 changes: 1 addition & 8 deletions viewer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace viewer
{
Expand Down
20 changes: 9 additions & 11 deletions viewer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using viewer.Hubs;

namespace viewer
Expand All @@ -27,14 +28,14 @@ public void ConfigureServices(IServiceCollection services)
options.MinimumSameSitePolicy = SameSiteMode.None;
});

services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

// Awwww yeah!
services.AddSignalR();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand All @@ -49,18 +50,15 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseRouting();

// Add SignalR hub routes
app.UseSignalR(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapHub<GridEventsHub>("/hubs/gridevents");
});

app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapHub<GridEventsHub>("/hubs/gridevents");
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion viewer/viewer.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

</Project>

0 comments on commit 1a37a85

Please sign in to comment.