I am trying to create DCOM dll in c# which i want to utilize or call function from other computer using c# and vb6 application
Same i want to create application using VB6 and want to call in .net application from other as well as same computer.
What I have tried:
I want to create sample application using .NET as well as in VB6, and I want to use those application dll from other computer, I have gone through several steps but it's confusing and still not able to find exact working example.
I have created one sample class library project and signed with key imported by following command:
sn.exe -i C:\Test\D\test.snk testD
and on post-build I am importing file tlb from following command:
%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\RegAsm /codebase "$(TargetPath)" /tlb:"$(TargetDir)$(TargetName).lib"
Now I am able to build project successfully after updating code in AssemblyInfo.cs as follows:
[assembly: ApplicationName("D")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: AssemblyKeyFile("test.snk")]
Now I have two files, one dll and one lib file in the bin folder when I build project.
Bow I am confused what to do. How can I access from other computer and how can I create same for VB6.
My project structure as follows
Project Structure
i want to create application which can be installed in different computer also can communicate with each other over network
can any one guide me with steps that how can i create application as well as how can i create setup for the same ?
i have uploaded source code , i am able to create installable config but not able to call from other computer
and this is below my client code with reference
https://www.c-sharpcorner.com/uploadfile/yougerthen/create-dcom-application-from-within-net-environment-part-v/
Type remoteSessionContextType = Type.GetTypeFromProgID("D.Person", "100.10.51.57", true);
var dcomObject = Activator.CreateInstance(remoteSessionContextType);
string version = dcomObject.ToString();
Console.WriteLine(version);
i am getting error as below.
etrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).