Programming

Visual Studio 2015는 면도기 나 Intellisense를 강조하는 구문이 아닙니다.

procodes 2020. 7. 13. 22:01
반응형

Visual Studio 2015는 면도기 나 Intellisense를 강조하는 구문이 아닙니다.


VS2015 RC의 내 면도기보기가 C # 코드에 적절한 색상을 표시하지 않습니다. 내 프로젝트는 VS2013에서 제대로 작동했지만 2015 년에는 없었으며 C # 코드에 대한 Intellisense를 제공하지 않습니다. 솔루션이 빌드되고 사이트가 제대로 실행됩니다.

나는 쓸모없는 다음을 시도했다

  • 모든 Visual Studio 확장 비활성화
  • .suo파일 삭제
  • 프로젝트를 제거하고 솔루션에 다시 추가

이 문제를 어떻게 해결할 수 있습니까?

예:


답변에서 다른 방법으로 문제를 해결하지 못했습니다.devenv.exe /ResetUserData

Visual Studio를 닫은 상태에서이 디렉토리의 내용을 삭제하십시오. %LocalAppData%\Microsoft\VisualStudio\<visual_studio_version_number>\ComponentModelCache

실행중인 Visual Studio 버전의 버전 번호를 찾으려면 목록을 참조하십시오 . 주 번호 만 중요하며 부 버전은 다를 수 있으며 아마도 다를 수 있습니다. 필자의 경우 Visual Studio 2017 Enterprise를 설치 했으므로 AppData 폴더를 15.xx찾아서 찾았습니다 15.0_9a1c4a06.


나는 같은 문제가 있었지만 지금까지 유일한 해결책은 모든 사용자 데이터를 재설정하는 것입니다 ( C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /ResetUserData).

참고 : 이렇게하면 키보드 바로 가기 및 창 레이아웃과 같은 모든 사용자 지정 내용이 손실됩니다!

편집 : 사람들은 이것이 RTM이 아닌 RC에서만 작동하므로 다른 수정을 먼저 시도 할 수 있다고 말합니다.


VS 2015 RTM에서 동일한 문제가 발생했으며 Visual Studio를 안전 모드에서 다음과 같이 간단하게로드하여 해결할 수있었습니다.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /SafeMode

그런 다음 정상적으로 닫았다가 다시 엽니 다.


Visual Studio 2015 업데이트 1을 업데이트 한 후 동일한 문제가 발생했습니다. 나는 모든 대답을 시도했지만 나에게 효과가 없었습니다.

나를위한 해결책은 프로그램 및 속성> Visual Studio community edition> Change로 이동하는 것입니다. 수정을 클릭했습니다.

목록 에서 "Windows 및 웹 개발"아래의 " Microsoft Web Developer Tools" 에 확인 표시를하십시오 .

내 목록에서 확인되지 않았습니다.

여기에 이미지 설명을 입력하십시오


도구> 옵션> 텍스트 편집기> 모든 언어> 일반. 고급 멤버 숨기기 옵션을 선택 취소하십시오. 확인을 클릭하십시오.

일단 Intellisense가 나를 위해 일하는 것처럼 보였습니다. 그런 다음 다시 재설정하고 기능을 유지했습니다. Visual Studio 2015 Enterprise Edition을 사용하고 있습니다.

ResetUserData를 시도했지만 작동하지 않았습니다.


Visual Studio Community Edition 2015를 오랫동안 설치 한 후 Visual Studio Community Edition 2015를 설치했으며 같은 문제에 직면했습니다. 위의 모든 솔루션을 시도했지만 아무런 도움이되지 않았습니다.

마지막으로 Visual Studio를 닫고 다음 폴더를 삭제하십시오.

C:\Users\Allwyn\AppData\Roaming\Microsoft\VisualStudio\14.0
C:\Users\Allwyn\AppData\Roaming\Microsoft\VisualStudio\14.0

... 그리고 지금 작동합니다 !!!


