Is there a way to target .net 4 for an Inventor 2012 add-in?

Is there a way to target .net 4 for an Inventor 2012 add-in?

Anonymous
Not applicable
827 Views
3 Replies
Message 1 of 4

Is there a way to target .net 4 for an Inventor 2012 add-in?

Anonymous
Not applicable

We have a large code base that is migrated to .net 4. I did not find an easy way to target .net 4 when writing an add-in for Inventor 2012.

 

Is there a solution to this?

0 Likes
Accepted solutions (2)
828 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

Hello,

 

It seems like I was able to do this once using a "registry-based" addin.  I know it's a step back since we're told to use "registry-free" addins in Inventor 2012 foward, but I think this works.  Can you try that and let us know?

 

Thanks,

Message 3 of 4

Anonymous
Not applicable

Thank you for this idea, maybe someone from Adesk can chime in and confirm if this is a possibility in theory?

My gut feeling tells me that the problem with the Adesk 3.5 file needing to reference my 4.0 dlls might remain.

0 Likes
Message 4 of 4

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi Johan,

 

Yes, what Farren said seems to work. I assume because of the Side by Side execution feature of .NET 4: http://blogs.microsoft.co.il/blogs/arik/archive/2011/05/30/how-to-use-a-net-4-based-dll-from-net-2-b...

 

Actually, I thought that the Reg-Free version could work as well, but I did not manage to achieve that.

 

Another thing you can do is force Inventor to use the .NET 4 Framework. This seems to work fine, but still it is unsupported, so if you run into any problems with it then we cannot help.

In order to do that you need to make sure that the <startup></startup> section of Inventor.exe.config has the following:

 

  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntimeversion="v4.0"/>

  </startup

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes