Any changes to compiled code will require a rebuild. This includes:
- *.cs
- *aspx.cs
- *.designer.cs
- Global.asax.cs
The gotcha here is the word "compiled". Even the *.aspx *.asmx files are compiled, but this is done Just-In-Time (JIT) before the page is executed. The compiled output is cached and reused, but the runtime will detect changes to a few files and re-JIT them.
An interesting side: changes to the root web.config of your site will force a rebuild.
There are few changes that won't require a recompile.
- *.aspx unless you are adding/removing server controls/user controls or assembly references
- *.aspc unless you are adding/removing server controls/user controls or assembly references
- textual data files such as *.txt, *.xml unless you are accessing these files in a read-once and cache pattern.
- other textual files JavaScript (.js) and Stylesheets (.css) (thanks jerone)
TIP: If you have a large solution, with many projects, you don't have to re-compile every one of them each time you make a change. Just compile the projects that you have changed by right-clicking the project in Solution Explorer and clicking Build. If you have unsaved changes to files not in the selected project, these will not autosave and will be excluded from the build.