Community,
On a new workstation I have installed Windows 10 Pro, Inventor 2019, Visual Studio 2019, and .NET 4.8.
When I try to build an addin using @BrianEkins 'Nifty Add-in Inventor 2018' template, a couple of errors are reported, but VS reports a successful build. Please see below:
1>------ Build started: Project: Inventor_Addin_2020-11-05_A, Configuration: Debug Any CPU ------
1> Inventor_Addin_2020-11-05_A -> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\Inventor_Addin_2020-11-05_A.dll
1> '"\VsDevCmd"' is not recognized as an internal or external command, operable program or batch file.
1> 'mt.exe' is not recognized as an internal or external command, operable program or batch file.
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\Autodesk.Inventor_Addin_2020-11-05_A.Inventor.addin
1> 1 File(s) copied
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\ButtonResources\SampleButton\16x16.png -> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\ButtonResources\SampleButton\16x16.png
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\ButtonResources\SampleButton\32x32.png -> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\ButtonResources\SampleButton\32x32.png
1> 2 File(s) copied
1> The system cannot find the path specified.
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\Autodesk.Inventor_Addin_2020-11-05_A.Inventor.addin -> C:\Users\jberns\AppData\Roaming\Autodesk\ApplicationPlugins\Inventor_Addin_2020-11-05_A\Autodesk.Inventor_Addin_2020-11-05_A.Inventor.addin
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\Inventor_Addin_2020-11-05_A.dll -> C:\Users\jberns\AppData\Roaming\Autodesk\ApplicationPlugins\Inventor_Addin_2020-11-05_A\Inventor_Addin_2020-11-05_A.dll
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\Inventor_Addin_2020-11-05_A.xml -> C:\Users\jberns\AppData\Roaming\Autodesk\ApplicationPlugins\Inventor_Addin_2020-11-05_A\Inventor_Addin_2020-11-05_A.xml
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\ButtonResources\SampleButton\16x16.png -> C:\Users\jberns\AppData\Roaming\Autodesk\ApplicationPlugins\Inventor_Addin_2020-11-05_A\ButtonResources\SampleButton\16x16.png
1> C:\Users\jberns\source\repos\Inventor_Addin_2020-11-05_A\bin\Debug\ButtonResources\SampleButton\32x32.png -> C:\Users\jberns\AppData\Roaming\Autodesk\ApplicationPlugins\Inventor_Addin_2020-11-05_A\ButtonResources\SampleButton\32x32.png
1> 5 File(s) copied
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
1> '"\VsDevCmd"' is not recognized as an internal or external command, operable program or batch file.
1> 'mt.exe' is not recognized as an internal or external command, operable program or batch file.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
When I start Inventor, Addin Manager, the addin reports:
There was an error opening the file.
I have run the VsDevCmd.bat file to initialize the system. I have used the '-test' option, to which no errors are reported.
The only 'mt.exe' file on my system is found here:
C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\arm64\mt.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\mt.exe
C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\mt.exe
I discovered that a User Environment Variable and a System Environment Variable had not been set for VS2019. I added these.
Any thoughts as to what has not been installed or configured to cause the error for the Inventor addin?
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
Hi JBerns,
unfortunately I have exactly the same problem and since your post is already a year old, I wanted to ask if you might have found a solution to it after all.
With kind regards.
I followed a #KETIV #AVA video ( https://www.youtube.com/watch?v=QROrJdg0NQ8 ) to build an Addin.
This time I used .NET 4.7 as shown in the video. Perhaps that was the problem I had earlier because I used 4.8
The video creates a new part. That part was successful. No errors. Addin works.
I tried to expand the Addin by using a form to ask the dimensions of a box for the new part, but have been unsuccessful.
For what its worth, I have attached the project in case someone wants to see where I have gone wrong. I compressed the VS solution folder and attached.
The (first) error occurs in the StandardAddInServer.vb file, subroutine m_sampleButton_OnExecute.
I try to set textbox values for the box position and dimensions, but I get an error:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
I am confident I have not allowed the class and the form to communicate correctly.
I am focusing on DLL interfaces for now, but hope to find a solution to addin errors.
Regards,
Jerry
Does the msgbox rise?
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Yes, the message does appear.
After the message box is closed, I then attempt to populate the form with values before showing it.
That is when the error occurs.
I can 'Continue' past the error and the form does appear, but without any values that I attempted to preset.
I suspect my lack of knowledge on making the class and the form communicate with each other is the problem.
Regards,
Jerry
Hello,
thank you for the answer. I was able to solve the problems with the \VsDevCmd.bat and the mt.exe.
-----
I changed the second line of the builder events to: call "%VSAPPIDDIR%..\Tools\vsdevcmd"
I also reinstalled the mt.exe via Windows SDK for Windows Store Apps Tools-x86_en-us.msi
I also deleted the last but one paragraph of the builder events, because it tried to delete a folder that does not exist.
-----
Visual Studios does not show me any errors after building, but unfortunately Inventor still cannot launch the add-in.
Inventor permanently shows "There was an error opening the file".
I tried to load the add-in manually into Inventor, i.e. without the builder events. Unfortunately, that didn't work either.
It seems to me that there is another error in the template.
Are you using Brian Ekins' Nifty Add-in Template? Especially, the update he posted:
https://ekinssolutions.com/nifty_addin_template/
Regards,
Jerry
Update:
I discovered the Build Events instructions contained a reference to VS2017.
REM - Set up the environment.
call "%VS150COMNTOOLS%\VsDevCmd"
I corrected to use VS2019 system variables
REM - Set up the environment.
call "%VS160COMNTOOLS%\VsDevCmd"
No more errors related to VsDevCmd or Mt.
Regards,
Jerry
call "%VS160COMNTOOLS%\VsDevCmd"
The following line will make calling VsDevCmd.bat Visual Studio version independant:
for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%a\Common7\Tools\VsDevCmd.bat"
When testing this on a command line, you should replace both instances of %%a with %a.
Can't find what you're looking for? Ask the community or share your knowledge.