+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Compiler Error Message: The compiler failed with error code 1.

Compiler Error Message: The compiler failed with error code 1.

7 posts, 0 answered
  1. Eric
    Eric avatar
    1 posts
    Registered:
    10 Mar 2008
    03 Jun 2008
    Link to this post
    Hello!

    For the past two days I've been creating several model admin "stubs". They're very basic - create a new module, set up a blank command panel and control panel, and once the stubs are all created, they will be divided up amongst the developers and be completed.

    So, I created one very simple module, and it works just fine. It doesn't *do* anything, but it shows up in the Sitefinity modules section of the admin, as well as in the toolbox. That works great.

    To create the other stubs, I would simply duplicate the files associated with this first one: the WhateverModule.cs file in the App_Code folder that declares the module, and then a WhateverModule folder which holds an Admin folder, which holds ControlPanel.ascx and CommandPanel.ascx as well as their codebehind files. I then go through and refactor classes, paths, etc so each module is independent and I'm not redeclaring classes or anything.

    This has worked successfully for three of these stubs. However, I just created two more and they are not working. Unfortunately, there is no helpful error message - all I get is this:

    "Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: The compiler failed with error code 1."

    That's it. Below that I can view the "detailed" error message, and it says this:

    "
    c:\work\dotnet\projects\projectName\ProjectName.Web\WhateverModule\Admin\ControlPanel.ascx.cs(912305,33): error CS0115: 'ASP.whatevermodule_admin_controlpanel_ascx.FrameworkInitialize()': no suitable method found to override"

    Now, I don't have 912305 lines of code :P So I'm not sure what to make of these error messages.

    The two newest modules are both doing this, while the other three still work fine. I would greatly appreciate any advice or insight into this issue you may have. Thank you!

    -Eric Neimeister
    eneimeister@xylemcci.com
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    04 Jun 2008
    Link to this post
    Hi Eric,

    We are closing this thread as we have already posted a reply to your inquiry in the support ticket you opened on the same topic.

    Best wishes,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Matt
    Matt avatar
    16 posts
    Registered:
    29 May 2008
    08 Aug 2008
    Link to this post
    I'm not trying to create a module, but I have created a new User Control that inherits from Telerik.Cms.Engine.WebControls.GenericContent and am getting the same Compilation Error:

    ..\UserControls\MyGenericContent.ascx.cs(912305,33): error CS0115: 
    'ASP.usercontrols_mygenericcontent_ascx.FrameworkInitialize()': no suitable method found to override

    Could you please post the solution to Eric's issue?  I expect we're not the only ones having this problem.

    Thank you!

    - Matt DeKrey
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    11 Aug 2008
    Link to this post
    Hi Matt,

    Please check if the MyGenericContent.ascx user control explicitly derives from the base class System.Web.UI.UserControl:

    .ascx.cs
    public partial class usercontrols_mygenericcontent : System.Web.UI.UserControl  

    Also, make sure that the @Control directive is properly set:

    .ascx
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyGenericContent.ascx.cs" Inherits="usercontrols_mygenericcontent" %>  

    For more information on this matter refer to the following blog post.

    If this does not help, please send us your project to debug the problem locally.

    Thanks for your cooperation in advance.

    Greetings,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Matt
    Matt avatar
    16 posts
    Registered:
    29 May 2008
    12 Aug 2008
    Link to this post
    I am actually inheriting directly from Telerik.Cms.Engine.WebControls.GenericContent, which should inherit from System.Web.UI.UserControl.  That is, my ascx looks as you are suggesting and the class declaration is:
    public partial class usercontrols_mygenericcontent : Telerik.Cms.Engine.WebControls.GenericContent
    I was hoping to be able to override a few methods, such as Render.


  6. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    12 Aug 2008
    Link to this post
    Hi Matt,

    Telerik.Cms.Engine.WebControls.GenericContent is a custom control which does not inherit from UserControl class. Also, if you are using UserControls, you cannot inherit other controls, since User Controls must explicitly inherit from System.Web.UI.UserControl class and in C# it is not possible to inherit from more than one class.

    Therefore, if you are trying to extend GenericContent control the best way would be to create a new Class Library Project, create there a new class and inherit from GenericContent. Obviously, you will not have the benefits of using the visual drag-and-drop interface, but there are ways to work around this through use of templates.

    You can refer to this article in the Developer Manual which explains how to extend ContentView control:
    http://www.sitefinity.com/help/developer-manual/extending-built-in-controls-content-view-control.html

    Even though they are different controls, the principle is exactly the same and I believe it would be very helpful to you in your endeavor to extend GenericContent control.

    I hope you will find this information helpful. Let us know if there is anything else we can do for you.

    Regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Matt
    Matt avatar
    16 posts
    Registered:
    29 May 2008
    12 Aug 2008
    Link to this post
    Thanks, Ivan.

    I didn't realize that GenericContent was built using a different method than UserControl; thank you for the link to the developer manual.  Seems I was going about what I was trying to do the wrong way.

    Thanks again!
Register for webinar
7 posts, 0 answered