Closed fabriciomurta closed 2 years ago
Trying to convert Startup.cs + Program.cs into ASP.NET 6 new hosting model resulted in the exact same exception above.
The following Program.cs
file, based on the dotnet new extnet
template, tries to use the new, simplified hosting model and should be mostly compatible with the previous model:
using Ext.Net;
using Ext.Net.Core;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace _20220208_en7an6
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddExtNet();
builder.Services.AddExtCharts();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
//app.UseHsts();
}
app.UseExtNetResources(config =>
{
if (app.Environment.IsDevelopment())
{
config.UseDebug(true);
}
config.UseEmbedded();
config.UseCharts();
config.UseThemeSpotless();
});
app.UseExtNetLocalization();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseExtNet(config =>
{
config.Theme = ThemeKind.Spotless;
});
app.MapRazorPages();
app.Run();
}
}
}
Is there any updates on this? .NET 5 is EOL on May 8th 2022
@harvca We are working on .NET 6 support right now. With some luck, a v7.3.0
release that adds .NET 6 support will be available soon.
We have just published Ext.NET 7.3.0-preview to NuGet. Please let us know if you run into any problem using it!
And 7.3.0 final is released. This issue should be deemed as fixed. ASP.NET 6 support is implemented.
Ext.NET forums' thread: .NET 6
It looks like Ext.NET 7 cannot be targetted to ASP.NET 6 website projects, at least as far as the default project provided by Ext.NET templates is set up.
We should either create a new ASP.NET 6 compatible template for Ext.NET 7 or completely upgrade Ext.NET 7 to support ASP.NET 6.
The issue raised when the project is targetted to ASP.NET 6. Build succeeds but upon the first request to an Ext.NET powered website, the following exception is triggered:
The exception is not displayed at the page because of how Ext.NET intercepts and handles page output, so only a blank page is returned and the following warning is also logged to the
dotnet run
command output:One possible solution is review
startup.cs
to properly initialize Ext.NET for this version. Removing theWestwind.AspNetCore.LiveReload
didn't improve the situation.