Skip to content

Commit

Permalink
Merge pull request #30 from emisand/master
Browse files Browse the repository at this point in the history
Added compatibility with ASP.NET Core 3.0
  • Loading branch information
gordon-matt authored Nov 27, 2019
2 parents 8e377e1 + 6c5a171 commit e127385
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
<Authors>Yevhen Noskov, Leniel Macaferi, Matt Gordon, Flavio Smirne</Authors>
<Company>N/A</Company>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageProjectUrl>https://github.com/gordon-matt/elFinder.NetCore</PackageProjectUrl>
<Description>Microsoft Azure Storage driver for elFinder.NetCore</Description>
<PackageLicenseUrl></PackageLicenseUrl>
<Version>1.2.1</Version>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="2.2.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.2'">
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\elFinder.NetCore\elFinder.NetCore.csproj" />
</ItemGroup>
Expand Down
19 changes: 9 additions & 10 deletions elFinder.NetCore.Web/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.IO;
using elFinder.NetCore.Drivers.AzureStorage;
using elFinder.NetCore.Drivers.AzureStorage;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.IO;

namespace elFinder.NetCore.Web
{
Expand Down Expand Up @@ -33,12 +33,12 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc()
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddControllersWithViews()
.AddNewtonsoftJson();
}

// 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 @@ -56,12 +56,11 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();

app.UseMvc(routes =>
app.UseEndpoints(endpoints =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
});

WebRootPath = env.WebRootPath;
Expand Down
6 changes: 3 additions & 3 deletions elFinder.NetCore.Web/elFinder.NetCore.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UserSecretsId>a13535c9-0a1e-4ed1-8437-bafcc87a57a9</UserSecretsId>
<NeutralLanguage>en-US</NeutralLanguage>
<Authors>Yevhen Noskov, Leniel Macaferi, Matt Gordon, Flavio Smirne</Authors>
Expand All @@ -12,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 11 additions & 4 deletions elFinder.NetCore/elFinder.NetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFrameworks>netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
<Authors>Yevhen Noskov, Leniel Macaferi, Matt Gordon, Flavio Smirne</Authors>
<Company>N/A</Company>
<NeutralLanguage>en-US</NeutralLanguage>
<Description>elFinder ASP.NET Core backend</Description>
<PackageProjectUrl>https://github.com/gordon-matt/elFinder.NetCore</PackageProjectUrl>
<Version>1.2.1</Version>
<PackageLicenseUrl></PackageLicenseUrl>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,9 +19,14 @@
<ItemGroup>
<EmbeddedResource Include="MimeTypes.txt" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.2'">
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.0'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="System.Drawing.Common" Version="4.6.0" />
</ItemGroup>
</Project>

0 comments on commit e127385

Please sign in to comment.