Welcome to Microsoft Q&A!
The SQLUserInstance DLL is a link API provided by SqlLocalDB for applications, and the file is generally located at C:\Program Files\Microsoft SQL Server\150\LocalDB\Binn. The registry location is Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SQL Server Local DB\Installed Versions\15.0 (as shown in the screenshot). Please ensure the existence of the file and whether the value of the registry item InstanceAPIPath is the correct path to the file.
Additionally, if the above suggestion does not help with this issue, there are two other options that might fix the problem. Although you have successfully connected to LocalDB through Visual Studio, you can try repairing it using the Visual Studio Installer. Choose to click "More," Repair it.
Best regards,
Mikey Qiao
If the answer is helpful, please click "Accept Answer" and upvote it.