Elban
Elban
CC#
Created by Elban on 11/18/2024 in #help
csc.exe takes 140 Seconds to build one specific Project
this here is from dotnet build -bl
18> 17 ms CallTarget 3 calls
18> 17 ms CheckForDuplicateItems 3 calls
18> 26 ms GenerateDepsFile 1 calls
18> 34 ms ResolvePackageFileConflicts 1 calls
18> 54 ms MSBuild 4 calls
18> 244 ms ResolveAssemblyReference 1 calls
18> 143783 ms Csc 1 calls
18> 17 ms CallTarget 3 calls
18> 17 ms CheckForDuplicateItems 3 calls
18> 26 ms GenerateDepsFile 1 calls
18> 34 ms ResolvePackageFileConflicts 1 calls
18> 54 ms MSBuild 4 calls
18> 244 ms ResolveAssemblyReference 1 calls
18> 143783 ms Csc 1 calls
the csc took 140ms to build a specific project, while other projects run fine it has no special dependencies and analyzer, it only has LoggerMessage Source Generator How can I debug what takes so long to build?
4 replies
CC#
Created by Elban on 11/15/2023 in #help
.NET 8 Wasm/Server Browser Error
After Updating my old Wasm/Server Side hosting model to the new .NET 8 included one I get errors I can't debug: Browser Error: Uncaught (in promise) Error: Failed to start platform. Reason: TypeError: Cannot read properties of undefined (reading 'AspNetCore') at ei (blazor.web.js:1:163657) My Server Middlewares and maps:
//--------------------------------------------------------------------------------------
// Application Startup Configuration (Middleware, Routing, ...)
//--------------------------------------------------------------------------------------

WebApplication app = builder.Build();

if (!swaggerOnly)
{
UseEnviromentBasedMiddlewares(app);
}

app.UseHttpsRedirection()
.UseExceptionHandler()
.UseSwaggerMiddleware(useSwaggerUI: app.Environment.IsDevelopment())
.UseStaticFiles()
.UseSerilogRequestLogging()
.UseRouting()
.UseAntiforgery()
.UseMentionAuthentication()
.UseOutputCache()
.UseConnectionStringWaiter()
.UseRequestLocalization()
.UseUserFactory();

app.MapRazorComponents<Pages.Host>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Client.Program).Assembly)
.AllowAnonymous();

app.MapAuthenticationEndpoints()
.MapLoggingEndpoints()
.MapMentionUserEndpoint()
.MapLicenceEndpoints()
.MapModuleEndpoints();

app.Run();
//--------------------------------------------------------------------------------------
// Application Startup Configuration (Middleware, Routing, ...)
//--------------------------------------------------------------------------------------

WebApplication app = builder.Build();

if (!swaggerOnly)
{
UseEnviromentBasedMiddlewares(app);
}

app.UseHttpsRedirection()
.UseExceptionHandler()
.UseSwaggerMiddleware(useSwaggerUI: app.Environment.IsDevelopment())
.UseStaticFiles()
.UseSerilogRequestLogging()
.UseRouting()
.UseAntiforgery()
.UseMentionAuthentication()
.UseOutputCache()
.UseConnectionStringWaiter()
.UseRequestLocalization()
.UseUserFactory();

app.MapRazorComponents<Pages.Host>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Client.Program).Assembly)
.AllowAnonymous();

app.MapAuthenticationEndpoints()
.MapLoggingEndpoints()
.MapMentionUserEndpoint()
.MapLicenceEndpoints()
.MapModuleEndpoints();

app.Run();
my Client program.cs:
private static async Task Main(string[] args)
{
WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.Logging.Services.AddCriticalLoggingProvider(builder.HostEnvironment.BaseAddress);

AddBlazorFrameworkSpecificServices(builder.Services);
AddHttpClientServices(builder.Services, builder.HostEnvironment.BaseAddress, (sp, handlers) =>
{
handlers.Add(sp.GetRequiredService<HostNameMessageHandler>());
});

AddServices(builder.Services);

WebAssemblyHost app = builder.Build();

await SetBlazorCultureAsync(app.Services);

await app.RunAsync();
}
private static async Task Main(string[] args)
{
WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.Logging.Services.AddCriticalLoggingProvider(builder.HostEnvironment.BaseAddress);

AddBlazorFrameworkSpecificServices(builder.Services);
AddHttpClientServices(builder.Services, builder.HostEnvironment.BaseAddress, (sp, handlers) =>
{
handlers.Add(sp.GetRequiredService<HostNameMessageHandler>());
});

AddServices(builder.Services);

WebAssemblyHost app = builder.Build();

await SetBlazorCultureAsync(app.Services);

await app.RunAsync();
}
2 replies