Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Writing Search Provider - Type Initializer Cannot Create ObjectWriting Search Provider - Type Initializer Cannot Create Object
Previous
 
Next
New Post
12/11/2006 11:10 AM
 
I am getting the following error whenever I try to view a page using my newly created Search Provider for DotNetNuke.  Actually, I just wanted to begin debugging it, but I cannot get past this right now.  I used the SearchDataStore.vb as an example for my provider since it obviously works.  I inherited the SearchDataStoreProvider class and made use of each of the three abstract methods.  I still get this error below.  It is telling me that I am missing a method, but I have no idea what method I might be missing.  Can someone please help me troubleshoot this or shed some light on this?  I am doing this on a clean install of DNN v4.3.5 & SQL 2005.

DotNetNuke.Services.Exceptions.PageLoadException: The type initializer for 'DotNetNuke.Services.Search.SearchDataStoreProvider' threw an exception. ---> System.TypeInitializationException: The type initializer for 'DotNetNuke.Services.Search.SearchDataStoreProvider' threw an exception. ---> System.MissingMethodException: Cannot create an abstract class. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at DotNetNuke.Framework.Reflection.CreateObject(String TypeName, String CacheKey, Boolean UseCache) in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Shared\Reflection.vb:line 254 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Shared\Reflection.vb:line 189 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, Boolean UseCache) in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Shared\Reflection.vb:line 76 at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType) in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Shared\Reflection.vb:line 60 at DotNetNuke.Services.Search.SearchDataStoreProvider.CreateProvider() in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Providers\Search\SearchDataStoreProvider.vb:line 39 at DotNetNuke.Services.Search.SearchDataStoreProvider..cctor() in C:\DNNPortals\DevSite_v4.3.5\Library\Components\Providers\Search\SearchDataStoreProvider.vb:line 34 --- End of inner exception stack trace --- at DotNetNuke.Services.Search.SearchDataStoreProvider.Instance() at DotNetNuke.Modules.WhatsNew.WhatsNew.BindData() at DotNetNuke.Modules.WhatsNew.WhatsNew.Page_Load(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

The line 34 in SearchDataStoreProvider.vb is:

Line 32:  ' constructor
Line 33:  Shared Sub New()
Line 34:       CreateProvider()
Line 35:  End Sub

I have mimicked in my provider the following:

Namespace SSD.Providers.Search

   
Public MustInherit Class GoogleSearchProvider
       
Inherits DotNetNuke.Services.Search.SearchDataStoreProvider

' singleton reference to the instantiated object
Private objProvider As GoogleSearchProvider = Nothing

' constructor
Sub New()
   
Me.CreateProvider()
   
Me.SearchInfo = New SearchInfo
End Sub

' dynamically create provider
Private Sub CreateProvider()
   
' also tried with this
    'objProvider =
CType(DotNetNuke.Framework.Reflection.CreateObject(Me.Type), SearchDataStoreProvider)
    'objProvider =
CType(DotNetNuke.Framework.Reflection.CreateObject("searchDataStore"), SearchDataStoreProvider)
    'objProvider = CType(DotNetNuke.Framework.Reflection.CreateObject("searchDataStore"), GoogleSearchProvider)
    objProvider =
CType(DotNetNuke.Framework.Reflection.CreateObject(Me.Type), GoogleSearchProvider)
End Sub

' return the provider
Public Shadows Function Instance() As GoogleSearchProvider
   
Return CType(Me.objProvider, GoogleSearchProvider)
End Function

Private _ProviderName As String = "SSDGoogleSearchProvider"
Private _ProviderType As String = "SSD.Providers.Search.GoogleSearchProvider, SSD.Providers.GoogleSearch"

Public ReadOnly Property Name() As String
   
Get
        Return Me
._ProviderName
   
End Get
End Property


Public ReadOnly Property Type() As String
   
Get
        Return Me
._ProviderType
   
End Get
End Property


Please help...   :)

Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Writing Search Provider - Type Initializer Cannot Create ObjectWriting Search Provider - Type Initializer Cannot Create Object


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out