Revit 2020 SDK Sample project build errors

Revit 2020 SDK Sample project build errors

jarkko.hoivala5K6CD
Explorer Explorer
465 Views
3 Replies
Message 1 of 4

Revit 2020 SDK Sample project build errors

jarkko.hoivala5K6CD
Explorer
Explorer

Hi,

 

What could be the problem with these errors:

1>------ Build started: Project: DWGFamilyCreation, Configuration: Debug Any CPU ------
error CS0246: The type or namespace name 'Autodesk' could not be found.. same with: 'IExternalCommand','ExternalCommandData','View','Document'
error CS0103: The name 'Autodesk' does not exist in the current context
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

Refences are OK (RevitAPI & RevitAPIUI) and NET framework 4.7.2

 

 

 

0 Likes
466 Views
3 Replies
Replies (3)
Message 2 of 4

jshial
Advocate
Advocate

my bad, didn't read through op's question. references are ok..

0 Likes
Message 3 of 4

kevinaugustino
Contributor
Contributor

Are you referencing the RevitAPI/RevitAPIUI.dll from a Revit 2022 installation? Those are built against .net framework 4.8. Maybe try changing your project's TargetFrameworkVersion from 4.7.2 to 4.8?

0 Likes
Message 4 of 4

jarkko.hoivala5K6CD
Explorer
Explorer
Got this working by creating new project with existing code. It's a workaround, but still wondering why .csproj file doesn't work as such.
0 Likes