From 44a4dce334e896b89ad958f237a1b81cb916897a Mon Sep 17 00:00:00 2001 From: Alex Ghiondea Date: Thu, 21 Sep 2017 10:59:51 -0700 Subject: [PATCH] Create ServiceBase-doesnt-propagate-OnStart-exceptions.md (#483) * Create ServiceBase-doesnt-propagate-OnStart-exceptions.md * Update ServiceBase-doesnt-propagate-OnStart-exceptions.md * Update ServiceBase-doesnt-propagate-OnStart-exceptions.md * Update ServiceBase-doesnt-propagate-OnStart-exceptions.md * Update ServiceBase-doesnt-propagate-OnStart-exceptions.md --- ...ase-doesnt-propagate-OnStart-exceptions.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/compatibility/ServiceBase-doesnt-propagate-OnStart-exceptions.md diff --git a/Documentation/compatibility/ServiceBase-doesnt-propagate-OnStart-exceptions.md b/Documentation/compatibility/ServiceBase-doesnt-propagate-OnStart-exceptions.md new file mode 100644 index 0000000..16a391e --- /dev/null +++ b/Documentation/compatibility/ServiceBase-doesnt-propagate-OnStart-exceptions.md @@ -0,0 +1,40 @@ +## ServiceBase doesn't propagate OnStart exceptions + +### Scope + +Minor + +### Version Introduced + +4.7.1 + +### Source Analyzer Status + +NotPlanned + +### Change Description + +In the .NET Framework 4.7 and earlier versions, exceptions thrown on service startup are not propagated to the caller of . + +Starting with applications that target the .NET Framework 4.7.1, the runtime propagates exceptions to for services that fail to start. + +- [x] Quirked +- [ ] Build-time break + +### Recommended Action +On service start, if there is an exception, that exception will be propagated. This should help diagnose cases where services fail to start. + +If this behavior is undesirable, you can opt out of it by adding the following element to the section of your application configuration file: + +```xml + +``` + +If your application targets an earlier version than 4.7.1 but you want to have this behavior, add the following element to the section of your application configuration file: + +```xml + +``` + +### Affected APIs +* `M:System.ServiceProcess.ServiceBase.Run`