Hi, I am trying to write some utilities outside of GSP... I found the template on another link and am using below to start... It is not finding the startup configuration information. I have tried every variant I can think of ; I have all the right references to the GSP dlls. Any thoughts?
'Error I get...
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="GalleryServerPro.Business"
StackTrace:
at GalleryServerPro.Business.AppSetting.Initialize(ApplicationTrustLevel trustLevel, String physicalAppPath, String appName) in C:\inetpub\GalleryServerPro_V2_3_3512_source\TIS.GSP.Business\AppSetting.cs:line 405
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\monty\Desktop\ExifWorks1\C#Projects\GSPProgram1\WindowsFormsApplication1\Form1.cs:line 34
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 WindowsFormsApplication1.Program.Main() in C:\Users\monty\Desktop\ExifWorks1\C#Projects\GSPProgram1\WindowsFormsApplication1\Program.cs:line 18
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()
InnerException:
..............Code I am USING:
private void button1_Click(object sender, EventArgs e)
{
GalleryServerPro.Business.ApplicationTrustLevel trustLevel = ApplicationTrustLevel.Full;
// Get the application path so that the business layer (and any dependent layers) has access to it.
string physicalApplicationPath = "C:\\inetpub\\GalleryServerPro_V2_3_3512_source\\Website\\";
string appName = "Gallery Server Pro";
GalleryServerPro.Business.AppSetting.Instance.Initialize(trustLevel,physicalApplicationPath,appName);
int aid = 3;
IAlbum alb = GalleryServerPro.Business.Factory.LoadAlbumInstance(aid, false);
string t = alb.Title;
Console.Write(t);
textBox1.Text = t;
}