I have created a DLL to house a class that I want to use across multiple applications, as well the DBML created by LINQ.
The problem I am having is that the class is not visible/usable from external applications when the compiled DLL is set as a reference, although all the LINQ objects are. Also, when I manually import the .cs file then I can use the class as expected.
I have built the class as static, and the code is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Data;
namespace OsgShared
{
static class GlobalClass
{
public static USER CurrentUser { get; set; }
private static Dictionary<string,int> _SysDetIDs;
public static Dictionary<string,int> SysDetIDs { get { return _SysDetIDs; } }
private static Dictionary<string, int> _AccInfoTypeIDs;
public static Dictionary<string, int> AccInfoTypeIDs { get { return _AccInfoTypeIDs; } }
private static Dictionary<string, int> _AccGroupTypeIDs;
public static Dictionary<string, int> AccGroupTypeIDs { get { return _AccGroupTypeIDs; } }
private static Dictionary<string, int> _EntTypeIDs;
public static Dictionary<string, int> EntTypeIDs { get { return _EntTypeIDs; } }
/// <summary>
/// Populates Dictionary objects containing database reference data
/// </summary>
public static void PopulateDictionaries()
{
_SysDetIDs = new Dictionary<string,int>();
_AccInfoTypeIDs = new Dictionary<string,int>();
_AccGroupTypeIDs = new Dictionary<string,int>();
_EntTypeIDs = new Dictionary<string, int>();
OsgDBDataContext db = new OsgDBDataContext();
// Populates Dictionaries here
db.Dispose();
}
}
}
Is there anything obviously wrong with how I've set this class up that's preventing it from appearing when used via a DLL?
Many thanks