I\'ve made a custom control that inherits from a Literal control. When I try and use my control on a page a parsing error is thrown. I\'ve added this to my web.config
<
I also had this problem when publishing my ASP.NET Web Forms application. Even when copying and pasting the folder to the server's IIS, without publishing it, similar problems on pages that used the custom controls / user controls happened systematically.
I registered correctly the controls on web.config and on my dev machine things were working ok. I thought that the registering process was ok.
To fix the problem on publish/copy-and-past deployment process, you should re-register all the user controls's namespaces and assemblies on each page (.aspx) that uses them:
<%@ Register TagPrefix="mycompany" Namespace="MyCompany.Web.Forms.Controls" Assembly="MyCompany.Web" %>
<%@ Register TagPrefix="mycomapny" Namespace="MyCompany.Web.Forms.Controls.ValidatorComponents" Assembly="MyCompany.Web" %>
Please note that it is same mindset for custom controls or user controls. This issue happened even in VS 2012 but still .NET 4.0. This process is also needed when you ASP.NET skin references such controls.