There is a way to check at design time the version of Wisej.NET (designer or referenced assembly).
A # directive like Wisej3 or Wisej4 can be very handy.
The best solution i have found is this definition into the .csproj
<PropertyGroup>
<WisejVersion>40</WisejVersion>
<!– or 35 for Wisej35 –>
</PropertyGroup>
<PropertyGroup Condition=”‘$(WisejVersion)’ == ’35′”>
<DefineConstants>$(DefineConstants);WISEJ35</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=”‘$(WisejVersion)’ == ’40′”>
<DefineConstants>$(DefineConstants);WISEJ40</DefineConstants>
</PropertyGroup>
and into the code editor
private void Window1_Load(object sender, EventArgs e)
{
#if WISEJ40
MessageBox.Show(“This is Wisej,NET 4.0.”);
#endif
#if WISEJ35
MessageBox.Show(“This is Wisej.NET 3.5.”);
#endif
}
}
Thank you.