I have an MVC web app that was running just fine on .NET framework 4.6.1. I had a need to change the target framework to 4.7.1 or later so I chose 4.7.2.
I simply changed the Target Framework dropdown under the project properties and updated web.config as follows.
<compilation targetFramework="4.7.2" debug="true" />
I then ran Update-Package -Reinstall in Package Manager Console.
After doing so I now get the following runtime error:
System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Source= StackTrace:
This error is thrown on the var client line below
public static string getConnectionString(string secretName)
{
string kvURL = "https://blah_blah.vault.azure.net/";
var client = new SecretClient(new Uri(kvURL), new DefaultAzureCredential());
KeyVaultSecret cs = client.GetSecret(secretName);
return cs.Value;
}
I have verified the path under references does point to an actual System.Runtime.InteropServices.RuntimeInformation.dll file.
After everything I tried, I finally resorted to running devenv /ResetSkipPkgs from the command line. No change.
Can someone advise what may have gone wrong? Are there additional or different steps I should have taken to change to 4.7.2?