Inventor 2025 reference to stdole

Inventor 2025 reference to stdole

Michael.Navara
Advisor Advisor
1,521 Views
3 Replies
Message 1 of 4

Inventor 2025 reference to stdole

Michael.Navara
Advisor
Advisor

In default template for Autodesk Inventor 2025 C# AddIn is missing reference to stdole. In previous versions it was possible to add this reference from COM components. But now it is not, because version (7.0.3300)  is not compatible with .NET 8 and stdole is not in the list of components.

 

Below are three solutions how to add this reference to the new project.

My question is: Are there any potential issues with any of these or does anyone have a different solution?

 

1) Install stdole from NuGet package

I can install NuGet package stdole in version (7.0.3300) required by Inventor from nuget.org. There is a small issue because by default the package gives a warning. 

NU1701	Package 'stdole 7.0.3300' was restored using '.NETFramework,Version=v4.6.1, ... , .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0-windows7.0'. This package may not be fully compatible with your project.

 This warning can be suppressed in package properties or directly in project file.

MichaelNavara_0-1724062921706.png

  <ItemGroup>
	  <PackageReference Include="stdole" Version="7.0.3300">
	    <NoWarn>NU1701</NoWarn>
	  </PackageReference>
  </ItemGroup>

 

2) Copy the stdole.dll file to project and reference them as assembly 

In this case I just need to set Embed Interop Types to No (False in project file)

 

3) Add reference to COM component manually

In VB.Net addin project is this reference added directly in project file using this piece of code. It works, but it is little bit obscure for me.

<ItemGroup>
	<COMReference Include="stdole">
		<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
		<VersionMajor>2</VersionMajor>
		<VersionMinor>0</VersionMinor>
		<Lcid>0</Lcid>
		<WrapperTool>primary</WrapperTool>
		<Isolated>False</Isolated>
		<EmbedInteropTypes>False</EmbedInteropTypes>
	</COMReference>
</ItemGroup>

 

1,522 Views
3 Replies
Replies (3)
Message 2 of 4

Mehmet_Fatih_Turker
Advocate
Advocate

Hi @Michael.Navara I've been through a lot today trying to find an error that I encountered and find your post mentioning about stdole.dll. 

Mehmet_Fatih_Turker_0-1731192733226.png

 

this is attiribute helper that is coming from Inventor 25 sdk. windows forms are not working, but here,

Mehmet_Fatih_Turker_1-1731193047864.png

 

in the copy design user tool, forms are working just fine, and in the addin that I was working on,

Mehmet_Fatih_Turker_2-1731193220171.png

it says 

Access to the path 'C:\Users\Mehmet\AppData\Local\Microsoft\VisualStudio\17.0_7056055a\WinFormsDesigner\ojciuk2b.put\UserAppData\stdole.dll' is denied.


why would that be? That could be a bug ?


0 Likes
Message 3 of 4

JelteDeJong
Mentor
Mentor

I just use the stdole.dll that is shipped with Inventor 2025. I have this in my project file and have not run into problems so far.

<Reference Include="stdole">
   <HintPath>C:\Program Files\Autodesk\Inventor 2025\Bin\stdole.dll</HintPath>
</Reference>

 

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 4 of 4

Mehmet_Fatih_Turker
Advocate
Advocate

Hi @JelteDeJong I added stdole referance to the project but it didnt solved the problem.

 

Mehmet_Fatih_Turker_0-1731767982581.png

 

0 Likes