Troubles with Add-In creating. Cannot load Microsoft.Net.CoreRuntime.ImportBefore.targets, lack off Microsoft.Common.CurrentVersion.targets

Troubles with Add-In creating. Cannot load Microsoft.Net.CoreRuntime.ImportBefore.targets, lack off Microsoft.Common.CurrentVersion.targets

MaciejWojda
Enthusiast Enthusiast
366 Views
4 Replies
Message 1 of 5

Troubles with Add-In creating. Cannot load Microsoft.Net.CoreRuntime.ImportBefore.targets, lack off Microsoft.Common.CurrentVersion.targets

MaciejWojda
Enthusiast
Enthusiast

Hi everyone,

 

I have abovementioned problem with creating add-in to Inventor 2022 in Visual Studio 2019. I have installed developertools from SDK.

When I try to configure new project, the error occures which says that:

1. Cannot load imported project file "C:\Program Files (x 86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Microsoft.Common.Targets\ImportBefore\Microsoft.Net.CoreRuntime.ImportBefore.targets"

2. Lack of main element. C:\Program Files (x 86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets

 

The files Microsoft.Net.CoreRuntime.ImportBefore.targets and Microsoft.Common.CurrentVersion.targets exist at the paths.

maciej5XLAT_0-1642605306387.png

 

I cannot resolve this problem and go further, please help

Best regards,

Maciej Wojda

0 Likes
367 Views
4 Replies
Replies (4)
Message 2 of 5

nedeljko.sovljanski
Advocate
Advocate

I didn't have any problems with creating blank project. If you are in hurry you can download project that I created from github

https://github.com/Nendzi/InventorAddIninVB

and maybe later you find out what was problem.

Message 3 of 5

MaciejWojda
Enthusiast
Enthusiast

Thank you @nedeljko.sovljanski for your piece of code.

I don't know exactly what caused my problem, but it looks like some residues after Visual Studio 2022, which I had installed as first IDE on the Win10 system. Then I realized, that SDK for inventor does not support VS 2022 yet and it supports 2019 version. I installed VS 2019 and then installation of SDK also finally succeeded. Nevertheless sample could not work with problems described in this topic. I deinstalled VS 2022, but problem did not disappeare. 

The next step was to install VS 2019, Inventor and SDK on fresh Win10 system and finally worked.

 

If someone in the future will find some more exact solution than starting from scratch, please share it here.

Have a nice day!

Message 4 of 5

nedeljko.sovljanski
Advocate
Advocate

I am glad that you have success. Also pay attention that Inventor addin use NET 4.8 Framework. You can not use NET Core in your projects. VS2022 use NET Core as default platform, you can change it but - you must do it.

0 Likes
Message 5 of 5

MaciejWojda
Enthusiast
Enthusiast

By the way, maybe you know how to make professional installer for Inventor addin? I tried but with no luck so far. I can't even find helpful knowledge on the Internet

0 Likes