I have a class "Settings" written in VB.NET. I am trying to use this class in a console application written in C#. When I instantiate Settings class in my console application I am getting this exception:
'System.UnauthorizedAccessException' in System.EnterpriseServices.Wrapper.dll An unhandled exception of type 'System.UnauthorizedAccessException' occurred in System.EnterpriseServices.Wrapper.dll Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I have tried changing launch and activation permissions in DCOM Config.
class Program
{
static void Main(string[] args)
{
SqlConnection CN = null;
Settings S = new Settings();// Exception throws here
CN = new SqlConnection(S.GetLocalSetting("CnStr"));
}
}
Settings class imports these namespaces:
Imports System.IO
Imports System.EnterpriseServices
Imports System.Xml
Imports Data.Encryption
// Constructor
Public Sub New()
End Sub
And has many methods which are used to get and delete settings, to connect to database etc.
Settings
class? – zaggler