⚡ Sangsakala Proxy 🏠 Home
Skip to content

Commit f697c51

Browse files
committed
.net core 2.2 updates, reivews, cli improvements
1 parent 6854c19 commit f697c51

17 files changed

Lines changed: 63 additions & 56 deletions

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ If you don't specify the main application directory it will create the default _
1111

1212

1313
### Install
14-
Download the .NET Core SDK 2.1.0 or newer. Once installed, run this command:
14+
Download the .NET Core SDK 2.2.0 or newer. Once installed, run this command:
1515

16-
dotnet tool install --global dotnet-hisar --version 2.1.1
16+
dotnet tool install --global dotnet-hisar --version 2.2.0
1717

1818
### Usage
1919

‎pack.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dotnet restore NetCoreStack.Tools.sln
22
dotnet build NetCoreStack.Tools.sln
33
cd src/NetCoreStack.Hisar.WebCli.Tools
4-
dotnet pack -o ../../nupkg /p:Version=2.1.1-preview1 -c Release
4+
dotnet pack -o ../../nupkg /p:Version=2.2.0-preview1 -c Release

‎pack.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
dotnet restore NetCoreStack.Tools.sln
44
dotnet build NetCoreStack.Tools.sln
55
cd src/NetCoreStack.Hisar.WebCli.Tools
6-
dotnet pack -o ../../nupkg /p:Version=2.1.1-preview1 -c Release
6+
dotnet pack -o ../../nupkg /p:Version=2.2.0-preview1 -c Release

‎src/NetCoreStack.Hisar.WebCli.Tools/Controllers/DiscoveryController.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public async Task<IActionResult> SendAsync([FromBody]SimpleCacheItem model)
5656
public IActionResult GetConnections()
5757
{
5858
var connections = _connectionManager.Connections
59-
.Select(x => new { ConnectionId = x.Value.ConnectionId, ConnectorName = x.Value.ConnectorName });
59+
.Select(x => new { ConnectionId = x.Value.ConnectionId, ConnectorName = x.Value.ConnectorName, State = x.Value.WebSocket.State });
6060

6161
return Json(connections);
6262
}

‎src/NetCoreStack.Hisar.WebCli.Tools/Core/HostingHelper.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static int GetHostingPort()
2525
{
2626
port = HostingPort(1444);
2727
}
28-
catch (Exception)
28+
catch (Exception ex)
2929
{
3030
port = HostingPort();
3131
}

‎src/NetCoreStack.Hisar.WebCli.Tools/NetCoreStack.Hisar.WebCli.Tools.csproj‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp2.2</TargetFramework>
44
<AssemblyName>dotnet-hisar</AssemblyName>
55
<Description>Global tool to build Hisar web application and components.</Description>
66
<PackageTags>dotnet, global tools, hisar</PackageTags>
@@ -12,10 +12,11 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" />
15+
<PackageReference Include="Microsoft.AspNetCore.App" />
16+
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.0" />
1718
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
18-
<PackageReference Include="NetCoreStack.WebSockets" Version="2.4.0" />
19+
<PackageReference Include="NetCoreStack.WebSockets" Version="2.5.2" />
1920
</ItemGroup>
2021

2122
<ItemGroup>

‎src/NetCoreStack.Hisar.WebCli.Tools/Program.cs‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Linq;
1010
using System.Runtime.InteropServices;
1111
using System.Threading.Tasks;
12+
using Microsoft.Extensions.Logging;
1213

1314
namespace NetCoreStack.Hisar.WebCli.Tools
1415
{
@@ -126,10 +127,27 @@ await Task.Run(() =>
126127
contentRoot = PathUtility.GetRootPath(true);
127128
#endif
128129
var hostBuilder = new WebHostBuilder()
130+
.UseKestrel(options => options.AddServerHeader = false)
129131
.UseContentRoot(contentRoot)
130132
.UseUrls(_urls.ToArray())
131-
.UseKestrel(options => options.AddServerHeader = false)
132-
.UseIISIntegration()
133+
.ConfigureAppConfiguration((hostingContext, config) =>
134+
{
135+
var env = hostingContext.HostingEnvironment;
136+
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
137+
.AddJsonFile($"appsettings.{env.EnvironmentName}.json",
138+
optional: true, reloadOnChange: true);
139+
140+
config.AddEnvironmentVariables();
141+
})
142+
.ConfigureLogging((webHostBuilderContext, logging) =>
143+
{
144+
IConfiguration configuration = webHostBuilderContext.Configuration;
145+
ILoggingBuilder loggerBuilder = logging;
146+
147+
loggerBuilder.AddConfiguration(configuration.GetSection("Logging"));
148+
loggerBuilder.AddConsole();
149+
loggerBuilder.AddDebug();
150+
})
133151
.UseStartup<Startup>();
134152
#if RELEASE
135153
hostBuilder.UseWebRoot(PathUtility.GetRootPath());

‎src/NetCoreStack.Hisar.WebCli.Tools/Properties/Resource.Designer.cs‎

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/NetCoreStack.Hisar.WebCli.Tools/Properties/Resource.resx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ namespace {0}
181181
&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
182182
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"&gt;
183183
&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
184-
&lt;link rel="stylesheet" href="http://cdn.netcorestack.com/css/efe-all-2.1.5.min.css"&gt;
184+
&lt;link rel="stylesheet" href="http://cdn.netcorestack.com/css/efe-all-2.2.0.min.css"&gt;
185185
@RenderSection("styles", required: false)
186186
&lt;script src="http://cdn.netcorestack.com/js/bundle.min.js"&gt;&lt;/script&gt;
187-
&lt;script src="http://cdn.netcorestack.com/js/efe-all-2.1.5.min.js"&gt;&lt;/script&gt;
187+
&lt;script src="http://cdn.netcorestack.com/js/efe-all-2.2.0.min.js"&gt;&lt;/script&gt;
188188
&lt;/head&gt;
189189
&lt;body style="padding-top: 80px;"&gt;
190190
&lt;nav class="navbar navbar-default navbar-fixed-top"&gt;
@@ -234,4 +234,4 @@ namespace {0}
234234
&lt;/body&gt;
235235
&lt;/html&gt;</value>
236236
</data>
237-
</root>
237+
</root>

‎src/NetCoreStack.Hisar.WebCli.Tools/Properties/launchSettings.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:1444/",
6+
"applicationUrl": "http://localhost:51611/",
77
"sslPort": 0
88
}
99
},
@@ -20,10 +20,10 @@
2020
"commandName": "Project",
2121
"commandLineArgs": "--appdir ..\\..\\test\\Hosting",
2222
"launchBrowser": true,
23+
"applicationUrl": "http://localhost:1444/",
2324
"environmentVariables": {
2425
"ASPNETCORE_ENVIRONMENT": "Development"
25-
},
26-
"applicationUrl": "http://localhost:50884"
26+
}
2727
}
2828
}
2929
}

0 commit comments

Comments
 (0)