I recently renamed my root TFS folder from D:\\TFS\\systemstfs
to D:\\TFS\\sys
because one of the project\'s paths was too long for Windows. Now, when
My setup is a .NET 4.6.1 MVC project hosted as an Azure Cloud Service. I got this error when running locally with Visual Studio 2019 and IIS Express. I was able to fix the error. In my case the error was a red herring and was a symptom of another problem. For me, I had to remove my references to System.http.net, System.runtime, and System.Runtime.InteropServices. Then I added the latest version of those those three references back with Nuget.
The issue was that my code could not find those three packages. It has issues finding the packages every time I switch my git branch, but that's a completely separate error, and one I'm still trying to resolve. The way I figured out what was wrong was I would run the code and look at the "build" and "debug" output in Visual Studio 2019. I saw errors relating to the code not being able to find System.Http.Net, so I fixed that, then saw the errors with the other packages and fixed them. The real issue was that my code was getting exceptions and not running correctly, it just happened to manifest as this 500.19 error.
Another possibly contributing factor is that I disabled "just my code" earlier in the day. This seemed to cause my code to not break when exceptions were encountered. Once I turned this back on, my code would break when an exception happened, and this also helped me figure out the cause of the problem. To find this option, go into Tools > Options > Debugging > General > "Enable Just My Code".
Original error: