Граф коммитов

69 Коммитов

Автор SHA1 Сообщение Дата
David Fowler cfe9b26a34
Added support for generic host based IWebHostBuilder (#1580)
- This adds an implementation of IWebHostBuilder as a facade over the IHostBuilder.
This removes the 2 container issue by executing the Startup.ConfigureServies and Startup.ConfigureContainer inline as part of building the IHostBuilder.
- The implementation is highly compatible implementation since it exposes the same IWebHostBuilder interface.
Existing extensions mostly work.
- There are some caveats with this approach.
    - Injecting services into Startup is not extremely constrained to the
    services availble on HostBuilderContext. This includes the IHostingEnvironment
    and the IConfiguration.
    - IStartup is broken when using this pattern because it isn't composable.
    - The IStartupConfigureServicesFilter and IStartupConfigureContainer The before
    and after filters added in 2.1 are also broken  because there's a single container (it could maybe be fixed by downcasting and doing something specific on the GenericHostBuilder instance).
    - Calling into IWebHostBuilder.Build will throw a NotSupportedException since
    this implementation is just a facade over the IHostBuilder.
2018-11-13 21:22:30 -08:00
Luke Latham ba88bdfd5e Move AddCommandLine in SampleStartups (#1449) 2018-06-06 15:25:31 -07:00
Luke Latham 0b6dbab37a Using block in the externally controlled example (#1422) 2018-05-16 07:26:55 -07:00
Ryan Brandenburg 38f691c09e Upgrade to netcoreapp22 (#1410) 2018-05-08 11:02:12 -07:00
Chris Ross (ASP.NET) bfc12fd6ac Merge branch 'release/2.1' into dev 2018-05-01 14:09:36 -07:00
Chris Ross (ASP.NET) 2c1376c95f Add a AddHostedService extension #1402 2018-05-01 14:07:24 -07:00
Marcin Polewski e9b84a298a Sample generic host using MSMQ (#1381) 2018-04-30 11:08:20 -07:00
Chris Ross (ASP.NET) 4e1ba2a6c7 Delay process exit in ConsoleLifetime #1329 2018-04-12 10:07:44 -07:00
Chris Ross (ASP.NET) 05d1a6eb0e Refactor Generic Host lifetimes to work better with ServiceBase #1347 2018-03-23 12:02:44 -07:00
Pranav K adf2f37ad2 Update samples and tests to target netcoreapp2.1 2017-11-13 17:10:46 -08:00
Nate McMaster c5f2333481 Pin tool and package versions to make build more repeatable 2017-10-31 13:04:32 -07:00
Chris Ross 253be73b6f Misc generic host pr feedback (#1222) 2017-09-21 15:09:52 -07:00
David Fowler 712c992ca8 Add BackgroundService, a base class for long running HostedServices (#1215)
* Add BackgroundService, a base class for long running HostedServices
- Today the IHostedService pattern is a StartAsync/StopAsync pattern. Neither of these
methods are supposed to return a long running task that represents an execution. If
you wanted to have some logic run on a timer every 5 minutes, it's unnatural to do so
with simple async idioms. This base class implements IHostedService and exposes
a pattern where a long running async Task can be returned.
- The token passed into ExecuteAsync represents the lifetime of the execution.
- StartAsync and StopAsync were made virtual to allow the derived type to
indicate Start failures.
- Added tests
2017-09-18 12:55:54 -07:00
Chris Ross (ASP.NET) ae9da9290e #1163 Implement the generic host 2017-09-14 14:48:06 -07:00
Nate McMaster 5ca9f8928f Use PackageLineup to manage PackageReference versions 2017-08-29 09:55:55 -07:00
Nate McMaster 9a4a43cc6a Use Directory.Build.props/targets 2017-08-29 09:52:04 -07:00
Eric 9b1cbedffc WebSocketClient.ConnectAsync throws when the provided CancellationToken is cancelled. 2017-08-24 15:14:59 -07:00
Ryan Brandenburg 7ca5002b4c Remove NETSTandard.Library.NETFramework 2017-07-07 10:27:25 -07:00
Kristian Hellang 513f6ac816 Avoid having to return anything in StartupBase.ConfigureServices (#957)
* Implement IStartup explicitly so we don't have to return a service provider
* Inherit StartupBase and override CreateServiceProvider
2017-06-23 08:48:06 -07:00
John Luo 62cd07d0a6 Target NETStandard2.0 and add WindowsServices back 2017-05-19 14:17:02 -07:00
Hisham Bin Ateya cf23aedb55 Use EnvironmentName instead of magic string (#1065) 2017-05-10 15:20:40 -07:00
John Luo 9b80f2a635 Migration 2017-05-05 17:12:36 -07:00
Chris R 8377d226f1 Execute IHostingStart instances in the primary assembly (#1033)
* #1000 Execute IHostingStart instances in the primary assembly
Also make the sample app runnable.
Add an opt-out flag, more tests
2017-04-25 07:30:11 -07:00
Chris R 62f74d5be0 #947 Add IServer.StopAsyc, IWebHost.StopAsync, and make Start async 2017-04-12 21:56:19 -07:00
Pranav K 31a2bdffce Remove net451 as a cross-compile target 2017-03-24 11:45:47 -07:00
Kiran Challa 7124247b50 Converted test projects and samples to run on netcoreapp2.0 2017-03-21 13:55:12 -07:00
Nate McMaster 45874704a9 Unify dependency version to one file and remove workarounds 2017-03-15 11:01:09 -07:00
Nate McMaster 2a50762008 Upgrade to VS 2017 2017-02-01 10:35:51 -08:00
Pranav K 21f7c89838 Updating versions to 1.2.0-* 2016-11-09 14:17:46 -08:00
Pranav K d0e8c4dd4c Updating to netcoreapp1.1 2016-10-13 11:17:42 -07:00
Pranav K edc36547a7 Revert "Updating to netcoreapp1.1"
This reverts commit 72114ca4fa.
2016-10-12 16:08:39 -07:00
Pranav K 72114ca4fa Updating to netcoreapp1.1 2016-10-12 13:45:24 -07:00
Doug Bunting 9a03b504ef One build to rule them all
- well, at least VS and command-line builds will share output
- part of aspnet/Coherence-Signed#277
2016-07-07 11:59:39 -07:00
Pranav K ef0de2b6e7 Updating to dev versions 2016-06-16 10:17:56 -07:00
jacalvar 525b9251df Remove unnecesary imports 2016-06-08 14:58:21 -07:00
David Fowler c5e8120e39 Remove UseServer(string) overload
- Removed the overload that takes a string because it's broken

#731
2016-05-20 21:55:26 -07:00
John Luo 9479f0910a Merge branch 'release' into dev 2016-04-27 14:04:41 -07:00
John Luo e505ecbc21 #700 #727 Add environment variables by default and remove UseDefaultHostingConfiguration 2016-04-27 11:40:22 -07:00
David Fowler 8f5f8d28d0 This change introduces a new service `IStartup` that can be registered in the hosting container to override any startup logic. `UseStartup` overloads have been changed to detect `IStartup` and directly put it in the container, or to wrapping it with a `ConventionBasedStartup` implementation to preserve the existing behavior.
- Remove IStartupLoader and add `IStartup` instead that matches the signature hosting cares about
- Moved `UseStartup` to extension methods
- Move existing logic into `ConventionBasedStartup` class
2016-04-18 21:33:03 -07:00
Pavel Krymets 622d6b006f Migrate tests, tools and samples to portable 2016-04-14 15:18:02 -07:00
John Luo fb036a4e3a Update samples TFM 2016-03-25 17:30:52 -07:00
John Luo 312192b447 WebHostBuilder extensions rename and documentation. #636 #648 2016-03-22 16:27:28 -07:00
John Luo 5ac589317f Additional fiels in HostingEnvironment and Renames
- Added ApplicationName, ContentRootPath and ContentRootFileProvider
- Removed Configuration
- Removed MapPath
2016-03-14 16:21:56 -07:00
Doug Bunting 5e11093127 Remove project name from output path
- aspnet/Coherence-Signed#187
- remove `<RootNamespace>` settings but maintain other unique aspects e.g. `<DnxInvisibleContent ... />`
- in a few cases, standardize on VS version `14.0` and not something more specific
2016-03-02 18:49:26 -08:00
N. Taylor Mullen 57371e5c9c Transition to netstandard.
- dotnet5.X => netstandard1.y (where y = x-1).
- DNXCore50 => netstandardapp1.5.
- Applied the same changes to ifdefs.
2016-03-01 13:32:58 -08:00
John Luo 8e94d40688 Updating to new CLI 2016-02-01 19:11:00 -08:00
N. Taylor Mullen e62ceb8528 Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:21:40 -08:00
John Luo cad9ea1df7 Rename WebApplication to WebHost 2016-01-17 15:31:29 -08:00
David Fowler e72924796e More hosting API changes
- Added IWebApplicationBuilder and moved it to Hosting.Abstractions as a
target for others to extend the web application builder.
- Made methods extension methods where possible
- Added UseUrls
2016-01-06 21:09:33 -08:00
David Fowler 46e3e25ec7 Add the ability to set the IApplicationEnvironment.ApplicationBasePath
- Added UseApplicationBasePath which sets the base path (used for views
and static files)
2016-01-04 17:43:23 -08:00