ServiceCollectionExtensions.cs should not use the core namespace #4410
-
It's generally considered bad practice to use namespaces within the core framework library when defining new types or extension methods. This is because there is a risk the framework introduces a type, interface, etc. of the same name causing a conflict with the custom library. The namespace in ServiceCollectionExtensions.cs should be changed to avoid using the Microsoft.Extensions.DependencyInjection namespace. I'm pretty sure there's a MS document that discusses this but I'm having difficulty locating it at the moment. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I remember the guidelines saying that DI extension methods should be in that exact namespace :) Anyway, that ship has sailed. |
Beta Was this translation helpful? Give feedback.
I remember the guidelines saying that DI extension methods should be in that exact namespace :) Anyway, that ship has sailed.