Trouble setting up Multi-Versioning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I have a plugin that I'm trying to get working on Revit 2022 however I am having issues with assigning the correct .pbd file to the version and debugging.
Context:
I have Revit 2020, 2021, and 2022 on my computer(mac running Parallels) and Revit 2022 API has deprecated `Autodesk.Revit.DB.UnitType` and is now using `Autodesk.Revit.DB.SpectTypeId` so that means I have to figure this out.
I am working on setting up the multi-versioning according to Jeremey Tammik's post and this thread here
I have set up my .csproj so that it tries to run the references based upon what version of Revit is running as opposed to what .net framework version is running although I am not sure if this is correct.
This might be a lot for some but any and all help is appreciated. Been at this for 2 days.
My Revit API is the .dll from Revit 2022.
What currently happens is when I run in 2020, I get this error:
MYAPPNAME.dll MYAPPNAME.dll C:\Users\MYNAME\AppData\Roaming\Autodesk\Revit\Addins\2020\MYAPPNAME.dll No N/A Symbols loaded. \\Mac\Home\Desktop\RevitAPI-CSharp\MYAPPNAME\MYAPPNAME\obj\Debug2020\MYAPPNAME.pdb 200 2020.0.0.0 6/2/2021 7:02 PM 00000177017C0000-00000177017E8000 [10976] Revit.exe: Managed (v4.0.30319)
When I check what .pbd module is found and running in Modules, I see that it's searching for the .pbd in the wrong location. it's searching the addins folder when it should be searching the bin/debug2020 folder.
It shows me this from the Symbol Load Information:
C:\Users\MYNAME\AppData\Roaming\Autodesk\Revit\Addins\2020\MYAPPNAME.pdb: Cannot find or open the PDB file.
\\Mac\Home\Desktop\RevitAPI-CSharp\MYAPPNAME\MYAPPNAME\obj\Debug2020\MYAPPNAME.pdb: Symbols loaded.
Here is my setup:
.csproj
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{70F64388-E18B-493B-8CCB-AF58A39B5688}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MYAPPNAME</RootNamespace>
<AssemblyName>MYAPPNAME</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug2020|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;REVIT2020</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RevitVersion>2020</RevitVersion>
<StartAction>Program</StartAction>
<StartProgram>$(ProgramW6432)\Autodesk\Revit 2020\Revit.exe</StartProgram>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<StartAction>Program</StartAction>
<StartProgram>$(ProgramW6432)\Autodesk\Revit 2020\Revit.exe</StartProgram>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug2021|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug2021\</OutputPath>
<DefineConstants>DEBUG;TRACE;REVIT2021</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<RevitVersion>2021</RevitVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug2022|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug2022\</OutputPath>
<DefineConstants>DEBUG;TRACE;REVIT2022</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<RevitVersion>2022</RevitVersion>
</PropertyGroup>
<!--...SOME OTHERCODE HERE...-->
<ItemGroup Condition=" '$(RevitVersion)' == '2020' ">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="RevitAPI">
<HintPath>C:\Program Files\Autodesk\Revit 2020\RevitAPI.dll</HintPath>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>C:\Program Files\Autodesk\Revit 2020\RevitAPIUI.dll</HintPath>
</Reference>
[...OTHER REFERENCES HERE...]
</ItemGroup>
<ItemGroup Condition=" '$(RevitVersion)' == '2021' ">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="RevitAPI">
<HintPath>C:\Program Files\Autodesk\Revit 2021\RevitAPI.dll</HintPath>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>C:\Program Files\Autodesk\Revit 2021\RevitAPIUI.dll</HintPath>
</Reference>
[...OTHER REFERENCES HERE...]
</ItemGroup>
<ItemGroup Condition=" '$(RevitVersion)' == '2022' ">
<Reference Include="RevitAPI">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPI.dll</HintPath>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>C:\Program Files\Autodesk\Revit 2022\RevitAPIUI.dll</HintPath>
</Reference>
[...OTHER REFERENCES HERE...]
</ItemGroup>