I keep running into an annoying problem with Visual Studio. I make a change to a source code file (.cshtml) and then I publish it, run it, and step through parts to debug it. (it steps through the published file, not the file from the folder where the solution is contained on my local drive)
I find an error and make a change to what I think is the file from the solution folder, but it's actually the file from the published folder instead. So now I have 2 .cshtml files open in Visual Studio with the same name, where the incorrect/published file has all my new changes. I then go to check into TFS and there is nothing to check in and nothing to save in VS. Sometimes I mistakenly close the published file and loose my new changes because I click the save all button in VS and everything gets saved except the changes from the published folder! Which doesn't show any changes!
Is there any way to avoid opening the published file in VS and always work from the repo'd file so that I never mistakenly close the published file with changes in them and then loose those changes???
FYI - I debug by attaching to a IISWorkerProcess and basically debug remotely, not on the machine with visual studio.