Skip to content

Commit

Permalink
Merge pull request #92 from nabinked/core30support
Browse files Browse the repository at this point in the history
support aspdotnet core 3.0
  • Loading branch information
nabinked committed Sep 24, 2019
2 parents e41ca43 + 9db20d5 commit 349015f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.2.401"
"version": "3.0.100"
}
}
12 changes: 2 additions & 10 deletions samples/Noty/Noty.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\NToastNotify.csproj" />
</ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions samples/Noty/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NToastNotify;

namespace Noty
Expand All @@ -33,7 +34,7 @@ public void ConfigureServices(IServiceCollection services)
});


services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNToastNotifyNoty(new NotyOptions
{
ProgressBar = true,
Expand All @@ -43,7 +44,7 @@ public void ConfigureServices(IServiceCollection services)
}

// 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 @@ -58,9 +59,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseCookiePolicy();
app.UseNToastNotify();
app.UseMvc();
app.UseEndpoints(x => x.MapRazorPages());
}
}
}
8 changes: 5 additions & 3 deletions samples/Toastr/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Toastr
{
Expand All @@ -32,12 +33,12 @@ public void ConfigureServices(IServiceCollection services)
});


services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNToastNotifyToastr();
}

// 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 @@ -52,9 +53,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseCookiePolicy();
app.UseNToastNotify();
app.UseMvc();
app.UseEndpoints(x => x.MapRazorPages());
}
}
}
13 changes: 2 additions & 11 deletions samples/Toastr/Toastr.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\..\src\NToastNotify.csproj" />
</ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions src/NToastNotify.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Description>Dot Net abstraction of javascript toastr to create toast notification on ASP.NET Core MVC Projects</Description>
<Copyright>Nabin Karki Thapa</Copyright>
<AssemblyTitle>NToastNotify</AssemblyTitle>
<VersionPrefix>5.0.12</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<Authors>Nabin Kakri Thapa</Authors>
<PackageProjectUrl>https://github.com/nabinked/NToastNotify</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -16,17 +16,18 @@
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="js\dist\**\*.js" />
<EmbeddedResource Include="js\dist\**\*.js.map" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="3.0.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/StartupExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using NToastNotify;
using NToastNotify.Helpers;
Expand Down Expand Up @@ -73,7 +73,7 @@ public static IApplicationBuilder UseNToastNotify(this IApplicationBuilder build
#region Framework Services
//Add the file provider to the Razor view engine
var fileProvider = Utils.GetEmbeddedFileProvider();
services.Configure<RazorViewEngineOptions>(options =>
services.Configure<MvcRazorRuntimeCompilationOptions>(options =>
{
options.FileProviders.Add(fileProvider);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/NToastNotify.Tests/NToastNotify.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit 349015f

Please sign in to comment.