Closed
Description
Steps to reproduce
Install the Microsoft.Extensions.DependencyModel
package into a UWP project and add a code like this:
var supported = DependencyContext.Default != null;
Run in Release mode (i.e. with .NET Native enabled)
Expected behavior
The supported
variable should be false
.
Actual behavior
System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Func`3.EndInvoke(IAsyncResult result) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\Modules\RuntimeModule.cs:line 75
at Microsoft.Extensions.DependencyModel.DependencyContextLoader.GetDepsJsonPath(Assembly assembly)
at Microsoft.Extensions.DependencyModel.DependencyContextLoader.LoadAssemblyContext(Assembly assembly, IDependencyContextReader reader)
at Microsoft.Extensions.DependencyModel.DependencyContextLoader.Load(Assembly assembly)
at Microsoft.Extensions.DependencyModel.DependencyContext.LoadDefault()
at System.Func`1.InvokeOpenStaticThunk()
at System.Func`1.Invoke()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\shared\System\Lazy.cs:line 330
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\shared\System\Lazy.cs:line 348
Environment data
Package version 2.1.0