-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sample of integrating client apps (WinForms & WPF) into an Aspire app #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samples/ClientAppsIntegration/ClientAppsIntegration.WinForms/MainForm.Designer.cs
Show resolved
Hide resolved
@timheuer it's concerning that you're getting an error on the dashboard. Do the other samples work OK for you? |
Yep just this one, starter and others work fine |
@timheuer Can you get the exception/stack? |
@timheuer it just started showing up for me too! Not sure what changed... |
|
going to test a really dumb theory here...rebooting... |
theory failed -- I had two pending security updates and was randomly thinking they could be messing with crypto store |
@timheuer I just did a |
FWIW no change for me. I am maybe on diff SDK build and have been having some issues, so likely environment for me. |
internal static class Program | ||
{ | ||
[STAThread] | ||
public static void Main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static void Main() | |
public static async Task Main() |
appHost.Start(); | ||
app.Run(mainWindow); | ||
|
||
appHost.StopAsync().GetAwaiter().GetResult(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appHost.StopAsync().GetAwaiter().GetResult(); | |
await appHost.StopAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The main entry point for the application. | ||
/// </summary> | ||
[STAThread] | ||
static void Main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static void Main() | |
static async Task Main() |
ApplicationConfiguration.Initialize(); | ||
Application.Run(ActivatorUtilities.CreateInstance<MainForm>(app.Services)); | ||
|
||
app.StopAsync().GetAwaiter().GetResult(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app.StopAsync().GetAwaiter().GetResult(); | |
await app.StopAsync(); |
...s/ClientAppsIntegration/ClientAppsIntegration.WinForms/ClientAppsIntegration.WinForms.csproj
Show resolved
Hide resolved
samples/ClientAppsIntegration/ClientAppsIntegration.AppDefaults/Extensions.cs
Outdated
Show resolved
Hide resolved
samples/ClientAppsIntegration/ClientAppsIntegration.Web/ClientAppsIntegration.Web.csproj
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
… app (dotnet#78) * Add client apps (WinForms & WPF) integration sample
Adds a sample of integrating client apps (WinForms & WPF for now but can be extended with MAUI, etc. at any point) into an Aspire app.
It adds an "AppDefaults" library project that is a more general version of the usual "ServiceDefaults" project, e.g. ASP.NET Core specific defaults aren't included, like endpoints, kestrel metrics, etc. The "ServiceDefaults" project is refactored to depend on the "AppDefaults" project and extend it. The client apps reference the "AppDefaults" project and the web apps reference the "ServiceDefaults" project as usual. This is something we could consider formalizing in our default experience.
The client app projects are added as a
ProjectReference
to the AppHost project but as they target an incompatible TFM (net8.0-windows
) they're configured to not reference the output assembly and to skip TFM checking. That then requires the projects are added to theDistributedApplicationBuilder
via the project path, as the project metadata type is not generated.