Open
Description
Issue moved from dotnet/docs#18729
- Please respond to @mc0re.
From @mc0re on Monday, June 1, 2020 5:47:26 PM
The following code runs fine without Native compilation, but fails with it. What do I miss?
var services = new ServiceCollection();
services
.AddAutoMapper(typeof(DtoMappingProfile))
.AddLogging(configure => configure.AddSerilog(dispose: true))
.AddSingleton<IHashCalculator, HashCalculator>()
.AddSingleton<IMyHttpClient, MyHttpClient>()
.AddSingleton<IPropertySet>(ApplicationData.Current.LocalSettings.Values)
;
// This is a field in the page class
mServices = services.BuildServiceProvider();
ActivatorUtilities.CreateInstance<AuthViewModel>(mServices)
AuthViewModel
has the following contructor:
public AuthViewModel(IMyHttpClient client, IPropertySet settings)
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 010e4a46-847d-169c-0945-4c81eb073fa7
- Version Independent ID: 1fee9ab9-4ca3-0c4e-0c52-e7be3ea3e62d
- Content: APIs That Rely on Reflection - UWP applications
- Content Source: windows-apps-src/dotnet-native/apis-that-rely-on-reflection.md
- Product: uwp
- Technology: platform
- GitHub Login: @mcleanbyron
- Microsoft Alias: mcleans