VS 2015 RTM을 실행 중입니다. / ResetUserData 또는 / SafeMode는 저에게 효과적이지 않았습니다. 또한 VS를 시작할 때 일부 생산성 Power Tools 2015 관련 문제에 "Errors-in-ActivityLog.xml"팝업이 표시됩니다.

따라서 비슷한 증상이 나타나면 내 컴퓨터에서 어떻게 고쳤습니까?

  1. "Visual Studio 2015 실험 인스턴스 시작 "을 시작 하고 프로젝트를 엽니 다. 인텔리전스가 작동하고 면도기 구문이 강조 표시되면 다음이 작동 할 가능성이 큽니다.
  2. "Productivity Power Tools 2015"를 제거 하고 Visual Studio를 닫습니다.
  3. 폴더로 이동하여 %LOCALAPPDATA%\Microsoft\VisualStudio\삭제하십시오 14.0.
  4. Launch VS-방금 설치 한대로 시작해야합니다.

추신 : 실제로 PowerTools를 먼저 비활성화하고 다시 활성화하면 VS가 깨져서 인텔리 센스가 작동하는 데 몇 시간이 걸렸습니다. 따라서 완전히 다시 설치해야합니다. 귀하의 경우 다른 연장으로 인해 발생할 수 있습니다.


프로젝트가 MVC4 인 경우에 효과가 있습니다. 자세한 내용은 여기를 참조 하십시오 . 또한 이것은 다음 릴리스에서 수정 될 것입니다.
프로젝트가 MVC4인지 어떻게 알 수 있습니까? packages.config를 열고 Microsoft.AspNet.Mvc 항목으로 스크롤하십시오. 나열된 버전이 "4"로 시작하면 MVC 4를 사용하고 있다는 의미입니다.


비슷한 문제가있어 면도기 스크립트가 강조 표시되지 않고 인텔리 센스가 작동하지 않으며 컴파일러가 오류를 인식하지 못합니다 (의도적으로 구문 오류가있는 경우에도).

실제로 C : / Users / YourUserName / AppData / Local / Temp로 이동 하여이 파일에서 모든 것을 삭제하고 문제를 해결하고 내 Razor Views가 작동하기 시작한 직후에 문제를 해결했습니다!

희망이 도움이됩니다!


어떤 견해는 나에게 잘 맞았고 어떤 견해는 전혀 없었습니다 ... 저에게 도움이 된 유일한 것은 :

  • 결산 VS
  • C : \ Users \ % username % \ AppData \ Local \ Temp 삭제
  • VS 다시 시작
  • 문제 해결됨

다른 솔루션도 대부분 시도했지만 효과가 없었습니다.


@model보기의 상단에서 소문자 올바르게 사용했는지 확인하는 친숙한 알림입니다 @Model(실수로 실수 한 것처럼).

Lowercase @model is a directive that strongly types the view to an instance of the class that follows it. Whereas the capitalized Model is a property of the view that gets the model instance.


I fixed the issue by including the file in the project/solution. I'd overlooked the fact that there's no highlighting/intellisense if it's not included.


I had the same problem and had to download and install "Microsoft ASP.NET and Web Tools" and "Web Essentials". After doing this syntax highlighting and Razor intellisense started working again.


In my Web.config I had this:

    <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <namespaces>
            <add namespace="LinkApp.Models.Templates"/>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Optimization"/>
            <add namespace="System.Web.Routing" />
            <add namespace="LinkApp" />
          </namespaces>
        </pages>
      </system.web.webPages.razor>

Oddly enough, I moved my custom namespace to the bottom, and that fixed it, like this:

<system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
        <add namespace="LinkApp" />
        <add namespace="LinkApp.Models.Templates"/>
      </namespaces>
    </pages>
  </system.web.webPages.razor>

Uninstalled and reinstalled of the following worked for me:

Microsoft.AspNet.Mvc

Microsoft.AspNet.WebPages

Microsfot.AspNet.Razor

I tried the reset userdata, deleting of temp and 14, as well as changing options settings and none of those worked. I even tried repaired and reinstalled. I am using VS 2015 Version 14.0.24720.00 Update 1


You should only remove the ".vs" folder in your project.(The .vs folder is hidden)

Be careful ResetUserData remove all customization on Visual Studio.


The only thing that worked for me was to change the project's "Output Path" to bin\ (It used to be bin\Debug):

  1. Right-click on the project,
  2. Click on Properties and navigate to Build,
  3. Scroll to the last section titled "Output",
  4. Change the value in the text box labeled Output path: to bin\

Above doesn't work but I managed with:

  • Uninstalling (from Windows Program And Features) Web Developer Tools for VS 2015, RC, Update 1
  • Installing (from VS Installer -> Modify) Web Developer Tools (it's another version of above)

So the problem was that VS installer didn't install Web Developer Tools recognizing already installed, incompatible version as the proper one.


I fixed this problem by updating my project to ASP .NET MVC version 5. But it required some futher manipulations with configuration files. Here I found the step-by-step guide:

  • in global.asax, change: WebApiConfig.Register(GlobalConfiguration.Configuration); to GlobalConfiguration.Configure(WebApiConfig.Register);
  • Make sure all the packages that your projects use are compatible with MVC 5 and Web API 2
  • Remove any of the following ASP.NET NuGet packages that are installed:
    1. Microsoft.AspNet.WebPages.Administration
    2. Microsoft-Web-Helpers (do not confuse with Microsoft.AspNet.WebHelpers !)
    3. Microsoft.AspNet.Mvc.FixedDisplayMode
  • Upgrade all the ASP.NET NuGet packages. In the Package Manager Console you can run the following command: Update-Package. Without any parameters it will update every package.
  • Update the Application and Views config Files:
    1. For all elements with the name attribute “System.Web.Mvc”, change the version number to new one (check version of assembly in solution explorer, it has to be equals to or higher than “5.0.0.0”)
    2. Do the same for all elements with the name attribute "System.Web.Helpers” and "System.Web.WebPages".
    3. Check binding redirects for assemblies "System.Web.Helpers", "System.Web.Mvc" and "System.Web.WebPages" in configuration files, "oldVersion" and "newVersion" must comply with the changes made above.
    4. Locate the appSettings section and update the webpages:version from "2.0.0.0.0" to "3.0.0.0"
    5. Update all elements that contain “System.Web.WebPages.Razor” from version “2.0.0.0” to version “3.0.0.0”. If this section contains “System.Web.WebPages”, update those elements from version “2.0.0.0” to version “3.0.0.0”
    6. If you removed the Microsoft-Web-Helpers NuGet package in a previous steps, install Microsoft.AspNet.WebHelpers with the following command in the Package Manager Console: Install-Package -Id Microsoft.AspNet.WebHelpers

I hope this will help.


A non-invasive approach is to check your Views web.config files for the correct Versions. These Web.config files are under app/Area/AreaName/Views or the general app/Views folders. They are different than the project Web.config file.

  • 형식 어셈블리 문자열의 각 버전이 NuGet 설치 버전과 일치하는지 확인하십시오.
  • factoryType 어셈블리 문자열의 버전이 NuGet 설치 버전과 일치하는지 확인하십시오

다음은이 주석을 작성했을 때의 최신 예입니다.

<configSections>
 <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
 <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
 <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
 </sectionGroup>
 </configSections>
<system.web.webPages.razor>
 <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

나를 위해 일한 것은 (VS 2015 Community) 답변 에서 제안 된 옵션이었습니다 . 관리자로 cmd.exe를 실행하면 다음을 실행했습니다.

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /setup

참고 URL : https://stackoverflow.com/questions/30311355/visual-studio-2015-not-syntax-highlighting-razor-nor-intellisense

반응형