-
Notifications
You must be signed in to change notification settings - Fork 66
Use IHostApplicationBuilder for framework application to enable Aspire development #596
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1a381a0
Introduce HostedHttpApplication
twsouthwick 9cf1e9b
fix up
twsouthwick 11d6ada
use background thread
twsouthwick bf665bf
move some implementation into the lifetime
twsouthwick 96ff53c
use configuration
twsouthwick 43de310
unset application
twsouthwick 480f199
simplify API
twsouthwick 06e7376
fix logs
twsouthwick 6419dae
reorganize
twsouthwick 93bc211
revert change
twsouthwick 1cbd2ea
some more cleanup
twsouthwick e670691
fix
twsouthwick bf6ec0b
fix logging
twsouthwick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
samples/AuthRemoteFormsAuth/AuthRemoteFormsAuthCore/AuthRemoteFormsAuthCore.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Yarp.ReverseProxy" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\ServiceDefaults\Samples.ServiceDefaults.Core\Samples.ServiceDefaults.Core.csproj" /> | ||
| <ProjectReference Include="..\..\ServiceDefaults\Samples.ServiceDefaults.csproj" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,21 +4,27 @@ | |
| using System.Web.Optimization; | ||
| using System.Web.Routing; | ||
| using Microsoft.AspNetCore.SystemWebAdapters; | ||
| using Microsoft.AspNetCore.SystemWebAdapters.Hosting; | ||
| using Microsoft.Extensions.Configuration; | ||
| using Microsoft.Extensions.Hosting; | ||
|
|
||
| namespace FormsAuth | ||
| { | ||
| public class Global : HttpApplication | ||
| { | ||
| void Application_Start(object sender, EventArgs e) | ||
| protected void Application_Start() | ||
| { | ||
| SystemWebAdapterConfiguration.AddSystemWebAdapters(this) | ||
| .AddVirtualizedContentDirectories() | ||
| .AddProxySupport(options => options.UseForwardedHeaders = true) | ||
| .AddRemoteAppServer(options => | ||
| { | ||
| options.ApiKey = ConfigurationManager.AppSettings["RemoteApp__ApiKey"]; | ||
| }) | ||
| .AddAuthenticationServer(); | ||
| HttpApplicationHost.RegisterHost(builder => | ||
| { | ||
| builder.AddServiceDefaults(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One other typical thing that is done when you add aspire to an app is to call abb.MapDefaultEndpoints() which would get things like healthchecks working. That would obviously not go here but just mentioning it in case you want to add that as well. |
||
| builder.RegisterWebObjectActivator(); | ||
|
|
||
| builder.Services.AddSystemAdapters() | ||
| .AddVirtualizedContentDirectories() | ||
| .AddProxySupport(options => options.UseForwardedHeaders = true) | ||
| .AddRemoteAppServer(builder.Configuration.GetSection("RemoteApp").Bind) | ||
| .AddAuthenticationServer(); | ||
| }); | ||
|
|
||
| RouteConfig.RegisterRoutes(RouteTable.Routes); | ||
| BundleConfig.RegisterBundles(BundleTable.Bundles); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note that there are currently some issues people have reported around using Aspire with .NET 10. Typically most of these are during startup so if it's working well for you and things are booting up then it is likely you are not impacted.
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.
yeah, I was actually having issues in the repo with targeting net9.0-windows and net10.0-windows seems to work.