Hello. I have recently moved a project from the original development PC to a new laptop. I have been successfully making modifications and deploying to the solution through Visual Studio 2017 for a few weeks although most changes were primarily relating to new/adjusted views and some changes to the database through entity framework.
This morning I attempted to add a new model to the project and when I attempted to add a new class I received the error: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))." On closing the error dialog box the new class did appear in Solution Explorer and I'm able to start inputting properties. When I attempted to add a data annotation for one of the properties ("[Required]") prior to having referenced annotations the normal error dialog appears with the 'Show potential fixes' option which normally then suggests referencing the annotations. When I click on 'Show potential fixes' it causes VS to crash.
I launched the debug and the following exception had caused the crash:
System.UnauthorizedAccessException was unhandled
Message: An unhandled exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.VisualStudio.Shell.15.0.dll
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Not sure what is causing this but obviously very limiting if I can't add new classes. I tried adding new classes to other folders (views, controllers) and the same issues occurred. I am able to add new Views and Controllers without incident.