Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Add ASP.Net folder" not enabled

Tags:

asp.net-mvc

I am following the MVC Music Store tutorial and it says I can create the App_Data folder by clicking on Project -> Add ASP.Net folder -> App_Data.

However when I do that I see that all the standard ASP.Net folders are disabled and cannot be selected. Why is that and how do I fix it?

like image 675
arame3333 Avatar asked May 23 '11 10:05

arame3333


2 Answers

I came across this problem too. You have to make sure the project is selected in the Solution Explorer and not just some file or folder within the project. If the project is selected, your Add ASP.NET folder options will become enabled. Alternatively, right click on the project in the tree and go to Add -> Add ASP.NET Folder. That will make sure the project is indeed selected.

like image 104
rulestein Avatar answered Sep 23 '22 00:09

rulestein


Check to see if the folder already exists physically (using Windows Explorer, not Visual Studio Solution Explorer).

Visual Studio won't allow you to add App_Data if there is already a folder there of the same name even if the project doesn't "include" it (meaning that it won't appear in the project despite being in the folders).

You can "Add existing item" to include it or try deleting the physical folder then adding the ASP.NET folder.

I don't know why the physical folder existed but wasn't included in the project.

To be certain, I added the folder as an existing item to the project, deleted from the project (which dumped that folder into the recycle bin), then added the ASP.NET App_Data folder (which created a new one).

Just to be sure.

like image 31
Eric H. Vela Avatar answered Sep 27 '22 00:09

Eric H. Vela