【发布时间】:2021-01-08 00:41:03
【问题描述】:
我正在尝试为 Revit 创建一个简单的多版本 hello World 插件,并且我找到了 this article,我正在尝试跟进。但是,我并没有走得太远。我不太熟悉 .csproj 文件的工作原理。我之前为各个 Revit 年创建了插件,但没有创建多个版本。
下面是我的 .csProj 代码。我试图从小处着手,只处理 Revit 2018 的 .net framework 4.5.2。您还可以在我的项目属性的底部找到 sn-ps。 Start External Application: 不再开放,所以我不知道如何通过 Revit 调试它。
感谢任何和所有帮助/指导。
使用下面的当前 .csproj 代码,我收到此弹出错误:
.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>
【问题讨论】:
-
@EhsanIran-Nejad,你在项目属性中有什么目标框架?正如您在链接中显示的那样,我从
标记下的 .csproj 中删除了 <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>行,但项目属性现在默认为 .net framework 4.0 -
@EhsanIran-Nejad,搞定了!谢谢。
-
如果你成功了,你能和我们分享一下解决方案吗?谢谢!
-
@EhsanIran-Nejad 或 JeremyTammik,how to debug a multi-version plugin 上的任何提示?
标签: c# revit-api revit pyrevit