IT박스

Visual Studio는 잘 컴파일되지만 여전히 빨간색 선이 표시됩니다.

itboxs 2020. 10. 28. 07:54
반응형

Visual Studio는 잘 컴파일되지만 여전히 빨간색 선이 표시됩니다.


나는 VS 2012를 사용하고 있으며 재미있는 행동을 관찰하기 시작할 때까지 잘 작동했습니다. 코드를 열면 일반적으로 코드에 오류가있을 때 볼 수있는 빨간색 밑줄이 표시됩니다. 놀랍게도 코드는 모두 잘 컴파일됩니다. 나는 전혀 정상적이지 않은 다음과 같은 관찰을했다.

  1. 코드의 빨간색 밑줄
  2. 솔루션을 청소하거나 구축하는 동안 오류가 없습니다.
  3. 빨간색 밑줄은 솔루션을 빌드 / 정리 한 후 얼마 동안 사라지지만 결국 다시 나타납니다.
  4. 이 때문에 내 지능이 작동을 멈췄습니다.
  5. 구성 요소를 마우스 오른쪽 버튼으로 클릭하고 정의로 이동할 수 없습니다.

어떤 아이디어?


임시 ASP.NET 폴더의 내용을 삭제 한 다음 다시 작성하십시오. 사용자 폴더 ( IIS Express의 경우-\ AppData \ Local \ Temp \ Temporary ASP.NET Files ) 또는 Windows 디렉터리 ( IIS의 경우-C : \ Windows \ Microsoft.Net \ Framework \ vx.xx \)에 있습니다. 임시 ASP.NET 파일 )

경로가 내 머리 위로 벗어 났고 정확하지 않을 수 있습니다.


Visual Studio 2017 :

Visual Studio를 닫고 .vs솔루션 디렉터리에 있는 폴더를 제거하면 저에게 효과적이었습니다.

이 폴더에는 hidden속성이 있습니다. 숨김 파일을 표시하려면 폴더 옵션에서 설정을 변경해야 할 수 있습니다.


Visual Studio 2012에서 생성되었지만 2013 년에 실행중인 솔루션으로 작업하는 동안이 문제가 발생했습니다. Visual Studio를 닫고 모든 \ bin 및 \ obj 디렉터리를 삭제하면 문제가 사라졌습니다.


나는 이것이 오래되었다는 것을 알고 있지만 사람들이 Google에서했던 것처럼이 스레드를 찾는 경우를 대비하여. svn에서 일부 충돌을 해결 한 후이 문제가 발생했습니다. 솔루션에는 여러 프로젝트가 있으며 몇 가지 다른 프로젝트에서 일부 충돌을 해결했습니다. Build-> Clean Solution 다음에 Build-> Rebuild Solution을 수행했는데 모든 것이 다시 좋았습니다.


resharper와 같은 플러그인이 설치되어 있습니까? 잘못된 플러그인에 문제가 있습니다.

플러그인이 실행되지 않도록 안전 모드에서 Visual Studio를 실행 해보십시오.

devenv /Safemode

나에게이 문제는 프로젝트를 언로드하고 다시로드했을 때 수정되었습니다. 나는 나를 위해 일했고 그것이 당신에게도 효과가 있기를 바랍니다 :)


이 문제가 있었고 ReSharper와 관련이있었습니다.

나를위한 솔루션 단계 :

1) ReSharper 비활성화

VisualStudio\Tools\Options\ReSharper Ultimate\General\Suspend Now

2) 솔루션 구축

(Ctrl-Shift-B)

3) ReSharper 다시 활성화

VisualStudio\Tools\Options\ReSharper Ultimate\General\Resume Now

스티브


나와 같은 Resharper를 사용하는 경우 다음 링크를 따라 resharper 캐시를 삭제할 수 있습니다. https://www.jetbrains.com/help/resharper/Configuring_Caches_Location.html

To specify the location for caches

