What are the important compilation details for the managed DLL used in CLSID hijacking, particularly regarding .NET runtime version and assembly naming?
The managed DLL must be compiled with the correct .NET runtime version that matches the target CLSID’s `RuntimeVersion` registry value. For example, for CLSID `{D5AB5662-131D-453D-88C8-9BBA87502ADE}` you must use `v2.0.50727` and compile with `csc.exe` from the .NET 2.0 directory. Also, the assembly name in the C# source (namespace `TestDotNet` and class `TestDotNet.Class1`) must match the `Assembly` registry value. If the compiled DLL’s name differs from the namespace, you must specify the `/out:TestDotNet.dll` parameter to ensure correct loading. Failure to match will result in the DLL being loaded but not executed.
csc.exe.NET runtimeassembly namingmanaged DLLcompilation
Source:Use CLR to bypass UAC