Closed GitHubPang closed 3 years ago
According to the official doc: https://docs.microsoft.com/en-us/dotnet/api/system.activator.createinstance For all overloads of the Activator.CreateInstance() method, the string assemblyName parameter can be null.
Activator.CreateInstance()
string assemblyName
null
If assemblyName is null, the executing assembly is searched.
assemblyName
This is true for all versions (.NET 5, .NET Core, .NET Framework).
Source code also says so: https://github.com/dotnet/runtime/blob/11cd2721a9bb3fe0c21e20979a3e670f61e3507d/src/libraries/System.Private.CoreLib/src/System/Activator.RuntimeType.cs#L120-L123
According to the official doc: https://docs.microsoft.com/en-us/dotnet/api/system.activator.createinstance For all overloads of the
Activator.CreateInstance()
method, thestring assemblyName
parameter can benull
.This is true for all versions (.NET 5, .NET Core, .NET Framework).
Source code also says so: https://github.com/dotnet/runtime/blob/11cd2721a9bb3fe0c21e20979a3e670f61e3507d/src/libraries/System.Private.CoreLib/src/System/Activator.RuntimeType.cs#L120-L123