diff --git a/Program.cs b/Program.cs index 4148248..1f3aee1 100644 --- a/Program.cs +++ b/Program.cs @@ -1,18 +1,32 @@ +using CVRLIB.CVENVIRONMENT; +using static CVRLIB.CVGlobal; +using CA_ANC.Formatters; +using CVRLIB; +using CVRLIB.Inventory; +using CVRLIB.Customers; //ZXING.dll does not copy properly to publish folder, copy manually from another lib, ie cvrlib-nf. + var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorPages(); -builder.Services.AddControllers().AddJsonOptions((options => { - //was changing PRINTER_NAME to printeR_NAME (pascal Case: https://github.com/dotnet/runtime/issues/30887) - options.JsonSerializerOptions.PropertyNamingPolicy = null; -})); +//builder.Services.AddControllers().AddJsonOptions((options => { +// //was changing PRINTER_NAME to printeR_NAME (pascal Case: https://github.com/dotnet/runtime/issues/30887) +// options.JsonSerializerOptions.PropertyNamingPolicy = null; +//})); + + +builder.Services + .AddControllers(options => { options.InputFormatters.Add(new ByteArrayInputFormatter()); }) + .AddNewtonsoftJson() + ; + var app = builder.Build(); @@ -27,6 +41,14 @@ if (!app.Environment.IsDevelopment()) { VSERVERWS.Global.Globals.IsDevelopment = app.Environment.IsDevelopment(); +VSERVERWS.Global.Globals.LoadPrinters(); + + +CVGlobal.TryGlobalPRELoadCVCollections(new[] { typeof(CVINVENTORY), typeof(CVCustomers) }); + + + + app.UseHttpsRedirection(); app.UseStaticFiles(); @@ -42,4 +64,19 @@ app.MapRazorPages(); app.Run(); -VSERVERWS.Global.Globals.LoadPrinters(); \ No newline at end of file + + + + + + + + +public partial class Program { + + public static CVSECRETS? CVS { get; set; } = null; + public static string AppPath { get; set; } = ""; + public static string HTTPROOT { get; set; } = ""; + public static bool IsDevMode { get; set; } = false; + +} \ No newline at end of file diff --git a/VSERVERWS.csproj b/VSERVERWS.csproj index 5719039..2a49289 100644 --- a/VSERVERWS.csproj +++ b/VSERVERWS.csproj @@ -1,4 +1,4 @@ - + net6.0-windows @@ -9,19 +9,43 @@ + + + - - - ..\..\VB.NET\CVRLIB\CVRLIB\bin\Release\netstandard2.0\CVRLIB.dll - - - ..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Release\CVRLIB-NF.dll - - + + + + + + ..\..\VB.NET\CVRLIB\CVRLIB\bin\Debug\netstandard2.0\CVRLIB.dll + + + ..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Debug\CVRLIB-NF.dll + + + ..\HtmlFactory\HtmlFactory\bin\Debug\netstandard2.0\HtmlFactory.dll + + + + + + + ..\..\VB.NET\CVRLIB\CVRLIB\bin\Release\netstandard2.0\CVRLIB.dll + + + ..\..\VB.NET\CVRLIB-NF\CVRLIB-NF\bin\Release\CVRLIB-NF.dll + + + ..\HtmlFactory\HtmlFactory\bin\Release\netstandard2.0\HtmlFactory.dll + + + +