Search code examples
asp.net

asp.net cannot publish the asp namespace?


I use some statement with asp namespace, that likes ASP.controls1 when build, it is fine, and works well. but when i publish, that is one error:

Error 120 c:\Projects\TideWeb\Controls\Common\ExceptionHelper\ExceptionHelper.ascx.cs(53): error CS0234: The type or namespace name 'controls_common_errorlist_errorlist_ascx' does not exist in the namespace 'ASP' (are you missing an assembly reference?)


Solution

  • Without example code, i try to help you by listing all error that i found in my way with the ASP namespace.

    1) The UserControl 'ExceptionHelper.ascx.cs' is not used in current Page/UserControl. You can try it: the ASP namespace appears in intellisense only if one or more UserControl are mentioned in the current page (or UserControl). If your code of mentioned UserControl contains compilation error, intellisense (and the compiler) ignore its name. Fix the compilation error, and the name of your control get back.

    2) The UserControl is registered into web.config file, and is used in a page (or UserControl) in the same directory. In this case you must re-register in the current page your UserControl by this tag:

    <%@ Register Src="~/MyControls/MyControl.ascx" TagPrefix="MyControls" TagName="MyControl" %>
    

    Add this tag, and the error was fixed.

    3) You mentioned:

    "but when i publish, that is one error"

    In some cases, my webApps won't compile correctly in the destination server, but in test all works well.

    That compilation error can be a configuration error, permission of Temporary ASP.NET Directory, and the identity used by Application Pool.

    If you can post some code, i could help you better.