I will talk about my case and what worked for me. I have a project that worked fine. For some known reason, he received a compilation / build error. I have user controls in the Management folder. After processing the compilation error for web handlers, I received a new set of errors for each user control in the Management folder. I tried many things, including deleting the constructor file (and creating another empty one), the error I received could not load the type "Name.Of.Class" (in the line of the directive # 1 <% @ Control%>).
My solution was: I added another parallel control named OriginalControlName2.ascx. Then I copied all the content from @ .ascx to @ 2.ascx and the same for ascx.cs. So far so good, don't compile the error for the new page / control. Then exclude the source file and change the file name # 2 to the original name. The error list has dropped to zero.
With all my experience, I don't know what the problem is, but I got a fix.
************** UPDATE ****************
every time I finish a set of files, it continues to the rest. I found that the <% @ Page / WebHandler / Control /%> directive has a CodeBehind attribute. When I changed it to CodeFile, the error disappeared from the list. This is much shorter than adding a new file and moving all the code.
Good luck.
source share