Thanks Nik,
This is my entire app.config file as I have it now, I started off, with the entire web.config file placed into my app.config file. But not I have cut it back to (see end of post) .
Are there other examples out there on how to call the API from NON-WEB project?
Regards, Chris.
The code I am executing is:
public VEMS_DNN_Synchroniser()
{
mController = new TabController();
mPortalID = 0;
DataProvider provider = DotNetNuke.Data.DataProvider.Instance();
mHome = mController.GetTabByName("Home", mPortalID);
}
The exception I get is :
System.TypeInitializationException was unhandled
Message="The type initializer for 'DotNetNuke.Data.DataProvider' threw an exception."
Source="DotNetNuke"
TypeName="DotNetNuke.Data.DataProvider"
StackTrace:
at DotNetNuke.Data.DataProvider.Instance()
at ENERG.VEM.DNN.VEMS_DNN_Synchroniser..ctor() in C:\Code\VEMS2005\DNN_VEM_BusinessLogic\VEMS_DNN_Synchroniser.cs:line 25
at EnergAnalysisHostApp.Form1.btnDNN_Click(Object sender, EventArgs e) in C:\Code\VEMS2005\EnergAnalysisHostApp\Form1.cs:line 189
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at EnergAnalysisHostApp.Form1.Main() in C:\Code\VEMS2005\EnergAnalysisHostApp\Form1.cs:line 141
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- register local configuration handlers -->
<configSections>
<sectionGroup name="dotnetnuke">
<section name="data" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke"/>
</sectionGroup>
</configSections>
<connectionStrings>
<add name="SiteSqlServer" connectionString="Server=brighton;Database=DotNetNukeDevelopment;uid=dnn;pwd=dnn;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<add key="SQLConnectionString" value="User Id=dnnapp;Password=dnnApp;data source=brighton;initial catalog=vem" />
<add key="SiteSqlServer" value="Server=brighton;Database=DotNetNukeDevelopment;uid=dnn;pwd=dnn;"/>
</appSettings>
</configuration>