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).
VS2012 incorrectly renames codebehind when renaming markup file
-
11-04-2022 - |
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):
.aspx is lost when renaming to Default1.aspx
:
close and reopen Visual Stuio to find this:
rename to add the missing .aspx
:
finally have a correctly named codebehind:
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.
Lösung