2017-10-03 04:17:14 +02:00
|
|
|
|
using Microsoft.AspNetCore;
|
2017-10-02 20:40:28 +02:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2017-10-05 03:47:09 +02:00
|
|
|
|
using System;
|
2017-10-06 00:37:14 +02:00
|
|
|
|
using System.Diagnostics;
|
2017-10-02 20:40:28 +02:00
|
|
|
|
|
|
|
|
|
|
namespace ElectronNET.WebApp
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
2017-10-03 04:17:14 +02:00
|
|
|
|
BuildWebHost(args).Run();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-05 03:47:09 +02:00
|
|
|
|
// WICHTIG! UseContentRoot auf Assembly Ordner Essentiell!
|
|
|
|
|
|
// Ggf. kann man via Parameter den Content Root durchreichen?
|
2017-10-06 00:37:14 +02:00
|
|
|
|
public static IWebHost BuildWebHost(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
// ToDo: Maybe add a "electronized" args check here?
|
|
|
|
|
|
// this is the electron case!
|
2017-10-06 02:54:55 +02:00
|
|
|
|
//if (args.Length > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
//Console.WriteLine("Test Switch for Electron detection: " + args[0]);
|
2017-10-06 00:37:14 +02:00
|
|
|
|
return WebHost.CreateDefaultBuilder(args)
|
|
|
|
|
|
.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory)
|
|
|
|
|
|
.UseStartup<Startup>()
|
|
|
|
|
|
.Build();
|
2017-10-06 02:54:55 +02:00
|
|
|
|
//}
|
|
|
|
|
|
//else
|
|
|
|
|
|
//{
|
|
|
|
|
|
// return WebHost.CreateDefaultBuilder(args)
|
|
|
|
|
|
// .UseStartup<Startup>()
|
|
|
|
|
|
// .Build();
|
|
|
|
|
|
//}
|
2017-10-06 00:37:14 +02:00
|
|
|
|
|
|
|
|
|
|
// this didn't work... its too late, idk...
|
|
|
|
|
|
//var builder = WebHost.CreateDefaultBuilder(args);
|
|
|
|
|
|
|
|
|
|
|
|
//if (args.Length > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// // ToDo: Maybe add a "electronized" args check here?
|
|
|
|
|
|
// Console.WriteLine("Test Switch for Electron detection: " + args[0]);
|
|
|
|
|
|
// builder = builder.UseContentRoot(AppDomain.CurrentDomain.BaseDirectory);
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//builder = builder.UseStartup<Startup>();
|
|
|
|
|
|
|
|
|
|
|
|
//return builder.Build();
|
|
|
|
|
|
}
|
2017-10-02 20:40:28 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|