Cheung
Cheung

Reputation: 15552

ASP.NET Web Application, Refresh project folder's file?

On Visual Studio 2010, when i create ASP.NET Web Site Project, every times i add or remove any files, i can refresh via project explorer to refresh the folder contents,

however, if i create Web Application Project, it doesn't refresh the contents, is it bug of VS or other reason i need manually ?

Upvotes: 3

Views: 5579

Answers (1)

Jon
Jon

Reputation: 16728

Make sure that the "Show All Files" option in the Solution Explorer toolbar is selected.

A Web Application project is a proper Visual Studio project that maintains a .csproj (or .vbproj) file that lists the files in the project so it knows what to compile when it produces a .dll file. This doesn't happen with a Web Site Project.

If there are files in the folder which aren't in the project that your site depends on (such as images, or files that you create in an external editor), you might want to right-click on them and choose "Include in project". This will make it easier when dealing with deployments, source control systems, etc.

Also, there should be a "Refresh" button in the Solution Explorer toolbar for all project types that you can click - I see it is in the right-click menu for Web Site Projects but not Web Application Projects. For some reason, the (otherwise excellent) Solution Navigator - which is part of the Productivity Power Tools extension doesn't seem to have a refresh button available - this may be the one area I've found where the Solution Explorer is better than the Solution Navigator.

Upvotes: 7

Related Questions