More in this section

Forums / Developing with Sitefinity / EventsManager Issues

EventsManager Issues

4 posts, 0 answered
  1. mcpdinkansas
    mcpdinkansas avatar
    102 posts
    Registered:
    22 Mar 2007
    10 Mar 2009
    Link to this post
    We have been having problems integrating the EventsManager into another project we have associated to the Sitefinity project.

    We always get this error:

    System.TypeInitializationException: The type initializer for 'Telerik.Events.EventsManager' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.Events.EventsManager..cctor() --- End of inner exception stack trace --- at Telerik.Events.EventsManager..ctor(String providerName) at _Default.Page_Load(Object sender, EventArgs e)

    When the line of code is:

    EventsManager eventsManager = new EventsManager("Events");

    I can provide test site if needed. Let me know and i will .zip up.

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    11 Mar 2009
    Link to this post
    Hi mcpdinkansas,

    I am not sure how you have configured the both projects. It seems that there is problem related to EventsManager constructor.
    There are two suggestions that I could come up.

    First: Check whether your web. config file is set appropriately and it has all parts that are related to Events. Make sure that the web.config is accessible and not isolated( you can run the project and manage it).

    ..... 
        ..... 
     
    <sectionGroup name="telerik"
     
        .... 
           type="Telerik.Cms.Engine.Configuration.SectionHandler, Telerik.Cms.Engine" requirePermission="false" /> 
            ..... 
     
     <cmsEngine defaultProvider="Generic_Content"
          <providers> 
            <clear /> 
                     ..... 
            <add name="Events" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/Events" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Events.Data.DefaultEventsProvider, Telerik.Events.Data" /> 
          </providers> 
          <rssProviders> 
     
    ....  
    <metaFields> 
     
     <add key="Events.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
            <add key="Events.Street" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
            <add key="Events.City" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
            <add key="Events.Country" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
            <add key="Events.State" valueType="ShortText" visible="True" searchable="True" sortable="False" defaultValue="" /> 
            <add key="Events.Geomapping_Data" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Event_Start" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" /> 
            <add key="Events.Event_End" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" /> 
            <add key="Events.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" /> 
            <add key="Events.Expiration_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Max" /> 
            <add key="Events.Contact_Name" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Contact_Email" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Contact_Phone" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Contact_Cell" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Contact_Web" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
            <add key="Events.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
          </metaFields> 
     
                 ..... 
     
        <events defaultGenericProvider="Events" googleMapsAPIKey="" googleMapsAPIUrl="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=" yahooMapsAPIKey="" yahooMapsAPIUrl="http://api.maps.yahoo.com/ajaxymap?v=3.7&amp;appid=" liveSearchMapsAPIUrl="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"
          <genericContentProviders> 
            <add providerName="Events" publicationDateField="Publication_Date" expirationDateField="Expiration_Date" eventStartField="Event_Start" eventEndField="Event_End" streetField="Street" cityField="City" countryField="Country" stateField="State" geomappingDataField="Geomapping_Data" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" /> 
          </genericContentProviders> 
        </events> 
             .... 
     
     <workflow deleteOnCompletion="true" defaultProvider="NolicsWorkflowProvider"
          <providers> 
            <clear /> 
            <add name="NolicsWorkflowProvider" connectionStringName="DefaultConnection" type="Telerik.Workflow.NolicsWorkflowProvider, Telerik.Workflow" /> 
          </providers> 
        </workflow> 
     
    ....... 


    Second:  Create Web Services that will transfer data to Sitefinity and communicate with your custom site - so you are not calling EventsManager directly. Check out attached graphic.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. mcpdinkansas
    mcpdinkansas avatar
    102 posts
    Registered:
    22 Mar 2007
    11 Mar 2009
    Link to this post
    Hey Ivan,

    Thanks for your reply.

    It was indeed the web.config variables that were missing from the additional project.


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    11 Mar 2009
    Link to this post
    Hi mcpdinkansas,

    I am glad to hear that you have found the missing parts.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered