Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

5. Some manual edits must be made to the project file in order for the plugin to run successfully. Open the project file (in our example, CSiNET8PluginExample1.csproj ) in a text editor, and make the following edits:

...

languagexml

...

    • Change the <TargetFramework> from net8.0 to net8.0-windows . This is necessary to allow our plugin to open a Windows form (Note: this plugin has only been tested to work on the Windows platform)
    • Add the <EnableDynamicLoading>true</EnableDynamicLoading> attribute to the <PropertyGroup> . This will allow the CSI product to load our project as a plugin.
    • Add theĀ 



Code Block
languagexml
<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net8.0-windows<0</TargetFramework>	
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<Platforms>AnyCPU;x64</Platforms>
		<EnableDynamicLoading>true</EnableDynamicLoading>
		<UseWindowsForms>true</UseWindowsForms>
	</PropertyGroup>

	<ItemGroup>
	  <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
	</ItemGroup>

	<ItemGroup>
	  <Reference Include="CSiAPIv1">
	    <HintPath>..\Program Files\Computers and Structures\ETABS 22\CSiAPIv1.dll</HintPath>
		<Private>false</Private>
		<ExcludeAssets>runtime</ExcludeAssets>
	  </Reference>
	</ItemGroup>

</Project>



Code Block
languagexml
<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net8.0-windows</TargetFramework>

...

	

...


		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		

...

<Platforms>AnyCPU;x64</Platforms>
	 	<UseWindowsForms>true</UseWindowsForms>
		<EnableDynamicLoading>true</EnableDynamicLoading>
	</PropertyGroup>

	<ItemGroup>
	  <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
	</

...

ItemGroup>

	<ItemGroup>
	  <Reference Include="CSiAPIv1">
	    <HintPath>..\

...

Program Files\Computers and Structures\ETABS 22\CSiAPIv1.dll</HintPath>
		<Private>false</Private>
		<ExcludeAssets>runtime</ExcludeAssets>
	  </Reference>
	</ItemGroup>

</Project>



6. With the modifications to the project file, you should be able to add a new Windows Form to your project

...