Skip to content

Commit

Permalink
upgrade to .net 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Nov 21, 2021
1 parent f1b195c commit 215e695
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 51 deletions.
5 changes: 3 additions & 2 deletions App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
</ul>

@code {
private const string DefaultCronExpression = "0 0 12 * */2 Mon";
private DateTime startDate = DateTime.Today;
private string cronExpression = "0 0 12 * */2 Mon";
private CrontabSchedule cronSchedule;
private string cronExpression = DefaultCronExpression;
private CrontabSchedule cronSchedule = CrontabSchedule.Parse(DefaultCronExpression, new CrontabSchedule.ParseOptions { IncludingSeconds = true });
private List<DateTime> occurrences = new List<DateTime>();
private string errorMessage = string.Empty;
private List<Action> actionsToRunAfterRender = new List<Action>();
Expand Down
16 changes: 9 additions & 7 deletions NCrontabTester.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishTrimmed>true</PublishTrimmed>
<InvariantGlobalization>true</InvariantGlobalization>
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="ncrontab" Version="3.3.1" />
<PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
</ItemGroup>

</Project>
27 changes: 4 additions & 23 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
using System;
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NCrontabTester;

namespace NCrontabTester
{
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

await builder.Build().RunAsync();
}
}
}
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
await builder.Build().RunAsync();
16 changes: 0 additions & 16 deletions Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:59084",
"sslPort": 44303
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"NCrontabTester": {
"commandName": "Project",
"launchBrowser": true,
Expand Down
4 changes: 1 addition & 3 deletions _Imports.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.WebAssembly.Http
Expand Down

0 comments on commit 215e695

Please sign in to comment.