Warning: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "RevitAPI", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. RebarFreeForm
Next, I addressed the first serious hurdle for successful compilation, which took me a while to figure out:
Error: The OutputPath property is not set for project 'DimensionLeaderEnd.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. DimensionLeaderEnd
After some head scratching, I finally fixed it very easily, by manually adding an OutputPath tag to DebugAnyCPUPropertyGroup the project file:
Some of the remaining warnings are caused by the AppearanceAssetEditing project and concern an assembly reference conflict:
Warning: Could not resolve this reference. Could not locate the assembly "RevitAPIUI". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. AppearanceAssetEditing
Warning: No way to resolve conflict between "RevitAPIUI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" and "RevitAPIUI". Choosing "RevitAPIUI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. AppearanceAssetEditing
I deleted the existing references to RevitAPI.dll and RevitAPIUI.dll and added them again manually, pointing to the installed assemblies in the Revit.exe folder.
RebarFreeForm still has a problem with the RevitAddInUtility reference, though:
Warning: Could not resolve this reference. Could not locate the assembly "RevitAddInUtility". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. RebarFreeForm
Warning: No way to resolve conflict between "RevitAddInUtility, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" and "RevitAddInUtility". Choosing "RevitAddInUtility, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. RebarFreeForm
That one did not even need re-referencing; it is superfluous.
The SampleCommandsSteelElements cannot be compiled due to numerous unresolved references:
Warning: Could not resolve this reference. Could not locate the assembly "RevitAddInUtility". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "RvtDwgAddon". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "ASObjectsMgd". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "RevitAPI". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: No way to resolve conflict between "RevitAddInUtility, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" and "RevitAddInUtility". Choosing "RevitAddInUtility, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. SampleCommandsSteelElements
Warning: The referenced component 'RevitAPISteel' could not be found. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "RevitAPISteel". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: The referenced component 'RvtDwgAddon' could not be found. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "ASCADLinkMgd". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: The referenced component 'ASCADLinkMgd' could not be found. SampleCommandsSteelElements
Warning: No way to resolve conflict between "RevitAPIUI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" and "RevitAPIUI". Choosing "RevitAPIUI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "ASGeometryMgd". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: The referenced component 'ASGeometryMgd' could not be found. SampleCommandsSteelElements
Warning: Could not resolve this reference. Could not locate the assembly "RevitAPIUI". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. SampleCommandsSteelElements
Warning: No way to resolve conflict between "RevitAPI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" and "RevitAPI". Choosing "RevitAPI, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. SampleCommandsSteelElements
Warning: The referenced component 'ASObjectsMgd' could not be found. SampleCommandsSteelElements
One of these references refers to the module ASObjectsMgd.
This is in fact available in the add-ins packaged with Revit itself, in the subdirectory /AddIns/SteelConnections:
The seven errors in AppearanceAssetEditing are caused by deprecated API calls:
Error CS0618: 'AssetProperties.this[string]' is obsolete: ' This property is deprecated in Revit 2019 and will be removed in the next version of Revit. We suggest you use the 'FindByName(String)' or 'Get(int)' method instead.' AppearanceAssetEditing C:\a\lib\revit\2019\SDK\Samples\AppearanceAssetEditing\CS\Application.cs 208 Active
These calls are classed as errors instead of warnings, causing the project compilation to fail, because this is explicitly requested in the project build properties – treat all warnings as errors:
I changed the setting from 'All' to 'None'.
Now I can build that project as well, and finally the Revit 2019 SDK compilation is complete.
186 projects succeeded, 0 failed and 0 were skipped.
I will ask the development team to clean this up asap to avoid forcing other Revit add-in developers to repeat these utterly unneccessary and frustrating steps.