Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Controls Not Recognized

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?

like image 959
Liam Avatar asked Dec 10 '22 15:12

Liam


2 Answers

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.

like image 164
DOK Avatar answered Dec 22 '22 00:12

DOK


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.

like image 32
Zsapi Avatar answered Dec 22 '22 00:12

Zsapi