Problems debugging with multiple addins containing StandardAddInServer.vb class

Problems debugging with multiple addins containing StandardAddInServer.vb class

AlexFielder
Advisor Advisor
643 Views
2 Replies
Message 1 of 3

Problems debugging with multiple addins containing StandardAddInServer.vb class

AlexFielder
Advisor
Advisor

Hi Folks,

 

I have written several addins recently using VB.NET and all was calm/working correctly.

 

Then I started having issues with loading of addins that used function correctly that lead to this most recent post:

 

http://forums.autodesk.com/t5/inventor-customization/addin-loading-locations/m-p/5984471#M60851

 

I thought I had solved the issue I was seeing, but when I recently returned to an AddIn for Inventor Professional 2016 I noticed that it refused to load and/debug inside of Visual Studio 2015 Express stating something along the lines of: "StandardAddInServer class exists in {dllname.dll} but it's source differs from the current" so I am wondering if I need to make sure to not use the default name of StandardAddInServer.vb when writing multiple AddIns for different customers.

 

I don't believe I needed to differentiate between "standard" class names when working with Inventor Professional 2014's API about a year ago.

 

What is the recommended approach with this sort of thing? It makes sense to me that the class names should be individual, but it has never been a problem until now - if it is indeed even a problem?? Smiley Frustrated

 

Thanks,

 

Alex.

0 Likes
Accepted solutions (1)
644 Views
2 Replies
Replies (2)
Message 2 of 3

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi Alex,

 

I don't think it's necessary to name the class different as long as they are in a different namespace, which will give them a different progid. And they should also have a different clsid.

Based on that the manifest file will have someting like this (this is from the SimpleAddIn sample project):

<clrClass
clsid="{E6EA2F87-0494-4C0D-9E05-63DEB55637FB}"
progid="SimpleAddIn.StandardAddInServer"
threadingModel="Both"
name="SimpleAddIn.SimpleAddIn.StandardAddInServer"
runtimeVersion=""></clrClass>

Can you show a screenshot of the exact error you are getting?

The closest to the one you mentioned I can think of is this:

breakpoint.png

 

In this case Inventor already loaded a dll with the exact same name from a place other than the one where Visual Studio places the newly compiled dll.

i.e. Inventor is loading C:\onefolder\myfile.dll, but my project compiles to C:\otherfolder\myfile.dll and that's what I'm trying to debug.

Inside VS you can easily check all the dll's that got loaded and their full path to make sure that the newly compiled instance is loaded: go to DEBUG >> Windows >> Modules window.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 3 of 3

AlexFielder
Advisor
Advisor

Hi Adam,

 

It turns out you were right! Your note about different namespaces got me thinking:

 

I had used the app.settings mechanic inside of my addins to allow the customer some form of customisation; I had set an internal button name to just "configeditor" - I had forgotten that I had copied the exact same configuration editor into another addin which had the same internal button name of "configeditor" DOH!

 

Adding a namespace to this string i.e. making it "customer_addin.configeditor" instead of just "configeditor" means Inventor is happy to load the addin once again.

 

Thanks,

 

Alex.

0 Likes