I have got a big ASP.NET Website (so no designer.cs files), which I lately have converted from VS2012 to VS2017. Now in VS2017 dozens of Intellisense errors like
CS0103 The name 'DDLxyz' does not exist in the current context
CS0103 The name 'CBxyz' does not exist in the current context
appear in the error list. These did not appear in VS2012. These are no real errors, but invalid Intellisense errors, which I do know because of
a) The site works. All the "not existing" controls work flawlessly.
b) The errors disappear from the error list when I select the filter "Build only", they appear when I select the filter "Build + Intellisense".
c) Strange but true: when I double click such an error in the error list, the according aspx.cs file opens in VisualStudio and shortly thereafter, the errors concerning this file vanish from the list and also the red squiggly lines in the file vanish. So somehow VS must know that all these errors are invalid.
What I've got from other similar questions here on SO:
-
Closing and reopening VS, cleaning the solution, rebuilding does not help. In contrary: When I made the errors vanish by applying point (c) above and do a clean solution and rebuild, the errors show up again. Sometimes.
-
A workaround recommends 'Use the "Build only" filter' in the error list. This works, but i am not content with it. I'd like to have other Intellisense errors shown.
-
A workaround recommends disabling the error CS0103 via the filter options. I found no way to do this in my version of VS2017 v 15.9.14. I found no way to disable just CS0103 in a website project. The filter options do only show "error, warning, message" but no single error numbers.
(If it was possible, I wouldn't like the solution too much, as there might be real errors of this kind be filtered away. But I'd nevertheless take this workaround.) -
Some recommend to rebuild the designer.cs file. But this is a website project, there are no designer.cs files at all.
I don't want these invalid errors to show up in the error list.
If there is no other way, I would also use a possibility to switch off all CS0103 errors for this project.
Aucun commentaire:
Enregistrer un commentaire