Jobs Module Resources error - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Jobs Module Resources error

  • Jobs Module Resources error
  • Hi,

    I've just followed the Jobs Module example word for word. I have managed to register the module, however when I try to go to it I get the error message:

    Could not find the specified key "FirstName" or class id "JobsResources".


    [ArgumentException: Could not find the specified key "FirstName" or class id "JobsResources".]
       Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, String key, CultureInfo culture, Boolean falback, Boolean throws) +455
       Telerik.Sitefinity.Localization.Res.Get(String classId, String key, CultureInfo culture, Boolean fallback, Boolean throws) +168
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +92


    [TemplateException: A resource file with the specified class ID "JobsResources" was not found. This class ID declaration appears in Jobs.Resources.Views.JobApplicationsOverviewTemplate.ascx.]
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +229
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(PropertyDescriptor descriptor, Control bindingContainer) +53
       Telerik.Sitefinity.Web.UI.Templates.Attribute.SetAttribute(Object component, Control bindingContainer, Boolean bound) +167
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +203
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.CollectionBuilder.SetCollection(IList list, Control bindingContainer) +151
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +727
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +759
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +687
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer, PlaceHoldersCollection placeHolders) +18
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.RootBuilder.CreateChildControls(Control parent, Control bindingContainer) +269
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container, PlaceHoldersCollection placeHolders) +88
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container) +6
       Telerik.Sitefinity.Web.UI.SimpleView.CreateContainer(ITemplate template) +35
       Telerik.Sitefinity.Web.UI.SimpleView.get_Container() +33
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +46
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

    I have set both templates to be embedded resources so I can't really see anything else that could be producing the error.

    Any ideas? Did anyone else get this error?

    Thanks in advance
    higgsy
    [ArgumentException: Could not find the specified key "FirstName" or class id "JobsResources".]
       Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, String key, CultureInfo culture, Boolean falback, Boolean throws) +455
       Telerik.Sitefinity.Localization.Res.Get(String classId, String key, CultureInfo culture, Boolean fallback, Boolean throws) +168
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +92
    
    [TemplateException: A resource file with the specified class ID "JobsResources" was not found. This class ID declaration appears in Jobs.Resources.Views.JobApplicationsOverviewTemplate.ascx.]
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +229
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(PropertyDescriptor descriptor, Control bindingContainer) +53
       Telerik.Sitefinity.Web.UI.Templates.Attribute.SetAttribute(Object component, Control bindingContainer, Boolean bound) +167
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +203
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.CollectionBuilder.SetCollection(IList list, Control bindingContainer) +151
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +727
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +759
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +687
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer, PlaceHoldersCollection placeHolders) +18
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.RootBuilder.CreateChildControls(Control parent, Control bindingContainer) +269
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container, PlaceHoldersCollection placeHolders) +88
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container) +6
       Telerik.Sitefinity.Web.UI.SimpleView.CreateContainer(ITemplate template) +35
       Telerik.Sitefinity.Web.UI.SimpleView.get_Container() +33
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +46
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
    [ArgumentException: Could not find the specified key "FirstName" or class id "JobsResources".]
       Telerik.Sitefinity.Localization.Resource.GetString(ResourceDataProvider provider, String classId, String key, CultureInfo culture, Boolean falback, Boolean throws) +455
       Telerik.Sitefinity.Localization.Res.Get(String classId, String key, CultureInfo culture, Boolean fallback, Boolean throws) +168
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +92
    
    [TemplateException: A resource file with the specified class ID "JobsResources" was not found. This class ID declaration appears in Jobs.Resources.Views.JobApplicationsOverviewTemplate.ascx.]
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(SubstitutionItem subst, Control bindingContainer) +229
       Telerik.Sitefinity.Web.UI.Templates.Attribute.GetValue(PropertyDescriptor descriptor, Control bindingContainer) +53
       Telerik.Sitefinity.Web.UI.Templates.Attribute.SetAttribute(Object component, Control bindingContainer, Boolean bound) +167
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +203
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.CollectionBuilder.SetCollection(IList list, Control bindingContainer) +151
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +727
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.PropertyBuilder.SetProperty(Object component, Control bindingContainer) +759
       Telerik.Sitefinity.Web.UI.Templates.PropertiesBuilder.SetProperties(Object component, Control bindingContainer) +183
       Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.CreateObject(Control bindingContainer, PlaceHoldersCollection placeHolders) +687
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer, PlaceHoldersCollection placeHolders) +18
       Telerik.Sitefinity.Web.UI.Templates.ControlBuilder.CreateControl(Control bindingContainer) +12
       Telerik.Sitefinity.Web.UI.Templates.RootBuilder.CreateChildControls(Control parent, Control bindingContainer) +269
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container, PlaceHoldersCollection placeHolders) +88
       Telerik.Sitefinity.Web.UI.StringTemplate.InstantiateIn(Control container) +6
       Telerik.Sitefinity.Web.UI.SimpleView.CreateContainer(ITemplate template) +35
       Telerik.Sitefinity.Web.UI.SimpleView.get_Container() +33
       Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +46
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
  • Hi higgsy,

    Please, check if the JobsResources class contains public string property named "FirstName".

    Kind regards,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Hi Pavel, Thanks for your response. Yes it does, my code is a copy and paste from the jobs module PDF included in the sdk. I have literally built it, included it in my main sitefinity web app, and received the error. The error message is indicating it cannot find the JobsResources class. Thanks Higgsy
  • Hello Higgsy,

    Did you manage to solve the problem?

    Kind regards,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Hi Pavel,

    No I havent. The problem appears to be that the JobsResources class cannot be found - and I have no idea why, its part of the same namespace afterall.

    Any ideas?

    Thanks
    higgsy
  • Hello Higgsy,

    Do you have the registration code of the resource class in the Initialize method of the module?
    Something like:

    Res.RegisterResource<ProductsResources>()


    Kind regards,
    Pavel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  • Picking up where Higgsy left off since he has the same exact problem that I encountered, yes I have Res.RegisterResource<JobsResources>(); in the Initialize method of JobsModule.cs.

    What now?
  • Hello Suzanne,

    Can you please check the SDK which comes with SP1 - we have the exact sample which should be working fine.

    Greetings,
    Pavel
    the Telerik team
  • Picking up where Suzanne left off

    I compiled from default example and got this problem
  • Hello Suzanne,

    The Jobs sample works fine at my end. The error you are getting is thrown, because the application cannot find the resource declared inside

    Jobs Intermediate\Resources\Views\JobApplicationsOverview.ascx

    <telerik:GridBoundColumn DataField="FirstName" HeaderText="<%$ Resources:JobsResources, FirstName %>" />

    The resource is registered when the module is initialized

    public override void Initialize(ModuleSettings settings)
           
                base.Initialize(settings);
                Config.RegisterSection<JobsConfig>();
                Res.RegisterResource<JobsResources>();
           

    Can you remove the Jobs module ( or use a new project) and put a breakpoint inside Initialize method to see whether the resource gets registered?

    It looks like there was an issue when you had tried to install the module. I do not see other explanation for the behavior you see.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  • I am having the same problem as they all do 
    I think there must be some step missing int the documentation ... I still can not find the solution 

    so any help
  • Hello Suzanne,

    I checked the SDK samples today ( 4.1) release and I wasn't able to replicate issues. Can you give a try using the new SDK and a new project? Please make sure that you have not modified any of module files.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
  • Hi,

    I have the same problem, please take a look at my findings see if it helps and if you can pick up ...
    I'm working with SDK 4.1 and the Jobs sample and it worked fine at first: I setup a solution with both Jobs project (as in the sample) and the website (with a simple homepage).
    I added a reference to the project in my Sitefinity bin folder and registered the module - and at first it worked.

    I made a small markup change  and rebuilt the jobs project and I broke the module functionality.
    I think it has to do with the fact that at every build, the version of my Jobs assembly changes.

    1. Is there a way to keep in the same solution the website and the module project? I'm new to developing modules and I'm not aware of another way to test my modules.

    2. If I only add the Jobs.dll to the bin folder (as suggested in the documentation) and develop my module in another solution do i have to unregister the module every time I need to make a change?

    Any help will be greatly appreciated.

    Thank you,
    Ancuta
  • Hi There,

    I have the same behaviour as Ancute Me. The first build was fine, but as soon as I update my code and rebuild my project, I get the same error. 

    Regards,
    Jean Erasmus