This is the common issue in Visual Studio Platform when you migrate your project from one system to another or sometime you may face this issue even on changing the location of the project into the same system.
First - Minor Fix:Steps to fix issue 👇
- Close the project and Visual Studio as well.
- Navigate to the project location. Find the .vs folder (This is a hidden folder so make the Show Hidden files feature enable) Delete this .vs folder.
- Again open the Visual Studio and run the project the error should be fixed.
- Still Same Error I think you need the second fix. Try that one.
This fix is a little bit tricky and need small code modification follow the steps below best of luck
Steps 👇
- Open the Visual Studio by right clicking on it and selecting Run as administrator option.
- Open your project from the Recent Projects option.
- The project should be in solution explorer right click on the project and click on unload the project option.
- Again click on the project and select the option Edit PROJECT_NAME.csproj Find the code as shown below and Delete it.
<DevelopmentServerPort>54367</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:54367/</IISUrl>
Note: Don't worry about the number 54367 in above code it could be different in your case simply delete it.
Save and close the file after Deleting it. In Solution Explorer again right click on your project name from where you unload the project and reload it. I hope your issue is resolved now, Run the project and check it. Don't forget to tell me in comment - Which method works for you.