Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike 23 posts 86 karma points
    Nov 30, 2010 @ 17:47
    Mike
    0

    Strange HttpParseException Errors with simple User Control

    I am currently working on a simple .NET user control for Umbraco, and after adding my ascx and dll files in the correct places my site produces the following error:

    Error creating control (/usercontrols/PartnersForm.ascx).
    Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!

    After browsing the properties of the ascx file from within Umbraco the following error was given.

    System.Web.HttpParseException: The file '/usercontrols/Forms/PartnersForm.ascx.cs' does not exist. ---> System.Web.HttpParseException: The file '/usercontrols/Forms/PartnersForm.ascx.cs' does not exist. ---> System.Web.HttpException: The file '/usercontrols/Forms/PartnersForm.ascx.cs' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.UI.TemplateParser.ProcessCodeFile(VirtualPath codeFileVirtualPath) at System.Web.UI.TemplateParser.ProcessMainDirectiveAttribute(String deviceName, String name, String value, IDictionary parseData) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath) at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)

    Rather than post my full code here I've added my ascx.cs code to this Pastebin post, omitting important strings. Can anyone shed some light on this problem? I'm running v4.0.2.1 and if I remember correctly we're running .NET 2.0 on the server.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 30, 2010 @ 18:39
    Stefan Kip
    0

    I guess this is related to the usercontrol directive in your ascx file. Are you using CodeFile="" instead of CodeBehind=""?

  • Mike 23 posts 86 karma points
    Dec 01, 2010 @ 10:34
    Mike
    0

    I was, but now I am using CodeBehind and I'm still receiving the same error.

    Could it be because I have converted the solution containing the ascx file in VS2010 to .NET version 2?

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Dec 01, 2010 @ 10:38
    Stefan Kip
    0

    I'm sorry, but I really don't have any other clues...
    It shouldn't look for the code-behind as long as the code is compiled in your DLL and the DLL is placed in the website root's bin folder...

  • Mike 23 posts 86 karma points
    Dec 01, 2010 @ 12:01
    Mike
    0

    I've found the problem to be what seems like a dodgy VS2010 installation. I just moved the code to another solution on a different machine and it builds the correct binary file. Thanks for the help!

Please Sign in or register to post replies

Write your reply to:

Draft