I’m testing a small dll registered in COM, I use COM because the DLL will be call by a Delphi program. Here is the simple source:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MCMTSimulator
{
public class Simulator
{
public int RS232(sbyte[] data)
{
return 6;
}
}
}
Then in the assembly:
[assembly: ComVisible(true)]
[assembly: ClassInterface(ClassInterfaceType.AutoDual)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("b3f59863-c1a6-448b-aaa2-2bfdf292cc27")]
I compile this with visual studio started as administrator.
Then I run the console in administrator mode:
C:WindowsMicrosoft.NETFrameworkv4.0.30319regasm.exe MCMTSimulator.dll /register /codebase /tlb
And I get “access denied” every time!
Thanks for your help