I have an issue I've recently noticed in visual studio (2015 Enterprise) where when I'm working on a View and I format a document using the "Format Document" functionality either through the keyboard shortcut or the edit menu, that visual studio will add in one or more External Source Directives throughout the document e.g.:
#End ExternalSource
#ExternalSource ("C:\ProjectLocation\CurrentView.vbhtml",12)
The End statement also comes before the start statement, even if there isn't another start above it. The number is not usually the same, and reading up it's a line number.
I assume this has something to do with having code in the View (using Razor), but is there a way to prevent this from happening when I'm formatting a View, as it's frustrating and it doesn't even format the document correctly!
Seems like this happens when I'm doing a lot of databinding in the aspx code:
Text='<%# Eval("MyFieldName") %>'
Perhaps cutting and pasting blocks in a malformed way is causing this.
I'm thinking that when the eval is executed when running, .net is inserting this external code into the aspx page, but if the page hits an error or crashes somehow, the external code isn't removed and remains all sliced up within the raw aspx.
Not sure if that makes sense. Just spent hours trying to scrape this code out (which kept reappearing) before giving up and reverting to a previous version and starting over.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With