using AyCode.Interfaces.StorageHandlers; using BlazorAnimation; using Blazored.LocalStorage; using DevExpress.Blazor; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using System.Resources; using TIAMWebApp.Client; using TIAMWebApp.Client.Services; using TIAMWebApp.Shared.Application.Interfaces; using TIAMWebApp.Shared.Application.Services; using TIAMWebApp.Shared.Application.Utility; using AyCode.Services.Loggers; using System.Net; using Microsoft.AspNetCore.Components.Authorization; using TIAM.Models; using TIAM.Models.PageViewModels; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); builder.Services.AddLocalization(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddBlazoredLocalStorage(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); //WebSpecific builder.Services.AddScoped(); builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly)); builder.Services.AddSingleton(); builder.Services.AddSingleton(); //builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); builder.Services.AddAuthorizationCore(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddSingleton(); //builder.Services.AddScoped(); //WebSpecific end //AppDomain.CurrentDomain.FirstChanceException += (s, e) => //{ // Console.WriteLine("********** OMG! FirstChanceException **********"); // Console.WriteLine(e.Exception); //}; // //AppDomain.CurrentDomain.UnhandledException += (s, e) => //{ // Console.WriteLine("********** OMG! UnhandledException **********"); // Console.WriteLine(e.ExceptionObject.ToString()); //}; builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress), DefaultRequestVersion = HttpVersion.Version20, DefaultVersionPolicy = HttpVersionPolicy.RequestVersionOrHigher }); builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5); builder.Services.Configure(Guid.NewGuid().ToString(), c => { }); await builder.Build().RunAsync();