Greetings sorry to trouble you…
is there a sample 2022 WiseJ-4 .NET CORE solution example. OR SOMETHING !? ANYTHING ? !
As I walk through several attempts to set up a NEW solution under WiseJ 4 .NET Core
the odd nuance differences between a regular Windows .NET Core solution
and the Wisej-4 keep tripping me up.
From the hosting model .NET 8 Minimal Hosting, versus Classic Hosting and
the myriad of potentially required supporting files to just initialize the environment,
program file, Startup.cs, launchSettings.json, SessionStartup.cs, Default.json.
I have implemented .NET CORE apps previously but from what I have tested thus far, refreshing
my memory on proper startup initialization of a pure .NET CORE app has enough differences from
initializing a new WiseJ-4 .NET CORE solution that it would bnot be beneficial.
The Stupid AI’s keep pulling up deprecated methods and properties not available in the current
version EXAMPLES:
Key points so far:
We are abandoning the Minimal Hosting Model for Wisej 4 on .NET 8.
Wisej 4 does not have AddWisej(), because it’s not an ASP.NET Core extension package. All necessary wiring is already in the Wisej 4 NuGet.
The proper setup is via Startup.cs that Wisej generates in the template. That file handles all Wisej middleware and bootstrap automatically.
Any EF Core services or other ASP.NET Core services are added alongside Wisej, not via services.AddWisej().
What this means for our Startup.cs
Do not call services.AddWisej().
The ConfigureServices in your Wisej project template already provides the needed services for Wisej.
You only add your own services (EF Core DbContext, logging, etc.) into ConfigureServices.
Example minimal Startup.cs snippet from a real Wisej 4 Web App template:
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
// Wisej services are already wired by the template – nothing to add here for Wisej itself
// Example: EF Core registration
services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString(“DefaultConnection”)));
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
// Wisej automatically handles routing/middleware
app.UseWisej(); // this comes from Wisej template
// Optional ASP.NET Core middleware
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
✅ So the rule moving forward:
Keep Startup.cs as generated by Wisej.
Do not invent AddWisej() or similar.
Only add your own services inside ConfigureServices (like EF Core).
The Program.cs change we discussed is still valid — switch from Minimal
Hosting to classic UseStartup<Startup>().
If you want, the next step is to integrate EF Core cleanly into this existing
Wisej Startup.cs without breaking anything, so we can confirm the page loads first.
Do you want to go there next?
You said:
no lets get back on numberd track #2 2️⃣ Check launchSettings.json
ChatGPT said:
Perfect — let’s focus step 2: launchSettings.json.
This file controls how IIS Express or Kestrel launches your app.
Even if IIS Express says “running,” a misconfigured URL or port can prevent the page from loading.
1️⃣ Location
launchSettings.json is usually under:
blah,blah,blah.
By the time I make ANY progress the AI has “forgotten” the initial Parameters / constraints and starts
giving me erroneous info as if it “forgot” we need to use
SPECIAL WiseJ required hosting model Classic Hosting versus .NET 8 Minimal Hosting or whatever
Soo Confused ..
the designers open to allow me to toss a few controls on them to view anything
on the default page once loaded
Create a blank new Wisej-4 project using the provided templates. It will create a sample for you with a couple of clicks. There are also dozens of samples in github.
This is a typical startup.cs with app.UseWisej();
https://github.com/iceteagroup/wisej-examples/blob/4.0/MDIExample/MDIExample/Startup.cs
In your solution there is no main method, the launchsettings doesn’t have true for launching the browser, the start url is wrong, there is no call to app.Run(), the web.config is setup incorrectly for IIS instead of Kestrel (see comments in the one we provide). It doesn’t work with asp.net core regardless of wisej.net. If you copy the correct startup method it will work. We provide everything you need to make it work correctly.
https://dotnettutorials.net/lesson/asp-net-core-main-method/
https://stackify.com/how-to-deploy-asp-net-core-to-iis/ <– this works only when deploying in IIS, doesn’t work with Kestrel. This is all standard asp.net core.
Wisej is a .NET Core middleware, which is typically added using UseWisej() (not AddWisej).
Create a new project using the provided templates and attach a new blank Wisej 4 project (without net48) that runs and opens a simple page with a label and a button. Look at the running project to see the setup, which is all standard net core and asp.net core.