Release-version DLL (VB.Net add-in) fails to load while Debug-version works just fine.

Release-version DLL (VB.Net add-in) fails to load while Debug-version works just fine.

Maxim-CADman77
Advisor Advisor
453 Views
5 Replies
Message 1 of 6

Release-version DLL (VB.Net add-in) fails to load while Debug-version works just fine.

Maxim-CADman77
Advisor
Advisor

Recently I've finished developing some Add-in for Autodesk Inventor (VB.Net).

 

But after series of last-minute improvements its Release-version DLL fails to load (mutually) while Debug-version DLL seems to work just fine.

 

Fast search showed that I'm not the first developer to suffer the issue which is sometimes called "Release-Only bug", but I failed to find a solution.

 

I've even added line

MessageBox.Show(1)

as a first line of ApplicationAddInServer.Activate

 

As a result I do see the message "1" while using Debug version but not when using the Released (Inventor shows it as unloaded).

 

Any ideas on how to localize/solve the issue?

 

Thanks in advance.

 

PS:

I'm using Visual Studio Community 2022 (current build is 17.6.3).

 

PPS:

Sorry but I can't share the add-in source code.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
454 Views
5 Replies
Replies (5)
Message 2 of 6

JelteDeJong
Mentor
Mentor

You might want to add a try/catch block to your activation method. Maybe you will get some useful information. something like this:

Public Sub Activate(AddInSiteObject As ApplicationAddInSite, FirstTime As Boolean) Implements ApplicationAddInServer.Activate
    Try

        ' All your activation code should be here

    Catch ex As Exception

        ' Show a message if anything goes wrong.
        MessageBox.Show($"{ex.Message}{System.Environment.NewLine}{System.Environment.NewLine} {ex.StackTrace}")

        If (ex.InnerException IsNot Nothing) Then
            MessageBox.Show($"Inner exception message: {ex.InnerException.Message}")
        End If

    End Try
End Sub

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 6

Maxim-CADman77
Advisor
Advisor

Thank for your interest to the subject.
I know about this recommendation, and it is fulfilled, but addin produces no 'Catch' messages.

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 6

Maxim-CADman77
Advisor
Advisor

Just in case I've tried to compare DLL-versions using Telerik JustDecompile.


The first difference is <Assembly: Debuggable ... > tag.

The Debug  (OK) version contains:
<Assembly: Debuggable(DebuggableAttribute.DebuggingModes.[Default] Or DebuggableAttribute.DebuggingModes.DisableOptimizations Or DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints Or DebuggableAttribute.DebuggingModes.EnableEditAndContinue)>

 

The Release (issued) version contains:
<Assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)>

 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 5 of 6

Maxim-CADman77
Advisor
Advisor
Accepted solution

I've discovered that previous project version had no this problem (I have a habit to archive project folder to zip sometimes ... just in case), and compare it with current version file-by-file.

I then payed attention that vbproj file of issued project had extra line in  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

 

The extra line was:

    <PlatformTarget>x86</PlatformTarget>

Removing this line did the trick.

 

I don't remember playing with project settings .. yet just happy to have solved this.

Please vote for Inventor-Idea Text Search within Option Names

Message 6 of 6

JelteDeJong
Mentor
Mentor

You might want to have a look at Git. It's a version control system for code (and depending on your Visual Studio version it might be installed already.) It's much better than zipping your projects. Git will allow you to compare 2 versions of a file and shows you what is changed. (Red for a removed line and green for a line that was added.) You can reset the code back to the last commit. And nothing can change without you knowing it because you can review evry thing before you commit the changes.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes