Book a Demo

Author Topic: Bypass add-in development in visual studio admin mode  (Read 8366 times)

priombiswas89

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Bypass add-in development in visual studio admin mode
« on: December 25, 2021, 10:31:11 pm »
I have developed a plugin for my company following the tutorial by Geert from link below:

https://bellekens.com/2011/01/29/tutorial-create-your-

However, I have to open visual studio in admin mode in order to build the project. In my working machine, I have a domain user and an admin user, I and gave full permission to both of the users in registry key of sparx system EAAddin. But still, I have to open and build the project in admin mode. Is there any way I can get rid of that?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bypass add-in development in visual studio admin mode
« Reply #1 on: December 27, 2021, 03:50:04 am »
You only need admin rights to register you dll for COM interop.
If you uncheck that option you can build your project without admin rights.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bypass add-in development in visual studio admin mode
« Reply #2 on: January 04, 2022, 06:59:17 pm »
Debugging will then not work right?
You only need admin rights to register you dll for COM interop.
If you uncheck that option you can build your project without admin rights.

Geert
You only need to register your dll once (for a certain project structure)
Once registered there is no need to re-register it every time you build your project. (it's the easiest option though, because it makes sure the registry stuff is always up to date, so you don't need to worry about it)
Debugging is not related to that. If EA uses the dll you just built, you can debug.

Geert

priombiswas89

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Re: Bypass add-in development in visual studio admin mode
« Reply #3 on: January 04, 2022, 07:08:24 pm »
Thank you for the explanation. That means, we are doing this com interop dll registry because of EA's mechanism of plugin registry. Once we build the c# project with this option checked, our project get acquainted to the registry entry. After that, we no longer need to make this step as our c# project is already familiar with the registry entry. But if I uncheck the option from next builds, how does EA get notified about the changes I made to the project?

 
Debugging will then not work right?
You only need admin rights to register you dll for COM interop.
If you uncheck that option you can build your project without admin rights.

Geert
You only need to register your dll once (for a certain project structure)
Once registered there is no need to re-register it every time you build your project. (it's the easiest option though, because it makes sure the registry stuff is always up to date, so you don't need to worry about it)
Debugging is not related to that. If EA uses the dll you just built, you can debug.

Geert
« Last Edit: January 04, 2022, 07:13:12 pm by priombiswas89 »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Bypass add-in development in visual studio admin mode
« Reply #4 on: January 04, 2022, 07:46:56 pm »
Thank you for the explanation. That means, we are doing this com interop dll registry because of EA's mechanism of plugin registry. Once we build the c# project with this option checked, our project get acquainted to the registry entry. After that, we no longer need to make this step as our c# project is already familiar with the registry entry. But if I uncheck the option from next builds, how does EA get notified about the changes I made to the project?
EA doesn't get notified, and it doesn't have to be.

All EA knows is the fully qualified name of your add-in class: "MyProject.MyAddinClass"
Registering for COM interop means that you tell the registry where to find the dll that contains that add-in class. (it basically says "MyProject.MyAddinClass" is located at C:\Users\MyUserName\Projects\Source\MyProject\Debug\bin\myProject.dll)

EA then asks windows to create an instance of "MyProject.MyAddinClass". Windows can do that because you told it where to find the dll that contains that class.

It gets more complicated once you use multiple dll's that depend on each other, and that might need to be registered for COM interop as well, but this is basically it.

So as long as you don't change the name of you add-in class, or the location of your dll (or the more complicated dependencies), you don't need to re-register for COM interop.

Geert