diff --git a/Library/LocalDrive.cs b/Library/LocalDrive.cs index 7f6418e..90e3f5c 100644 --- a/Library/LocalDrive.cs +++ b/Library/LocalDrive.cs @@ -181,7 +181,7 @@ public string Mkdir(string path) { // Copy makes a copy of file or a folder public string Copy(string source, string target) { if (_logger != null) - _logger.LogDebug($"Copy %s to %s", source, target); + _logger.LogDebug($"Copy {source} to {target}"); bool ok = Exists(target); source = idToPath(source); @@ -222,7 +222,7 @@ public string Copy(string source, string target) { // Move renames(moves) a file or a folder public string Move(string source, string target) { if (_logger != null) - _logger.LogDebug($"Move %s to %s", source, target); + _logger.LogDebug($"Move {source} to {target}"); bool ok = Exists(target); source = idToPath(source); diff --git a/Program.cs b/Program.cs index 0439489..1028405 100644 --- a/Program.cs +++ b/Program.cs @@ -1,25 +1,29 @@ -using System.IO; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; -namespace WebixDemos +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +builder.Services.AddRazorPages(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) { - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .ConfigureAppConfiguration((hostingContext, config) => - { - config.SetBasePath(Directory.GetCurrentDirectory()); - config.AddJsonFile( - "config.json", optional: false, reloadOnChange: true); - }) - .UseStartup(); - } + app.UseExceptionHandler("/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); } + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseRouting(); + +app.UseAuthorization(); + +app.MapRazorPages(); + +app.Run(); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index f854918..06e1373 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -1,8 +1,8 @@ -{ +{ "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, + "windowsAuthentication": false, + "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:27896", "sslPort": 44347 @@ -12,7 +12,6 @@ "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -21,10 +20,10 @@ "commandName": "Project", "launchBrowser": true, "launchUrl": "api/values", - "applicationUrl": "http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "http://localhost:5000" } } } \ No newline at end of file diff --git a/Startup.cs b/Startup.cs deleted file mode 100644 index 2f8025c..0000000 --- a/Startup.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace WebixDemos -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // 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); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - // app.UseHsts(); - } - - // app.UseHttpsRedirection(); - app.UseMvc(); - } - } -} diff --git a/WebixDemos.csproj b/WebixDemos.csproj index dc10ec6..2e14578 100644 --- a/WebixDemos.csproj +++ b/WebixDemos.csproj @@ -1,16 +1,18 @@ - - netcoreapp2.2 + net6.0 InProcess - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + - - + \ No newline at end of file diff --git a/appsettings.json b/appsettings.json index 7376aad..8edb9ec 100644 --- a/appsettings.json +++ b/appsettings.json @@ -4,5 +4,6 @@ "Default": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "uploads": "./uploads" } diff --git a/config.json b/config.json deleted file mode 100644 index bbc2d73..0000000 --- a/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "uploads": "./uploads" -} \ No newline at end of file