From a834e45b7e12c23ba715b0f169c043b0991b3bee Mon Sep 17 00:00:00 2001 From: Philipp Bauer Date: Thu, 29 Sep 2022 15:07:23 -0500 Subject: [PATCH 1/2] Removes PhotinoServer from photino.NET package * Removes PhotinoServer.NET.cs * Removes dependency to Microsoft.NET.Sdk.Web * Updates minor version --- Photino.NET/Photino.NET.csproj | 2 +- Photino.NET/PhotinoServer.NET.cs | 82 ---------------------------- azure-pipelines-photino.net-prod.yml | 2 +- 3 files changed, 2 insertions(+), 84 deletions(-) delete mode 100644 Photino.NET/PhotinoServer.NET.cs diff --git a/Photino.NET/Photino.NET.csproj b/Photino.NET/Photino.NET.csproj index 02ee49d..c05c1d0 100644 --- a/Photino.NET/Photino.NET.csproj +++ b/Photino.NET/Photino.NET.csproj @@ -1,4 +1,4 @@ - + TryPhotino diff --git a/Photino.NET/PhotinoServer.NET.cs b/Photino.NET/PhotinoServer.NET.cs deleted file mode 100644 index 0866e8e..0000000 --- a/Photino.NET/PhotinoServer.NET.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Linq; -using System.Net.NetworkInformation; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.FileProviders; - -namespace PhotinoNET; - -/// -/// The PhotinoServer class enables users to host their web projects in -/// a static, local file server to prevent CORS and other issues. -/// -public class PhotinoServer -{ - public static WebApplication CreateStaticFileServer( - string[] args, - out string baseUrl) - { - return CreateStaticFileServer( - args, - startPort: 8000, - portRange: 100, - webRootFolder: "wwwroot", - out baseUrl); - } - - public static WebApplication CreateStaticFileServer( - string[] args, - int startPort, - int portRange, - string webRootFolder, - out string baseUrl) - { - var builder = WebApplication - .CreateBuilder(new WebApplicationOptions() - { - Args = args, - WebRootPath = webRootFolder - }); - - var manifestEmbeddedFileProvider = - new ManifestEmbeddedFileProvider( - System.Reflection.Assembly.GetEntryAssembly(), - $"Resources/{webRootFolder}"); - - var physicalFileProvider = builder.Environment.WebRootFileProvider; - - CompositeFileProvider compositeWebProvider - = new(manifestEmbeddedFileProvider, physicalFileProvider); - - builder.Environment.WebRootFileProvider = compositeWebProvider; - - int port = startPort; - - // Try ports until available port is found - while (IPGlobalProperties - .GetIPGlobalProperties() - .GetActiveTcpListeners() - .Any(x => x.Port == port)) - { - if (port > port + portRange) - { - throw new SystemException($"Couldn't find open port within range {port - portRange} - {port}."); - } - - port++; - } - - baseUrl = $"http://localhost:{port}"; - - builder.WebHost.UseUrls(baseUrl); - - WebApplication app = builder.Build(); - app.UseStaticFiles(new StaticFileOptions - { - DefaultContentType = "text/plain" - }); - - return app; - } -} diff --git a/azure-pipelines-photino.net-prod.yml b/azure-pipelines-photino.net-prod.yml index 69dc88f..8a08bf1 100644 --- a/azure-pipelines-photino.net-prod.yml +++ b/azure-pipelines-photino.net-prod.yml @@ -6,7 +6,7 @@ trigger: variables: major: 2 - minor: 2 + minor: 3 patch: $[counter(variables['minor'], 0)] #this will reset when we bump minor buildConfiguration: 'Release' From 4620679e1e3df0930ce4239af8669c818ac2efe0 Mon Sep 17 00:00:00 2001 From: Philipp Bauer Date: Thu, 29 Sep 2022 16:19:21 -0500 Subject: [PATCH 2/2] Update .NET version in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37814e5..a03a95b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Photino is a lightweight open-source framework for building native, cross-platform desktop applications with Web UI technology. -Photino enables developers to use fast, natively compiled languages like C#, C++, Java and more. Use your favorite development frameworks like .NET 5, and build desktop apps with Web UI frameworks, like Blazor, React, Angular, Vue, etc.! +Photino enables developers to use fast, natively compiled languages like C#, C++, Java and more. Use your favorite development frameworks like .NET 6, and build desktop apps with Web UI frameworks, like Blazor, React, Angular, Vue, etc.! Photino uses the OSs built-in WebKit-based browser control for Windows, macOS and Linux. Photino is the lightest cross-platform framework. Compared to Electron, a Photino app is up to 110 times smaller! And it uses far less system memory too! @@ -11,7 +11,7 @@ Photino is the lightest cross-platform framework. Compared to Electron, a Photin ## Photino.NET -This project represents the .NET 5 wrapper for the Photino.Native project, which makes it available for all operating systems (Windows, macOS, Linux). +This project represents the .NET 6 wrapper for the Photino.Native project, which makes it available for all operating systems (Windows, macOS, Linux). This library is used for all the sample projects provided by Photino, which include Blazor, Vue.JS, Angular, React, or the basic HTML app: https://github.com/tryphotino/photino.Samples