upgrade to .NET 6 and increment version to 3.0.0
This commit is contained in:
@ -20,6 +20,7 @@ using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
using SixLabors.ImageSharp.Formats.Png;
|
||||
using SixLabors.ImageSharp.PixelFormats;
|
||||
using System.Net.Http;
|
||||
|
||||
// ReSharper disable StringIndexOfIsCultureSpecific.1
|
||||
|
||||
@ -190,7 +191,7 @@ namespace Oqtane.Controllers
|
||||
|
||||
// GET api/<controller>/upload?url=x&folderid=y&name=z
|
||||
[HttpGet("upload")]
|
||||
public Models.File UploadFile(string url, string folderid, string name)
|
||||
public async Task<Models.File> UploadFile(string url, string folderid, string name)
|
||||
{
|
||||
Models.File file = null;
|
||||
|
||||
@ -227,15 +228,25 @@ namespace Oqtane.Controllers
|
||||
|
||||
try
|
||||
{
|
||||
var client = new WebClient();
|
||||
string targetPath = Path.Combine(folderPath, name);
|
||||
|
||||
// remove file if it already exists
|
||||
if (System.IO.File.Exists(targetPath))
|
||||
{
|
||||
System.IO.File.Delete(targetPath);
|
||||
}
|
||||
|
||||
client.DownloadFile(url, targetPath);
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
using (var stream = await client.GetStreamAsync(url))
|
||||
{
|
||||
using (var fileStream = new FileStream(targetPath, FileMode.CreateNew))
|
||||
{
|
||||
await stream.CopyToAsync(fileStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file = CreateFile(name, folder.FolderId, targetPath);
|
||||
if (file != null)
|
||||
{
|
||||
|
@ -4,10 +4,11 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@ -228,7 +229,7 @@ namespace Oqtane.Infrastructure
|
||||
return false;
|
||||
}
|
||||
|
||||
public void UpgradeFramework()
|
||||
public async Task UpgradeFramework()
|
||||
{
|
||||
string folder = Path.Combine(_environment.ContentRootPath, Constants.PackagesFolder);
|
||||
if (Directory.Exists(folder))
|
||||
@ -281,10 +282,18 @@ namespace Oqtane.Infrastructure
|
||||
// install Oqtane.Framework and Oqtane.Updater nuget packages
|
||||
InstallPackages();
|
||||
// download upgrade zip package
|
||||
var client = new WebClient();
|
||||
Uri uri = new Uri(packageurl);
|
||||
string upgradepackage = Path.Combine(folder, uri.Segments[uri.Segments.Length - 1]);
|
||||
client.DownloadFile(packageurl, upgradepackage);
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
using (var stream = await client.GetStreamAsync(packageurl))
|
||||
{
|
||||
using (var fileStream = new FileStream(upgradepackage, FileMode.CreateNew))
|
||||
{
|
||||
await stream.CopyToAsync(fileStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
// install Oqtane.Upgrade zip package
|
||||
if (File.Exists(upgradepackage))
|
||||
{
|
||||
|
@ -1,10 +1,12 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Oqtane.Infrastructure
|
||||
{
|
||||
public interface IInstallationManager
|
||||
{
|
||||
void InstallPackages();
|
||||
bool UninstallPackage(string PackageName);
|
||||
void UpgradeFramework();
|
||||
Task UpgradeFramework();
|
||||
void RestartApplication();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Version>2.3.1</Version>
|
||||
<Version>3.0.0</Version>
|
||||
<Product>Oqtane</Product>
|
||||
<Authors>Shaun Walker</Authors>
|
||||
<Company>.NET Foundation</Company>
|
||||
@ -11,7 +11,7 @@
|
||||
<Copyright>.NET Foundation</Copyright>
|
||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v2.3.1</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v3.0.0</PackageReleaseNotes>
|
||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||
<RepositoryType>Git</RepositoryType>
|
||||
<RootNamespace>Oqtane</RootNamespace>
|
||||
@ -30,20 +30,20 @@
|
||||
<EmbeddedResource Include="Scripts\MigrateTenant.sql" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.0.1" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.4">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0-rc.2.21480.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-rc.2.21480.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0-rc.2.21480.10" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0-preview2.21264.2" />
|
||||
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="6.0.0-rc.2.21480.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rc.2.21480.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.4" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.0-rc.2.21480.10" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.0.7-pre20210929171745" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Oqtane.Client\Oqtane.Client.csproj" />
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user