Check Wisej.NET version at design time.

0
0

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.

 

 

  • You must to post comments
0
0

You can simply check the nuget package in the Solution Explorer.
Expand Dependencies, then either net481, net8.0, or net8.0-windows (any of them work). then expand Packages. See screenshot.

Attachment
  • Gabriele Del Giovine
    Hi Julie, I didn’t explain myself well. I meant in the code editor, not in the project explorer. Something integrated into the build directives, such as the .NET version directives. Thanks. Gabriele.
  • Julie(ITG)
    Unfortunately this is not possible.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.