How can I reset/get back razor intellisense and syntax highlighting? - asp.net-mvc-3

I had a problem with my Visual Studio 2010 install - managed to sort it by a repair, and reinstall my addon's etc., but now the intellisense and syntax highlighting has disappeared from my cshtml files - I've reinstalled the asp.net mvc 3 RTM and that hasn't fixed it...I've trying a devenv /ResetSettings, but no change.
Is there anything else I can do to try and bring back my lovely highlighting?!

Ok solved it - When uninstalling MVC 3 Visual Studio Tools, I didnt uninstall asp.net webpages visual studio tools, which MVC 3 depends on, once I uninstalled this also and then reinstalled the MVC 3 RTM, my syntax highlights etc came back! phew!

Try downloading "ASP.NET Web Pages with Razor Syntax"
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=B7937C34-3B53-47B7-AE17-5A72FA700472

Just did this and it worked:
Uninstall:
ASP.NET MVC 3 - Visual Studio 2010 Tools Update
ASP.NET MVC 3 - Visual Studio 2010 Tools Update - ESN (Language pack, in my case)
ASP.NET MVC 2 - Visual Studio 2010 Tools Update
ASP.NET MVC 2 - Visual Studio 2010 Tools Update - ESN
ASP.NET Web Pages - Visual Sutdio 2010 Tools Update
ASP.NET Web Pages - Visual Sutdio 2010 Tools Update - ESN
Reinstall everything again. It worked without rebooting.

Related

Visual Studio 2015 razor editor not working

My razor file is not having proper highlighting and intellisense is not working.
Razor file in vs2015 image:-
I tried solutions in Visual Studio 2015 not syntax highlighting razor nor Intellisense , Visual Studio 2015 Razor View MVC Types not recognized but it didn't help me.
I installed vs2015 (with update 3) two days before. So i didn't try reinstalling it.
After some search i found the solution. the issue was with the Microsoft web development tool it was not installed correctly( I still don't know why :) ) in my system when i install visual studio 2015. When i tried to modify the visual studio it didn't let me install web development tool (Update button was disabled). So i tried an alternative solution install asp.net core https://www.microsoft.com/net/core#windows because i know it comes with web development tool so i just tried installing and it fixed my issue.

Visual Studio 2013: "New ASP.NET Project" doesn't show templates to choose from

http://i.stack.imgur.com/k5fN5.jpg
I can't create a new ASP.NET Web Project via template. Clicking on "OK" crashes VS 2013 or shows the error message "Object reference not set to an instance of an object".
I'm using MS Windows 8.1 + Visual Studio 2013 Premium Update 3.
Extensions I am using:
.NET Reflector Pro
Brace Completer
Visual Power Tools
Web Essentials 2013 for Update 3
Maybe someone knows whats going on? I am running VS 2013 as admin. :(
I tried disabling all Extension, doesn't help.
It's a fresh install from MSDN.
Edit:
I just recognized that the templates show up, when I choose a .NET framework below 4.5:
http://i.imgur.com/rK6AzNR.jpg
EDIT 2:
Okay, reinstalling didn't help. I also uninstalled everything .NET related.
Okay I found the Problem.
in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies are three assemblies that prevent VS 2013 from showing up the assemblies. See this Question/Answer:
Can't create new MVC5 project or any other ASP .NET projects in Visual Studio 2013

MVC 3 Visual Studio 2010 Razor Model intellisense not working

Ever since I updated my projects for VS 11 I can't get my #Model intellisense to work in either version of Visual Studio (2010 or 11). I've tried reverting the .csproj file to remove the VS 11 references, but to no avail. Other MVC 3 Razor project are working just fine. Anyone experience this?
Not working in both versions of Visual Studio smells like the install is possibly corrupted a bit. My first step would be to try and repair the Visual Studio 2010 install and see if the Intellisense behavior comes back for 2010 only.
Control Panel
Add / Remove Programs
Visual Studio 2010
Select Repair in the menu
If this works then you could be happy with the returned intellisense or try the same steps for Visual Studio 11 and hope it fixes it for both. But if the installation of 2011 is to blame then very likely it would just immediately rebreak both of them
I found this article that addressed my issue.
EDIT:
It seems that some combination of installing VS 11 and some tool updates caused this issue. I got luck and managed to get the following error message:
The type System.Web.Mvc.ModelClientValidationRule exists in both c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.O\Assemblies\System.Web.WebPages.dll and c:\Program
Files (6)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
After doing some digging I wound up uninstalling "Microsoft ASP.NET Web Pages 2 - Visual Studio 2010 Tools", which resulted in everything working. Granted it may have been a better idea to uninstall "Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools" instead, but this is working at the moment.
I found a complete lack of information on the Internet about this type of issue, so I'm putting it here for posterity.

MVC 3 Razor Intellisense

I have Visual Studio 2010 Ultimate installed with SP1 RTM and MVC 3 RTM installed as well. The problem I am having is that the Razor intellisense will not work. When I start a new MVC 3 project with the Razor engine and open a view, the Razor highlighting works but all of the key words are underlined with red squiggles and the intellisense doesn't work. I do not have ReSharper installed.
I have tried reinstalling MVC 2, MVC 3, and Visual Studio 2010 Ultimate but intellisense will still not work for Razor. Has anyone else had this issue, or know how to fix it?
Thanks in advance!
When uninstalling make sure to uninstall all of the below:
Microsoft ASP.NET MVC 3
Microsoft ASP.NET MVC 3 - Visual Studio 2010 Tools Update (you might not have this one installed)
Microsoft ASP.NET Web Pages
Microsoft ASP.NET Web Pages - Visual Studio 2010 Tools
Now install the following:
ASP.NET MVC 3 Tools Update
Razor Intellisense should work.
Its possible that you're not opening Razor files with the right editor. This is particularly likely if you were using Razor before the RTM came out, when there was no Razor editor.
Right-click on one of your .cshtml files and select "Open With", and make sure that the default is the "Razor Editor" and not the HTML or XML editors. Pre-RTM, the auto-detection would have picked the XML editor as the correct one based on the presence of XML tags.
Also, you said that you've reinstalled everything, but the actual Intellisense support comes from a package called "ASP.NET Web Pages Visual Studio Tools", which is installed as part of MVC. If you are actually using the Razor editor and have no Intellisense, uninstall MVC3 and the web pages tools, and reinstall them both.
This solution is worked for me :)
When i uninstalled (i should never install) SP1 update for visual studio, my razor support had gone away, i try to uninstall and install MVC3 Tools update many times but it didn't worked.
After that I right click the installer and extract the package and i saw the seperated .msi installers in it. I installed one by one which are i needed and it worked :)
I hope it helps other user.

Visual Studio 2010 not recognisng .cshtml files

I recenetly reinstalled Visual Studio 2010 and since doing so I can not figure out how to get it to recognise .cshtml files again... I tried installing MVC 3 but it said it was already installed, basically when I open the .cshtml files in Visual Studio they have no code high lighting or intelli sense.
Any sugestions?
Thanks,
Alex.
You'll need to reinstall the Microsoft ASP.NET MVC 3 - Visual Studio 2010 tools.
You might just be able to do a repair install of MVC 3. If that doesn't work, I'd uninstall MVC 3 (making sure it removes the tools too) and re-install them both.
And even if you install it right, there is no support for a visual editor. It will remain in code view. However, with MVC3 and beyond, there is good support for intellisense.

Resources