Unity.Microsoft.DependencyInjection
2.0.2
Prefix Reserved
See the version list below for details.
dotnet add package Unity.Microsoft.DependencyInjection --version 2.0.2
NuGet\Install-Package Unity.Microsoft.DependencyInjection -Version 2.0.2
<PackageReference Include="Unity.Microsoft.DependencyInjection" Version="2.0.2" />
paket add Unity.Microsoft.DependencyInjection --version 2.0.2
#r "nuget: Unity.Microsoft.DependencyInjection, 2.0.2"
// Install Unity.Microsoft.DependencyInjection as a Cake Addin #addin nuget:?package=Unity.Microsoft.DependencyInjection&version=2.0.2 // Install Unity.Microsoft.DependencyInjection as a Cake Tool #tool nuget:?package=Unity.Microsoft.DependencyInjection&version=2.0.2
Get Started
- Reference the
Unity.Microsoft.DependencyInjection
package from NuGet.
Install-Package Unity.Microsoft.DependencyInjection
Registration:
- In the
WebHostBuilder
addUseUnityServiceProvider(...)
method
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUnityServiceProvider() <---- Add this line
.UseStartup<Startup>()
.Build();
- In case Unity container configured via application configuration or by convention this container could be used to initialize service provider.
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUnityServiceProvider(_container) <---- or add this line
.UseStartup<Startup>()
.Build();
- Add optional method to your
Startup
class
public void ConfigureContainer(IUnityContainer container)
{
// Could be used to register more types
container.RegisterType<IMyService, MyService>();
}
Examples
For example of using Unity with Core 2.0 Web application follow this link
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 2.0.0)
- Unity.Abstractions (>= 3.1.2)
- Unity.Container (>= 5.5.5)
NuGet packages (18)
Showing the top 5 NuGet packages that depend on Unity.Microsoft.DependencyInjection:
Package | Downloads |
---|---|
Microsoft.Skype.Bots.Media
The Microsoft Real-time Media Platform enables bots to interact with Skype and Microsoft Teams calls and Microsoft Teams meetings using real-time voice, video and screen sharing. This is an advanced capability which allows the bot to send and receive voice and video content frame by frame. The bot has "raw" access to the voice, video and screen sharing media streams. |
|
IFramework.DependencyInjection.Unity
Package Description |
|
Zero.Foundation
Package Description |
|
Sels.Core.Unity
Uses the Unity IoC container to implement abstractions in Sels.Core. Used by projects maintained here: https://github.com/Jenssels1998 |
|
PSFiddle.Common
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Unity.Microsoft.DependencyInjection:
Repository | Stars |
---|---|
danielpalme/IocPerformance
Performance comparison of .NET IoC containers
|
|
Particular/docs.particular.net
All content for ParticularDocs
|
Version | Downloads | Last updated |
---|---|---|
5.11.5 | 3,172,096 | 12/12/2019 |
5.11.4 | 12,631 | 12/8/2019 |
5.11.3 | 13,657 | 12/8/2019 |
5.11.2 | 2,284 | 12/8/2019 |
5.11.1 | 34,874 | 12/6/2019 |
5.11.0 | 8,768 | 12/6/2019 |
5.10.2 | 485,851 | 4/10/2019 |
5.10.1 | 40,788 | 3/23/2019 |
5.10.0 | 61,344 | 3/18/2019 |
5.9.2 | 16,425 | 3/2/2019 |
5.9.1 | 12,980 | 2/6/2019 |
5.9.0 | 17,977 | 1/23/2019 |
2.1.3 | 194,769 | 12/9/2018 |
2.1.2.1 | 53,933 | 12/4/2018 |
2.1.1 | 60,219 | 8/29/2018 |
2.1.0 | 3,533 | 8/25/2018 |
2.0.12 | 1,154 | 8/24/2018 |
2.0.11 | 1,141 | 8/22/2018 |
2.0.10 | 197,677 | 3/27/2018 |
2.0.9 | 4,328 | 3/4/2018 |
2.0.8 | 1,706 | 3/4/2018 |
2.0.7 | 1,252 | 3/1/2018 |
2.0.6 | 2,557 | 1/29/2018 |
2.0.5 | 1,305 | 1/23/2018 |
2.0.4 | 1,268 | 1/23/2018 |
2.0.3 | 1,053 | 1/23/2018 |
2.0.2 | 1,365 | 1/11/2018 |
2.0.1 | 1,350 | 1/10/2018 |
2.0.0 | 1,685 | 1/9/2018 |
1.0.1 | 9,486 | 1/5/2018 |
1.0.0 | 2,687 | 1/4/2018 |
This package is distributed as .NET Standard 2.0 package. It is compatible with Microsoft.Extensions.DependencyInjection v2 specification.