简体   繁体   中英

Visual Studio 2013 Solution Explorer Not Showing Files

I am trying to start a side-project to learn some MVC coding.

I am having some weird behaviour when I have reopened my MVC project.

The classes I created "Backpacker" and "Booking" are not showing up in the solution explorer. I have tried pressing the "Show all files" button, but this does not help.

As you can see in the screenshots, I have the class file open, and the path is pointing to the current project. Also you can see that my classes are in the same directory as the other classes that are visible in the models folder.

Does anyone have any ideas as to why this is happening? It is hugely frustrating and I feel like maybe I have not configured something correctly?

Thanks in advance

解决方案资源管理器

夹

//EDIT//

Darn it - I tried the "Show all files" once more and this time it seemed to "almost" work... see the newest screenshot.

However Visual Studio is still obviously not connecting them to the project correctly.... does anyone know why? or how to fix/prevent this in future?

Cheers.

在此处输入图片说明

Alright so this problem was my own fault. I overlooked something I had done without realising what was actually happening.

When I added my new classes through solution explorer, that was all done fine. However When I closed visual studio and had the following prompt:

在此处输入图片说明

I clicked "no" because I usually work with XSLT which doesn't require saving the solution for my changes to be kept.

When you add references to new class files in your project, the project needs to be saved or you will lose this data (duhhh).

To fix this issue I did the following:

添加参考

And then made sure I SAVED THE SOLUTION changes.

Thanks for your help - hopefully this may be of use to other people.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM