0
votes

I've got an ASP.NET Web project open in Visual Studio 2015. I right click, and select "Configure Azure AD Authentication". I get the following error:

The Connected Services component 'Azure AD Authentication' failed: (HRESULT:0x80131509) Could not resolve mscorlib for target framework '.NETFramework,Version=v4.5'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.

I'm running Windows 10, so I tried changing the project's target framework to 4.6, but I got a similar error. I also went to Windows Features and ensured that I had all of the .NET checkboxes installed.

1
Vivek, to help aid in the investigation can you try something? On your machine, open 2 instances of Visual Studio. In the first instance, open your ASP.NET Web project as normal. In the second instance, Debug -> Attach to Process, and pick the devenv.exe process - which will be the first instance of Visual Studio. Under Debug-> Windows -> Exception Settings, turn on to break on all 'Common Language Runtime Exceptions'. Now back in the first instance, right click > "Configure Azure AD Authentication" again. See if there are other exceptions happening besides "Could not resolve mscorlib..."Eric Erhardt
I didn't see any exceptions at all when I attached and repro'ed. The debug output didn't have anything alarming either.Vivek Maharajh

1 Answers

3
votes

Vivek,

-- Check your Nuget packages and make sure they are up to date --

I was experiencing the same issue. This was with a project I had just created on another workstation and had parked it on a Git repository the night before. After cloning and opening on my second workstation I right-clicked the project and chose the "Configure Azure AD Authentication" option just like you. I got the same error. I then went to my Nuget Package Manager and checked to see whether my packages were up to date. Immediately I received an error from Nuget stating a package was missing, I clicked the 'Restore' button to restore it. Once it completed I discovered that there were several projects that required an update. After updating the Nuget packages that were needing an update I went back to right-click the project and "Configure Azure AD Authentication". No errors and I was able to proceed. I hope that works for you.