kohwahskee
kohwahskee
Explore posts from servers
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
No description
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
Yea it will always be hosted locally from the WPF
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
At this point im pretty positive it has somethign to do with asp.net url and path NotLikeThis
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I feel like im just glossing over some weird configurations. It has to be way simpler than that
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
this is so confusing
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
Almost as if it doesn't recognize controllers when i start the server from my WPF app NotLikeThis
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I got it to work, but i have to copy the Controllers folder from my asp.net to my WPF
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
Oh..my...
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
👍
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
i can publish it, i dont mind
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I got it to display the react app properly now, but now im running into some weird problems with the api, again because of the proxy stuff suffer
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
The problem is, i think, it's doing some proxy server stuff that i dont understand, and since i didnt have the launchSettings.json file in the WPF project, when i go to the address it doesn't do anything
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I think it'd still work, i just need to do all the configurations in the asp.net project and have a method to start the server and use that in the WPF project. Something like this: ASPNET:
public static class AspNetServer
{
public static WebApplication CreateWebApplication()
{
var builder = WebApplication.CreateBuilder();

builder.Services.AddControllersWithViews();
builder.Services.AddSingleton<Automator>();

var app = builder.Build();

app.UseHttpsRedirection();

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseRouting();

app.MapFallbackToFile("index.html");
app.MapControllers();

return app;
}

public static void StartServer()
{
CreateWebApplication().Run();
}
}
public static class AspNetServer
{
public static WebApplication CreateWebApplication()
{
var builder = WebApplication.CreateBuilder();

builder.Services.AddControllersWithViews();
builder.Services.AddSingleton<Automator>();

var app = builder.Build();

app.UseHttpsRedirection();

app.UseDefaultFiles();
app.UseStaticFiles();
app.UseRouting();

app.MapFallbackToFile("index.html");
app.MapControllers();

return app;
}

public static void StartServer()
{
CreateWebApplication().Run();
}
}
WPF:
protected override async void OnStartup(StartupEventArgs e)
{
AspNetServer.StartServer();
var mainWindow = ServiceProvider.GetRequiredService<MainWindow>();
mainWindow.Show();
}
protected override async void OnStartup(StartupEventArgs e)
{
AspNetServer.StartServer();
var mainWindow = ServiceProvider.GetRequiredService<MainWindow>();
mainWindow.Show();
}
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
But i already had an entire ASP .NET with React that i built seperately and i didnt know how to integrate that into my new WPF app
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
@🎄Fizbanbuzz 🎄No no the example you gave me worked, in the sense that if i go to the address, it will responds with Hello World
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I think because it needs to do some redirect stuff
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
I didn't know I needed a launchSettings.json in my WPF app
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
@🎄Fizbanbuzz 🎄@ZZZZZZZZZZZZZZZZZZZZZZZZZI finally figured out why i couldnt get it to work no matter what
67 replies
CC#
Created by kohwahskee on 11/23/2023 in #help
How to integrate ASP .NET project in a WPF app?
No description
67 replies