I'm playing around with CredentialProviders for Win10/11, following Steve Syfuh's blog post and repo. Using the repo as is (.net framework 4.6.1) works nicely, but I'd like to do it in .net6.
I've read the docs about COM for .net core and tried to follow, but whatever I do, I get the following error:
The module [myproject].comhost.dll was loaded but the call to DllRegisterServer failed with error code 0x80040111.
My steps were:
- put
[ComVisible(true)]and unique GUIDs to the public classes that should be reachable (namelyCredentialProvider,CredentialView,CredentialProviderCredential) - edit
.csprojfile and add<EnableComHosting>True</EnableComHosting> - run the
midltool to getcredentialprovider.tlband add it to the.csprojfile:
<ItemGroup>
<ComHostTypeLibrary Include="..\interop\credentialprovider.tlb" Id="1" />
</ItemGroup>
- elevate the
cmdto runregsvr32 [myproject].comhost.dlland get the error above
I've found this question with similar content (but I cannot run it on my machine, and the [myproject].dll is right next to the comhost one), I tried suggestions in Hans Passant's link, but all in vain.
Does anyone has any suggestions as to what could be the issue, please?
I guess I can still do it in .net framework 4.8 (that again works), but I'd like to meddle with it a bit and I'd like to stick to newest version of .net (and also some of the packages I'd like to use don't support framework anymore).