Skip to content
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

Document counterintuitive AddHostedService behavior #9141

Merged
merged 6 commits into from
Jul 28, 2023

Conversation

MichaelDeutschCoding
Copy link
Contributor

See dotnet/runtime#38751 for discussion about this issue.

Summary

Add documentation describing the behavior when multiple services (of the same class) are added when calling Microsoft.Extensions.DependencyInjection.IServiceCollection.AddHostedService<THostedService>.

@MichaelDeutschCoding MichaelDeutschCoding requested a review from a team as a code owner July 13, 2023 17:59
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jul 13, 2023
@ghost
Copy link

ghost commented Jul 13, 2023

Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection
See info in area-owners.md if you want to be subscribed.

Issue Details

See dotnet/runtime#38751 for discussion about this issue.

Summary

Add documentation describing the behavior when multiple services (of the same class) are added when calling Microsoft.Extensions.DependencyInjection.IServiceCollection.AddHostedService<THostedService>.

Author: MichaelDeutschCoding
Assignees: -
Labels:

area-Extensions-DependencyInjection, community-contribution

Milestone: -

@learn-build-service-prod
Copy link

Learn Build status updates of commit ecf55f2:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ❌Error Details

  • Line 0, Column 0: [Error: ECMA2Yaml_File_LoadFailed] Failed to load 1 files, aborting...

xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml

  • Line 0, Column 0: [Error: ECMA2Yaml_InternalError]
Intenal Several Error: System.Xml.XmlException: The ',' character, hexadecimal value 0x2C, cannot be included in a name. Line 72, position 268.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.Throw(Int32 pos, String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at ECMA2Yaml.ECMALoader.LoadType(FileItem typeFile)
   at ECMA2Yaml.ECMALoader.LoadTypes(String basePath, Namespace ns)

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit 671b5ae:

⚠️ Validation status: warnings

File Status Preview URL Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ⚠️Warning View Details

xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml

  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection.AddSingleton'.
  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection.AddSingleton'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit da969a3:

⚠️ Validation status: warnings

File Status Preview URL Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ⚠️Warning View Details

xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml

  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton'.
  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.Extensions.DependencyInjection.ServiceCollectionServiceExtensions.AddSingleton'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit 1bded2d:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ❌Error Details

  • Line 0, Column 0: [Error: ECMA2Yaml_File_LoadFailed] Failed to load 1 files, aborting...

xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml

  • Line 0, Column 0: [Error: ECMA2Yaml_InternalError]
Intenal Several Error: System.Xml.XmlException: Unexpected end of file while parsing CDATA has occurred. Line 128, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at ECMA2Yaml.ECMALoader.LoadType(FileItem typeFile)
   at ECMA2Yaml.ECMALoader.LoadTypes(String basePath, Namespace ns)

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
@learn-build-service-prod
Copy link

Learn Build status updates of commit 34bfecf:

❌ Validation status: errors

Please follow instructions here which may help to resolve issue.

File Status Preview URL Details
❌Error Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ❌Error Details

  • Line 0, Column 0: [Error: ECMA2Yaml_File_LoadFailed] Failed to load 1 files, aborting...

xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml

  • Line 0, Column 0: [Error: ECMA2Yaml_InternalError]
Intenal Several Error: System.Xml.XmlException: Unexpected end of file while parsing CDATA has occurred. Line 128, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos)
   at System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type)
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at ECMA2Yaml.ECMALoader.LoadType(FileItem typeFile)
   at ECMA2Yaml.ECMALoader.LoadTypes(String basePath, Namespace ns)

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit 0b74fd7:

✅ Validation status: passed

File Status Preview URL Details
xml/Microsoft.Extensions.DependencyInjection/ServiceCollectionHostedServiceExtensions.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @MichaelDeutschCoding for the contribution and thank you @gewarren for review.

@buyaa-n buyaa-n merged commit 4c356d0 into dotnet:main Jul 28, 2023
2 checks passed
@MichaelDeutschCoding
Copy link
Contributor Author

Thanks so much for correcting and finishing this for me.

@MichaelDeutschCoding MichaelDeutschCoding deleted the patch-1 branch July 31, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Extensions-DependencyInjection community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants