I just installed the release version of Visual Studio 2010, and it looks like there's something wrong with the standard ASP.NET server controls.
When I create a basic server control, such as a TextBox, the editor underlines it in green and says (I also get no intellisense for ASP.NET controls):
Element 'TextBox' is not a known element. This can occur if there is a compilation
error in the Web site, or the Web.config file is missing.
The web site builds fine, and the Web.config file is not missing:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
</system.web>
</configuration>
The controls work just fine in the code-behind, and they function correctly when I run the site.
Is there some configuration problem here?
This person who's a tester on the Visual Web Developer Team offered this workaround, which apparently worked:
Close VS, delete schema cache, and re-open VS. You can find the schemas under something like:
C:\Users\Pavel\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas
It is safe to delete all files in this folder.
I've encountered the same problem, but deleting the cache didn't solve it for me.
However based on the other answer, I modified the already set master page path in the .aspx file (MasterPageFile="~/MasterPage.master") to something nonexistent, saved the file, then changed it back to the original path. After this the underlining was gone, and intellisense worked properly.
Funny that this is still a thing 2020. Using VS2019 Community.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With