Reply

Add in loading twice

Hi All,

 

I have developed a add in for solid edge (st7/st8). At my computer everything is correct. But when i try it at another computer the add in is running twice. So every action is executed twice. The problem is. the dll's are also loaded twice and gives a JIT error about that. 

I hope anyone here has experience with this.

 

Greetings,
Johnny the white

9 REPLIES

Re: Add in loading twice

Are you sure your add-in didn't get registered twice on the test computer with different GUIDs?

You should cleanup the registry on the test computer regarding your add-in and then reinstall and register your add-in again.

 

If there are still problems please specify in which language (C++, C#/VB) you've written your add-in and how you're registering it.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Add in loading twice

Hi Wolfgang,

 

I'm sure the addin is not registered twice. I made a dump of the registered dll's on that computer:

 

 

REGEDIT4 [HKEY_CLASSES_ROOT\SolidEdge.Manageem.Addin] @="SolidEdge.Manageem.Addin.ManageEmAddIn" [HKEY_CLASSES_ROOT\SolidEdge.Manageem.Addin\CLSID] @="{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}" [HKEY_CLASSES_ROOT\CLSID\{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}] @="SolidEdge.Manageem.Addin.ManageEmAddIn" [HKEY_CLASSES_ROOT\CLSID\{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}\InprocServer32] @="mscoree.dll" "ThreadingModel"="Both" "Class"="SolidEdge.Manageem.Addin.ManageEmAddIn" "Assembly"="SolidEdge.Manageem.Addin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" "RuntimeVersion"="v4.0.30319" [HKEY_CLASSES_ROOT\CLSID\{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}\InprocServer32\1.0.0.0] "Class"="SolidEdge.Manageem.Addin.ManageEmAddIn" "Assembly"="SolidEdge.Manageem.Addin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" "RuntimeVersion"="v4.0.30319" [HKEY_CLASSES_ROOT\CLSID\{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}\ProgId] @="SolidEdge.Manageem.Addin" [HKEY_CLASSES_ROOT\CLSID\{1F47DA3A-B2CC-6A86-9031-C7813CD102E3}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]


The language is C#,
Registering for the add in is:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /codebase "%~1" with as argument the path to the dll: SolidEdge.Manageem.Addin.ManageEmAddIn

 

 

Re: Add in loading twice

John,

 

hard to say what is going wrong with your add-in on the second computer.

You could try with a sample of Jason to get some idea. But very important is to give your add-in a unique GUID, PROGID (Name) and also a new GUI version number whenever your add-in got changed in this area.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Add in loading twice

hmm it's very difficult. when i unregister the dll everything is gone, Solid edge doenst see it anymore. but when i register again. The dll is loaded twice in solid edge. i gonna look again to jasons example

Re: Add in loading twice

Yeah, without having your code to look at and test, it's hard to say for sure. I too would say take a look at my DemoAddIn sample on GitHub. I'm not sure how you implemented your addin but the DemoAddIn uses NuGet packages that I've built to make creating addins in .NET fairly easy. You can watch my Solid Edge Community Templates Quick Start video to see how to use them to create your own addin.

 

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Add in loading twice

Hi Jason,

 

At first thank you for the many information you have put on the web about solid edge add in's. they were a great help for greating our add in.

We use already your nuget packages. I have looked at your github again. the one thing i see is defference at first glance is: Mij registration function in the add in is this:

[ComRegisterFunction]
public static void Register(Type t)
{
RegistrationHelper.Register(t);
}

Without that function its not registered at all. and with that function its registered twice (alle dll's are loaded twice)

Re: Add in loading twice

Can you share your addin source code with me? If not, we may have to try and setup a Skype session or something.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Add in loading twice

Maybe its not neccesary. Where can i find your function : DemoAddIn.Register(settings); ?
Cant find it in the code.

The source: 

 

http://pastebin.com/xQGMQvLX

The source of the registration helper ( in seperate AddIn.Commen project
http://pastebin.com/ZPe1jsuT

Re: Add in loading twice

Thanks for sharing your code. Looking at your code, I can quickly determine that you are not using my Solid Edge Community Templates on Visual Studio Gallery that my video Solid Edge Community Templates Quick Start demonstrates and that the DemoAddin on GitHub uses. If I recall correclty, I see patterns in your code that are fairly dated. You are certainly welcome to use other techniques for writing a SE addin other than what I provide but I think it's the source of some of the confusion.

 

I would be happy to help resolve the issue with your current addin but I'm going to need a .zip of the full source code so that I can try to replicate the issue on my machine. I can't tell by just looking at what you've provided. The other alternative would be for you to start a new addin from scratch using the techniques I've described and migrating your sepecific code to the new addin. Either way, I'm happy to help in any way that I can.

Jason Newell
Applications Architect
www.jasonnewell.net