Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Console Application Error View modes: 
User avatar
Member
Member
asovrano-opera21 - 6/11/2013 5:34:49 AM
   
Console Application Error
Dear sir, This runtime error occurs when trying to access the InfoProviders methods:
System.Exception occurred
Message=[SystemMethods]: System events are not initialized. You must call CMSContext.Init() before running any of your methods. In web application, the web.config file must contain registration for the CMSApplicationModule: <add name="CMSApplicationModule" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper"/>.
Source=CMS.SettingsProvider
StackTrace:
in CMS.SettingsProvider.SystemMethods.NotInitialized()
in CMS.SettingsProvider.SystemMethods.GetAutomaticQuery(String queryName)
in CMS.SettingsProvider.QueryProvider.GetQuery(String queryName, Boolean throwException)
in CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(String queryName, QueryDataParameters parameters, String columns, String where, String orderBy, Int32 topN)
in CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(String queryName, QueryDataParameters parameters, String columns, String where, String orderBy, Int32 topN, Int32 offset, Int32 maxRecords, Int32& totalRecords)
in CMS.SettingsProvider.AbstractProvider.GetData(QueryDataParameters parameters, String where, String orderBy, Int32 topN, String columns, Boolean binaryData, Int32 offset, Int32 maxRecords, Int32& totalRecords, Int32 siteId)
in CMS.SettingsProvider.AbstractProvider.GetData(QueryDataParameters parameters, String where, String orderBy, Int32 topN, String columns, Boolean binaryData, Int32 siteId)
in CMS.SettingsProvider.AbstractProvider.GetData(QueryDataParameters parameters, String where, String orderBy, Int32 topN, String columns, Boolean binaryData)
in CMS.SettingsProvider.AbstractProvider.GetDataByIntColumn(String columns, String columnName, Int32 value)
in CMS.DataEngine.AbstractInfoProvider`2.GetDataByIntColumn(String columnName, Int32 value)
in CMS.DataEngine.AbstractInfoProvider`2.GetInfoByIntColumn(String columnName, Int32 value)
in CMS.DataEngine.AbstractInfoProvider`2.GetInfoById(Int32 id, Boolean useHashtable)
in CMS.DataEngine.AbstractInfoProvider`2.GetInfoById(Int32 id)
in CMS.SiteProvider.RoleInfoProvider.GetRoleInfoInternal(Int32 roleId)
in CMS.SiteProvider.RoleInfoProvider.GetRoleInfo(Int32 roleId)
in Opera21.JollyTicket.Services.Flights.OrdersExportManager.getCustomer(OrdersDto order, FlightBookingInformation bookingInformation) in D:\GIT_src\web-projects.JT\Framework\Opera21.JollyTicket.Services\Flights\FlightBooking\OrdersExportManager.cs:riga 256
InnerException:

The problem is: I've executed CMSContext.Init() before
BUT
it does not seem to be enought. Does it need some kind of configuration in app.config or can you figure out what is wrong using the APIs

Thank you very much in advance for your help
Andrea

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/11/2013 6:16:00 AM
   
RE:Console Application Error
It appears you are missing some references (Kentico dll's) in your console application. Suggest adding a reference to them and trying again.

User avatar
Member
Member
asovrano-opera21 - 6/11/2013 7:31:00 AM
   
RE:Console Application Error
Dear FroggEye, the solution builds, this is a runtime error. I cannot figure out which assembly is missing. Actually I'm referencing:
CMS.CMSHelper
CMS.DataEngine
CMS.DataProviderSQL
CMS.DocumentEngine
CMS.EventLog
CMS.GlobalHelper
CMS.LicenseProvider
CMS.PortalControls
CMS.SettingsProvider
CMS.SiteProvider
CMS.Synchronization
CMS.SynchronizationEngine
CMS.VirtualPathHelper
Lucene.Net
System
System.configuration
System.Core
System.EnterpriseServices
System.Runtime.Serialization
System.ServiceModel
System.Web.Services
System.Xml.Linq
System.Data.DataSetExtensions
Microsoft.CSharp
System.Data
System.Xml
.

I only want to access the sql database and use the various ..InfoProvider methods available in Kentico APIs.

Thank you very much for your help, Kind Regards
Andrea