Given a view with the following Razor code:
@Url.Action("Index", "Home")
I want to add an Area parameter like so:
@Url.Action("Index", "Home", new { Area = "Manage" })
But when I start typing, this happens:
@Url.Action("Index", "Home", new object{Area = ""Manage"}) // broken double quote
How do I stop Visual Studio from completing the broken double quote so I don’t have to play tetris for each link? Could ReSharper be causing this? I can’t find the option for it.
If you type your code inside attribute, for example
then ReSharper can erroneously add a quote, resulting in “Manage””. This should be fixed in the last ReSharper 7.0 EAP releases. In previous versions, try turning off ReSharper | Options -> Environment | Editor -> Auto-insert pair brackets, parenthesis and quotes.