Frage

In Visual Studio 2012, when I rename an aspx file, VS automatically renames the codebehind file but drops the .aspx from the file name. Because it is still nested as a codebehind, I cannot rename it. The current workaround is to close VS and reopen it, at which point the file - since it ends in .cs rather than .aspx.cs - is no longer recognized as a codebehind file.

File is created (or copied from another):
Example 1

.aspx is lost when renaming to Default1.aspx:
Example 2

close and reopen Visual Stuio to find this:
Example 3

rename to add the missing .aspx:
Example 4

finally have a correctly named codebehind:
Example 5

This has been happening to a colleague for a while and only recently started happening to me (no catalyst I can think of). Anyone know how to correct the auto-naming of the codebehind file?

Note: This problem only occurs on a website. Renaming functions as expected in a WebApp.

War es hilfreich?

Lösung

I'm having the same problem. The problem goes away when I disable Web Essentials 2012 (not really a solution - but it seems to be the cause).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top