1. Open the Environment | General page of ReSharper options.
2. Use the Save solution caches in to select the location for cache files:
3. User local settings folder to store them in the following directory: %LOCALAPPDATA%\JetBrains\Transient
4.System TEMP folder to store them in the following directory: %TEMP%\ReSharperCache
5. Solution folder to store them in the root folder of the current solution
6. Custom folder to choose a custom location for ReSharper cache files.
7. Click Save to apply the modifications and let ReSharper choose where to save them, or save the modifications to a specific settings layer using the Save To drop-down list. For more information, see managing and sharing resharper settings.
8. Reopen your solution for the changes to take effect.

vs2013에서는 모든 프로젝트에서 obj / bin 폴더를 모두 삭제하여이 문제를 해결했습니다. 문제는 아마도 내가 삭제 한 솔루션 구성 때문일 수 있지만 Build-> Clean Solution을 수행해도 obj / bin 폴더에서 이전 출력이 제거되지 않기 때문에 제대로 정리되지 않았습니다.


나를 위해 작동하는 것은 IntelliSense 인덱스 파일을 삭제하는 것입니다.

IntelliSense 파일은 솔루션과 동일한 디렉터리에 있습니다.

파일 이름은 SolutionName.sdf입니다.

이 파일을 삭제하고 솔루션을 다시 열면 IntelliSense가 해당 인덱스 파일을 다시 작성하기 시작합니다. 그 후에 문제가 사라질 것입니다.


이것은 Visual Studio Enterprise 2017에서 저에게 효과적이었습니다.

  1. 도구> 옵션> 텍스트 편집기> JavaSCript / TypeScript> Linting> 일반으로 이동합니다.

  2. "ESLint 활성화"선택 해제


프로젝트 / 솔루션을 새로 고치기 만하면됩니다. 해결 될 것입니다.


나는 이것도 겪었고 다음을 수행하여 Visual Studio를 정상 상태로 되돌릴 수있었습니다.

  1. 빨간색 줄이 그어진 코드의 출처를 확인하십시오.
  2. 사용중인 참조에서 빨간색 선 프로젝트를 제거합니다 (ProjectName \ References-오른쪽 클릭, 참조 추가, 빨간색 선 프로젝트 선택 취소).
  3. 빌드 (지금 오류가 발생해야 함)
  4. 방금 제거한 프로젝트 참조를 다시 추가하십시오.
  5. 다시 빌드
  6. 빨간 선을 제거하고 프로젝트를 빌드해야합니다!

Perhaps It is late to add but hope it might still help someone. I had similar problem when I was seeing lot of red squiggles in couple of files. I tried all answers proposed above but nothing seemed to work. The moment I started browsing through the classes, structures in other files for which complaining files had references, problem disappeared. It seemed intellisense was not able to resolved dependencies on its own for some reason.


For me, I had at one time enabled fusion logging to debug some assembly dependency errors (fuslogvw from CMD prompt). That was months ago and I had been experiencing much slower build times (5-7 minutes) since then. I had also forgotten entirely that I had left them enabled. These logs were my bottle neck and disabling them has made iterating much faster. Hope this helps someone!


I ran into this problem with the latest Visual Studio 2017.
Also the debug version of my program was running painfully slow.

I deleted the Solution file .sln and created a new one.


Steps that work

  1. Open Solution and do a re build all
  2. Close Solution
  3. Open solution and do a clean
  4. Close solution
  5. Open solution and do a re build all
  6. Close and then open solution and it should be good. This works for me every time

Careful deleting some of these settings files as you will lose saved debug settings etc and it may do more damage than you realize


I had the same problem with lots of red lines in several *cpp source files. Though the code compiled perfectly. None of the other solutions worked for me.

Changing the order of #include lines of a *.cpp-file could make the red lines dissapear - and reapper with the restored order.

Then I noticed a header file was included twice in a single *.cpp file. I removed the second one and - everything was fine.

Including a header file twice in the same *.cpp file seems to be no problem to the compiler but to the intellisense part.

참고URL : https://stackoverflow.com/questions/21098333/visual-studio-compiles-fine-but-still-shows-red-lines

반응형