Hi @Per Jensen,
Welcome to Microsoft Q&A!
What is your build configuration? If it is Debug mode, please change it to Release and try again.
Please copy the assembly ‘idrsnet16.dll’ into the directory of your application executable. And try to set the Build Platform Target to x86 or x64 so that it is compatible with your DLL.
You can also close all running VS instances and delete the hidden .vs folder in the project folder.
Then, re-launch the VS, rebuild and debug your project.
Sincerely,
Anna
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.