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

Forums / Developing with Sitefinity / "Could not find a type for a name" when changing "pageWorkflowType" to external class

"Could not find a type for a name" when changing "pageWorkflowType" to external class

5 posts, 0 answered
  1. Scott McNeany
    Scott McNeany avatar
    44 posts
    Registered:
    09 Mar 2010
    12 Mar 2010
    Link to this post
    Hello,

    I am working on overriding the default behavior of the Activity class by inheriting from it and changing the "pageWorkflowType" in the web.config to my custom class. This is all documented in http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-notify-roles-that-a-page-has-been-sent-through-workflow.aspx, but this post places the code in the App_Code folder. I got that working correctly. However, when I move the class outside of my solution into a custom DLL, compile, include the DLL as a reference, replace the pageWorkflowType my new class/assembly name (SiteFinityAddOns.CustomPageWorkflow, SiteFinityAddOns), then run my project, I get an error that states:

    Could not find a type for a name.  The type name was 'CustomPageWorkflow, App_Code._33wn8b0, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.


    I know that the assembly name, and the class name are correct, because if I change them, I get different errors.

    Another thing to note is that when the assembly name or the class name are WRONG, i get the error on my %siteroot%/default.aspx page, but when it is right, I only get the error on the %siteroot%/SiteFinity/ page.

    Any ideas? Please help. I really don't want to have to put the code back into the project's App_Code folder.

    Thank you,

    Scott McNeany
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Mar 2010
    Link to this post
    Hi Scott McNeany,

    Thank you for using our services.

    This seems that the application is still trying to load the class used before. Could you please try to clear the temporary ASP.NET files for this project and see what would the result be?

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Scott McNeany
    Scott McNeany avatar
    44 posts
    Registered:
    09 Mar 2010
    16 Mar 2010
    Link to this post
    Yeah, I tried that before and again after you suggested it. No go. It's like one of the Sitefinity DLLs is hard-coding the App_Code portion of the location, and not allowing me to specify that actually assembly name.

    Is there anyone that could confirm that this works/doesn't work for them?

    All help is appreciated.

    Thank you,

    Scott McNeany
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 Mar 2010
    Link to this post
    Hello Scott McNeany,

    There are ASP.NET files or you have some other code that makes reference to this class.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Scott McNeany
    Scott McNeany avatar
    44 posts
    Registered:
    09 Mar 2010
    16 Mar 2010
    Link to this post
    Yes, below is the web.config reference to that I am using to access my custom workflow class.

    <

     

    add connectionStringName="DefaultConnection" allowPageHistory="true" allowPageWorkflow="true" pageWorkflowType="SiteFinityAddOns.Workflow.CustomPageWorkflow, SiteFinityAddOns.Merge.dll" cachingProviderName="ASPNET" name="Sitefinity" type="Telerik.Cms.Data.DefaultProvider, Telerik.Cms.Data" applicationName="/StopLoss"/>

    If I put the "CustomPageWorkflow" class back into the App_Code folder and change the reference back to pageWorkflowType="CustomPageWorkflow", it works.

    However, this requires me to include the actual code in all Sitefinity projects (~ 5 different projects) instead of just including the reference to the DLL in all projects.

    If it helps, the start of the class is seen below just for reference:

     

    public

     

    class CustomPageWorkflow : PageWorkflow

     

     

     

     

     

    {

     

    protected override void LoadActivities()

     

    {

     

    // Step 1: wait to send for approval

     

     

     

     

     

     

    //****************************************************************

     

     

     

     

     

     

    ListenActivity listen = Activity.Load<ListenActivity>(base.Transaction);

     

     

    base.AddActivity(listen);

     

     



    Like I said, the code works great when it is in App_Code, and not when it is in the external DLL.

     



    Thank you,

    Scott

     

Register for webinar
5 posts, 0 answered