Razor Intellisense Not Working VS2010 SP1Rel MVC3 from WPI Win7 x64

前端 未结 12 1558
迷失自我
迷失自我 2020-12-10 12:42

I have Visual Studio 2010 /SP1 / MVC 3 (With April Tools Update) installed on a machine with a fresh install of Windows 7 64-bit Professional.

I do not have resharp

相关标签:
12条回答
  • 2020-12-10 13:20

    I had this problem with one of my projects and the problem was the project somehow got converted to a Class Library project when I converted it from a standalone MVC app into an Orchard module.

    Fixed by opening the .csproj file in a text editor and replacing this line:

    <ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    

    with this:

    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    
    0 讨论(0)
  • 2020-12-10 13:25

    I fixed it by right clicking on the cshtml file and selecting "View Markup".

    0 讨论(0)
  • 2020-12-10 13:30

    You probably have already tried that one, but for me the steps in this blog-post worked: http://blogs.msdn.com/b/webdevtools/archive/2011/03/24/razor-tooling-for-mvc3-rc-with-visual-studio-2010-sp1-rtm.aspx

    0 讨论(0)
  • 2020-12-10 13:30

    Like BuildStarter mentionned, Click Open With and set the default to Razor Editor even if it's already set. Should get the color coding and intelisense.

    0 讨论(0)
  • 2020-12-10 13:32

    Please note that for me what caused the problem was the Roslyn Language Services plugin installed. When I uninstalled the plugin the issue was solved. To uninstall the plugin simply go to tools->extension manager and find the plugin Roslyn Language Services. Click the uninstall button and restart VS2010.

    0 讨论(0)
  • 2020-12-10 13:34

    Razor Intellisense work with Razor Editor

    Check if it is selected as default editor, For this do

    • Right Click on view file (.cshtml)
    • Select Open With...
    • Check Razor editor Select as default
    • if not, uninstall mvc3 from control panel reinstall it.

    Again check files must be opened in Razor Editor. I have done this and its working now.

    0 讨论(0)
提交回复
热议问题