Ryan Sangha
Ryan Sangha

Reputation: 461

Can't create new class "The system cannot find the path specified"

Just started with ASP.NET MVC with Visual Studio 2019. I cloned a project from GitHub, and it runs fine. However, when I try to add a class I get the error message saying "The system cannot find the path specified".

I have looked this up but can't find any similar questions.

I am trying to run a default ASP.NET MVC project, there have been no changes to the code. I only cloned the project, so I'm guessing there had to be some issues during the fetch maybe?

Upvotes: 7

Views: 7245

Answers (3)

Fayazz B N
Fayazz B N

Reputation: 167

Deleting And Recreating folder works for me.

Upvotes: 1

Huzaifa
Huzaifa

Reputation: 41

I faced a similar issue when trying to create a new class file inside of a folder in Solution Explorer. Turns out the folder didn't exist in the windows explorer. Navigate to the location to see if the folder exists, if not, create one and re-try. Worked for me.

Upvotes: 4

Mahmoud Heretani
Mahmoud Heretani

Reputation: 575

Open the project using windows explorer and validate that the folder that you trying to add the new class exists, if not just create it and then clean visual studio solution and rebuild it, besides refreshing the solution explorer.

If the previous solution didn't work, then remove .vs folder (after closing the visual studio) and re-open the solution

Upvotes: 9

Related Questions