From 9edf578d071e373a446969399495e12e790f3504 Mon Sep 17 00:00:00 2001 From: Brian Hall Date: Tue, 14 Mar 2017 15:35:11 -0400 Subject: [PATCH] Add troubleshooting tip for `System.TypeLoadException` (#2969) * Add troubleshooting tip for `System.TypeLoadException` When running AspNet Core 1.1 on top of .NET 4.6.2 and trying to use the Azure Key Vault configuration extensions, I was encountering an exception that was being thrown for `System.TypeLoadException`. I discovered this originated from the use of the Azure Key Vault API and how it interacted with an older (built-in) version of `System.Net.HTTP`. I ended up installing the updated NuGet package for `System.Net.Http` and that fixed the issue. Hopefully this proposed tip will help someone in the future. Or at least until the packages get more aligned. * Update key-vault-configuration.md --- aspnetcore/security/key-vault-configuration.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aspnetcore/security/key-vault-configuration.md b/aspnetcore/security/key-vault-configuration.md index b0aacc7f6a..3b08136f18 100644 --- a/aspnetcore/security/key-vault-configuration.md +++ b/aspnetcore/security/key-vault-configuration.md @@ -140,6 +140,9 @@ When the application fails to load configuration using the provider, an error me * The Azure AD Key (`ClientSecret`) is expired. * The configuration key (name) is incorrect in the app for the value you're trying to load. +`System.TypeLoadException` exception during startup using `.NET 4.6.x`: +* Add a NuGet reference to the package for `System.Net.Http` version 4.3.1 or later. + ## Additional resources * * [Microsoft Azure: Key Vault](https://azure.microsoft.com/services/key-vault/)