Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a .exclude file do in Visual Studio?

We have an old ASP.Net Web Site (not a web project) that has lots of files with the .exclude extension. We maintain this site using Visual Studio 2010 and SVN.

What do these files do? Is it safe to delete them? What does it actually mean to exclude a file in a Web Site?

like image 613
Martin Brown Avatar asked Oct 16 '25 13:10

Martin Brown


2 Answers

If you exclude a file from a Web Site project (not Web Application), Visual Studio will simply add the .exclude extension to that file.

If you remove the extension, that file will be included again.

It's up to you if you still need those files or not.

like image 174
sloth Avatar answered Oct 18 '25 08:10

sloth


If the project is a Web Site, Visual Studio excludes a file from the project by adding an extension ".exclude" to mark it as excluded. So all files will the extension ".exclude" will not be used in the project.

".exclude" extension is only used in ASP.NET Web Site, but not in ASP.NET Web Application.

It is easy to temporarily remove files from the site but still make sure that you do not lose track of them, because they remain in the folder structure. For example, if a page is not ready to be deployed, you can temporarily exclude it from the build without deleting it from the folder structure. You can deploy the compiled assembly, and then include the file in the project again.

This is especially important if you are working with a source control repository.

like image 26
Tharif Avatar answered Oct 18 '25 07:10

Tharif