I have developed a new (small) class using .Net Framework (VB.NET) on Visual Studio and did a reference on VBA-Excel to execute a task. It worked fine on my machine, so the real problem here is to deploy this class on the client's machine.
When I did the build on Visual Studio, I've selected "Register for COM Interop", so it was created a .dll and .tbs file. I thought I could just use a reference on VBA to these files and everything would work fine, but it's not that simple. I have to register the dll on the system before I can use it, and the Visual Studio did that automatically on the build.
The question is, how can I make a common setup installer to only install those dll and tbl files into anyone's machine? The files must remain on a known folder so I can reference them on the VBA, but the windows register must know they exist!
What do I know so far:
On the build, Visual Studio uses Regasm.exe to register the dll; I could use a bat file to call regasm.exe but it is not a option because I would have to make a reference to it and each client could have different .Net Framework versions, so I wouldn't be able to know the full path of it.
regsvr32.exe won't work it either, since we need Admin Rights, and
the clients don't have it.I could use ClickOnce, but it's a Class Library so the Publish option does not exist.
Here I have some references, but I couldn't find a good solution yet.
https://www.red-gate.com/simple-talk/dotnet/visual-studio/build-and-deploy-a-.net-com-assembly/
UPDATE 1
It seems that the only way of installing in the register is through regasm.exe or regsvr32, and both of 'em need elevated command prompt (with admin rights), something the clients do not have.
I guess the solution is to use registration-free activation of COM components, that it wouldn’t require updating Registry or placing assemblies in GAC. Here's the reference:
Is it possible to register a .NET assembly for COM interop without adding registry entries?
UPDATE 2
I've found this answer and I can feel that I'm real close to a solution:
Registering .Net COM DLLs without Admin rights / regasm
The thing is, the class that I've developed is using another class, which is PdfSharp. When I unregister the dll and try to register again (through regasm.exe), my VBA macro gives an error not when I'm creating the object, but when I'm executing a funtion of the class, saying that the PdfSharp couldn't be found.
The solution of this question doesn't say anything about using 3rd party library, and I thought that my .dll would bring the pdfsharp.dll as well.
Any ideias? I'm real close to solve this.