question

BartoszZgodziski-7965 avatar image
0 Votes"
BartoszZgodziski-7965 asked TianyuSun-MSFT commented

Visual Stidio 2019 is not showing compilation erros

I'm working with my code and everything works fine. At certain moment VS stops detecting errors. They are not underlined, and NOT showing in ERROR window. If I restart VS it starts working again. What is more frustrating if I have 2 VS open, when it stops working, it will stop working in all open VS. I have to close all of them to make it work again.

85821-vs2019-bug-1.png


85822-vs2019-bug-2.png


dotnet-csharpvs-msbuild
vs2019-bug-1.png (47.3 KiB)
vs2019-bug-2.png (11.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Do you have some additional extensions, and did you try to disable them?

0 Votes 0 ·

No, I do not install any additional extensions. The problem starts about 2-3 weeks ago. I've tried updating VS to latest version but this did not help.

0 Votes 0 ·
TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered

Hi @BartoszZgodziski-7965 ,

Welcome to Microsoft Q&A forum.

If I restart VS it starts working again.

Do you mean after restarting VS your project can be built successfully? And does this issue appear randomly?

I suggest you try to clean the project and VS cache and then try to build again. Please follow these steps:

1). Close every instances of VS and go to your solution folder, delete(or rename) the bin, obj and the hidden .vs folder.

2). Go to this path: C:\Users\[user name]\AppData\Local\Microsoft\VisualStudio\16.0_XXXXX, then delete(or rename) every folders named ComponentModelCache, after that restart VS 2019 and rebuild your project to see if this issue disappear.

Feel free to let me know the results.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BartoszZgodziski-7965 avatar image
0 Votes"
BartoszZgodziski-7965 answered

The problem is not with building but showing errors. If I correct errors project can be build. In my opinion there is some process that is responsible for real time bug search. If I write something silly in editor like "this is not a code" normally this text will be immediately underlined and an error will appear in error window even without compilation. But sometimes this stops working. After restarting all VS it is working again. Sometimes it is OK for 4h sometimes for 30 minutes.
I will try to delete this files.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BartoszZgodziski-7965 avatar image
0 Votes"
BartoszZgodziski-7965 answered TianyuSun-MSFT commented

I removed .vs folder and ComponentModelCache. I didn't remove obj as I have about 25 projects and I will take some time to do this. The problem occur again. Is there some log file that I could check? I will try to remove obj dirs.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @BartoszZgodziski-7965 , thank you for your feedback.

The ActivityLog.xml file may be helpful to check(run devenv.exe /log in Developer Command Prompt for VS 2019 and close VS after you reproduce this issue, you can find the xml file under %AppData%\Microsoft\VisualStudio\16.0_<UniqueID>).

From your above description, looks like this is a potential issue, if delete obj, bin and .vs folders, delete ComponentModelCache files didn’t work and there isn’t any related error information in ActivityLog.xml file, then I strongly suggest you directly report this issue to VS Product team in Developer Community from Visual Studio > Help > Send Feedback > Report a Problem…

If you do report this issue, please share the link here, other forum members, include me, who are interested or meet the same or similar issues can go to vote for this thread.

0 Votes 0 ·
BartoszZgodziski-7965 avatar image
0 Votes"
BartoszZgodziski-7965 answered

I think I have found how to reproduce error. I start debugging (F5). The program is running. Than I go to VS while the program is rugging and modify code. Than error detection stops working. I don't know why VS allows me to edit files. In previous version (vs 2017) the files were in read only mode while debugger was rugging. Only when the debugger hits breakepoint I was able to modify code. Any suggestions?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

BartoszZgodziski-7965 avatar image
0 Votes"
BartoszZgodziski-7965 answered TianyuSun-MSFT commented

Is it possible to make files read only while debugger is running?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @BartoszZgodziski-7965 , AFAIK, it is not available to make files fully read only while debugging in VS 2019. But perhaps these options will help:

1). Disable Enable Edit and Continue option from Tools > Options > Debugging > General.(Edit and Continue)

2). Enable Require source files to exactly match the original version from Tools > Options > Debugging > General.(Require source files to exactly match the original version)

0 Votes 0 ·