Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Trying to Use GSP in C#
meigs
#1 Posted : Saturday, 9 January 2010 2:57:04 AM(UTC)
Rank: Advanced Member

Joined: 16/03/2008(UTC)
Posts: 85
Man
Location: Pennsylvania

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;



}
Roger Martin
#2 Posted : Sunday, 10 January 2010 1:08:02 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

Your app is not able to find galleryserverpro.config. See my answer to your other thread.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.