I'm trying to create a simple multi-version hello World
plug-in for Revit and I've found this article which I'm trying to follow along. however, I'm not getting very far. I'm not so familiar with how the .csproj file works. I've created plugins before for individual Revit years but not multi-versions.
Here is my .csProj code below. I'm trying to start small and just handle .net framework 4.5.2 which is Revit 2018. You'll also find snippets at the bottom for my project properties. There is no longer an open for Start External Application:
so I don't know how to Debug it through Revit.
Any and all help/direction is appreciated.
With the current .csproj code below, i get this pop up error:
.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452<!--;net46;net47--></TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<!--<Platforms>x64</Platforms>-->
<OutputPath>bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|Any CPU' ">
<DefineConstants>DEBUG</DefineConstants>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<PlatformTarget>x64</PlatformTarget>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
<DefineConstants>$(DefineConstants);REVIT2018</DefineConstants>
<!--<AssemblyName>helloWorld</AssemblyName>-->
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<!--<Reference Include="AdWindows">
<HintPath>......\2018\AdWindows.dll</HintPath>
<EmbedInteropTypes>false</EmbedInteropTypes>
<Private>false</Private>
</Reference>-->
<Reference Include="RevitAPI">
<HintPath>C:\Program Files\Autodesk\Revit 2018\RevitAPI.dll</HintPath>
<EmbedInteropTypes>false</EmbedInteropTypes>
<Private>false</Private>
</Reference>
<Reference Include="RevitAPIUI">
<HintPath>C:\Program Files\Autodesk\Revit 2018\RevitAPIUI.dll</HintPath>
<EmbedInteropTypes>false</EmbedInteropTypes>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>
Thanks to your post, I have learned something about multi version plug-in. Now, for the direct question, you can debug your class library by starting Revit when you start debug process. And the setting is as follow:
set your project as start up project (right click project on "solution Exploration" panel => Set as Start up project) so that it will be the first project to run when debug
Open your "Project properties" tab, select "Debug"
From "Start action" on Debug, choose "Start external program". then click "browse" button to select the executable file for Revit. By default, it should be at:
C:\Program Files\Autodesk\your_version_of_revit
Save the process, build the project and hit F5 (or whatever key you set for debug)
This is a little bit late since you already solve your problem, but hope it can be helpful in some similar situation.