Skip to content

Check Wisej.NET version at design time. #4836

Description

@itg-assistant

Gabriele Del Giovine asked 2025-08-20 14:41:23 UTC

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

40 $(DefineConstants);WISEJ35 $(DefineConstants);WISEJ40

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions