question

AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 asked Deepak-MSFT commented

Visual Studio 2019 does not show all files in project folder of asp.net web site

With I select Open Folder in File Explorer, it shows all 166 items. But, in the project folder, it only shows the first 12 of those files.

dotnet-aspnet-webpages
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AminniaBen-3840 ,

Could you please inform us the file types or extensions that are not getting displayed in the Visual Studio?

Does the project loaded properly in the Visual Studio? Are you able to run it?

Further, if possible could you please share the screenshot of the files from file explorer and screenshot of the Visual Studio?

It could help us understand the issue properly.

Best Regards,
Deepak

0 Votes 0 ·

what kind of files are those which are not being displayed in visual studio also try and put the files that are not being displayed in a sub folder and see if that sub folder and its content are visible or not childish enough try to move the project into a different directory

0 Votes 0 ·
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered

File extensions that are not getting displayed in Visual Studio are aspx and aspx.cs
Yes, the project loads in Visual Studio, and I am able to run it
I have attached screen shots which show 166 files in File Explorer and only 12 files in Visual Studio (under Reports folder)
243074-12-in-visual-studio.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered AgaveJoe converted comment to answer

243039-166-in-file-explorer.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AgaveJoe avatar image
0 Votes"
AgaveJoe answered

You misunderstand the Web Forms project and solution files in Visual Studio. You need to add the files.

Right click the Reports folder -> Add -> Existing item.... -> navigate to the folder that has the files you wish to add. Select all the files you wish to add then click the Add button.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered Deepak-MSFT commented

I tried your recommendation for Add -> Existing item.... but, there are two issues:
1. It only adds .aspx files (not .aspx.cs files, which are associated with each .aspx file).
2. When I close and re-open the solution, all those added files disappear again.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AminniaBen-3840 ,

In the Solution explorer, there is a button to 'Show All Files'. Try to click that button and see if it shows all the files.

243180-8.png

Beside that you need to click the expand arrow that you could see on the left side of the Aspx file. It will show you the Aspx.cs file.

243261-9.png

Best Regards,
Deepak

0 Votes 0 ·
8.png (6.7 KiB)
9.png (4.8 KiB)
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered Deepak-MSFT commented

Thank you, Deepak

I am familiar with these, but there are issues which are unresolved:

I have already tried 'Show All Files' but it does not help. It still shows only a few of the files under Reports folder.

Also, I still don’t have an answer to my earlier comment: When I close and re-open the solution, all those added files disappear again, so if I need to work on them, I will need to add them again.

Maybe this is something about the 2019 version of Visual Studio, which has a limit on maximum number of files to show under each folder?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AminniaBen-3840 ,

I don't think that there is any limit for showing files in a Visual Studio.

Could you please inform us using which version of Visual Studio have you created this Web Forms project?

I will try to check on my side if that version is available to download. I could try to create a project using that version and try to load it in the Visual Studio 2019 to see whether I could reproduce the issue or it is a project specific issue.

Besides, you could inform us whether there is anything special in your project that I need to configure to reproduce the said issue?

Best Regards,
Deepak

0 Votes 0 ·
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered Deepak-MSFT commented

I created this project about 15 years ago, in 2008. There is no special configuration.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Are you opening this existing project, or did you perhaps create a new project + sln file, and then are using the files in that project?
It also not clear, is i fthis a MVC project, or a asp.net web forms project?

Do you (are you) opening this project as a web site, or as a project?

eg this as web site:

243966-image.png

Or, you are using this:
243930-image.png

So, it possible you wound up creating a "sln" file by opening the web site as a project?

Anyway, part of your screen cap seems to show + suggest this is a mvc project - "mvc bootstrat". But the rest seems to suggest a web forms project? (or web forms web site).

So, how you open and deal with this web site (or web site application/project) will effect what you see and how this is supposed to work.



0 Votes 0 ·
image.png (24.0 KiB)
image.png (19.3 KiB)

Hi @AminniaBen-3840 ,

I have created a test Web forms project in Visual Studio 2008 and try to open it using the Visual Studio 2019.

While I launch the project, Visual Studio inform me to upgrade the project to the newer version.

244153-10.png

244192-11.png

Have you got this kind of popups while you had open the project for first time? If yes, have you upgraded the project?

If you have not upgraded then you could first create a backup copy of your project and then try to upgrade it. See whether it makes any difference.

Best Regards,
Deepak

0 Votes 0 ·
10.png (18.1 KiB)
11.png (5.1 KiB)
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered AlbertKallal-4360 edited

This is NOT MVC project. It is asp.net web forms project.
Once I open Visual Studio 2019, it shows the page with [Open recent] options, then I click on the most recent .sln which is on source\repos folder.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Ok, but you still can (could) try opening the project as a web site.
The sln file might have been created by accident when opening the web site as a open project as opposed to having used open web site.
You can of course continue to open as project, but then as suggested in this thread, you want to use add->existing items, and browse to the same project folder and add them, so VS knows about the files (which is not required if this was a web site, as opposed to a web site applcation (with sln file).

It only adds .aspx files (not .aspx.cs files, which are associated with each .aspx file).

Did you change the drop down, and use "asterisk . asterisk" to select all of the files?
(edit: - it does look like the drop down when using add->existing items does default to all files - so above suggest to check/use asterisk should not matter - nor be required, but you STILL want to select all files - not just a aspx, and then assume that vs will select the .cs files for you).

And thus keep in mind, that you be selecting 3 files - the test.aspx, test.aspx.cs and test.aspx.designer.cs.

But then again, if this was/is a web site, as opposed to a web site applcation, then no designer file will have been created nor exist. But, if you using a sln file, and a web site application, then all 3 files should exist (so for above, test.aspx, you ALSO will have test.aspx.cs, and also have text.aspx.designer.cs). For web site, only the 2 files will exist.



0 Votes 0 ·
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered Deepak-MSFT commented

This was just a web site, so designer files were never created.

At this point, I only have one concern:

I am able to use Add->Existing Item... (with .) to select all aspx and aspx.cs files which I need.

However, once I am done with my assigned work and close Visual Studio, the next time I open it, all aspx and aspx.cs files which I added last time disappear again.

Is there a way to make Visual Studio keep all added files, so I don’t have to add them again every time I re-open Visual Studio?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AminniaBen-3840 ,

For testing purposes, is it possible for you to create a new project using the Visual Studio 2019 and add existing code files to a new project. Then you could see whether it works properly after reopening the project. I also suggest you to check whether your Visual Studio has latest updates installed.

Best Regards,
Deepak

0 Votes 0 ·
AminniaBen-3840 avatar image
0 Votes"
AminniaBen-3840 answered Deepak-MSFT commented

I already created a new project in Visual Studio 2019 using the existing code, but it had the same result as the current project.
I also install Visual Studio updates on a regular basis. My latest version is: 16.11.19

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AminniaBen-3840 ,

In that case, if you are available with the any other version of the Visual studio(e.g. VS 2022) then you could test your project with it to see whether you could reproduce the same issue.

Further, try to compare the aspx files from the old project and new project. See whether there is any difference in the default code that might preventing the files from showing again on reopening the VS.

Best Regards,
Deepak

0 Votes 0 ·