Resolution: Resolution
========
SYMPTOM: Using simple SSO .Net code to create an vNodeId object followed by an sSession object may result in the following error: "Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object."
PROBLEM: Required initialization and clean-up methods for SSO DotNet. Two static methods have been supplied to provide initialization and clean-up needed by SSO DotNet as follows:
ssoDOTNET.StartUp()
ssoDOTNET.ShutDown()
StartUp must be called before the first SSO server object is created. ShutDown must be called after SSO server objects are no longer needed. The following example demonstrates the location of these calls in a console (thick) client written in C#:
CODE
using System;
using com.staffware.sso.data;
using com.staffware.sso.server;
using System.Diagnostics;
namespace TestDNet
{
class TestMain
{
[STAThread]
static void Main(string[] args)
{
vNodeId oNodeId;
sUser osUser;
try {
ssoDOTNET.StartUp();
oNodeId = new vNodeId("nodeName","machineName","10.20.35.11",12345,false);
osUser = new sUser(oNodeId, "myname", "mypswd");
}
catch (vException verr) {
Debug.WriteLine(verr.Message);
}
finally {
ssoDOTNET.ShutDown();
}
}
}
}
If the StartUp line were missing in the above code, the creation of the osUser would result in a runtime exception (NOTE: the oNodeId will be successfully created since it resides in the ssoDotNetV.dll which is written entirely in C#). When running under IIS, StartUp must be called when the ssoDotNet.dll is loaded and when ShutDown is called before the ssoDotNet.dll is unloaded. Do not call these methods on every ASP page. These methods must be called from the applications that use SSO DotNet to work around deficiencies in the CLR Framework v1.1 since ssoDotNet.dll is a mixed language DLL (contains both managed C++ and native C++ code). Microsoft has documented this issue in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vcconMixedDLLLoadingProblem.asp
http://support.microsoft.com/default.aspx?scid=kb;en-us;814472
When Visual Studio 2005 becomes available (along with the next version of the CLR Framework), initialization and clean-up for mixed language DLL's will no longer be necessary, although it will continue to work in future versions. This information is documented in the readme.pdf for TIBCO Staffware Server Objects for .Net version 11.x and later products.