During discussing a thread in ASP.NET MVC forums, found a bug in Razor V2 in which the auto url resolution(~) will not work if you have an html comment with quotation or apostrophe before the url resolution(~) tag. Here is an quick example,
``` Html
<!-- '" -->
<img src="~/images/submit.png" />
```
See this thread,
[http://forums.asp.net/t/1892597.aspx/1?Using+UrlHelper+Content](http://forums.asp.net/t/1892597.aspx/1?Using+UrlHelper+Content)
Comments: Verified again that this bug is solved as well. Unit tests have been checked in. The expected generated code (the .cs file) should Emit something like the following: WriteAttribute("src", Tuple.Create(" src=\"", 4), Tuple.Create("\"", 29) , Tuple.Create(Tuple.Create("", 10), Tuple.Create<System.Object, System.Int32>(Href("~/images/submit.png") , 10), false) ); In order to verify you have to replace the whole stack to MVC5/Razor3 and not just system.web.razor
``` Html
<!-- '" -->
<img src="~/images/submit.png" />
```
See this thread,
[http://forums.asp.net/t/1892597.aspx/1?Using+UrlHelper+Content](http://forums.asp.net/t/1892597.aspx/1?Using+UrlHelper+Content)
Comments: Verified again that this bug is solved as well. Unit tests have been checked in. The expected generated code (the .cs file) should Emit something like the following: WriteAttribute("src", Tuple.Create(" src=\"", 4), Tuple.Create("\"", 29) , Tuple.Create(Tuple.Create("", 10), Tuple.Create<System.Object, System.Int32>(Href("~/images/submit.png") , 10), false) ); In order to verify you have to replace the whole stack to MVC5/Razor3 and not just system.web.razor