Exception in the Visual Designer

0
0

I got an exception in the Visual Designer after adding a .net6 project dependency.

Attachment
  • You must to post comments
0
0

Hi Alaa,

Thanks for your reply!
The conditional compilation approach needs to add a lot of additional code as I did in the attached example.

The addition of a reference to a separate branch is not useful. I can not use the code from the external library in this case in a WiseJ form. Or am I wrong? Can you give me an example?

Best regards,
Yaroslav

Attachment
  • Luca (ITG)
    Of course you can, it just cannot run in net 48 at design time. Conditional compilation is done with #if. Shared projects is a VS feature. You can also use partial classes. It’s all standard C#. The example is below. The designer for now need net 48.
  • Yaroslav Mudryk
    Yes. I checked. It works. Thanks. .net6 version runs with no issues. But I got a few build errors for the .Net 4.8 branch. Can I ignore them?
  • You must to post comments
0
0

Hi Bernhard, Hi Yaroslav,

You can go with the Shared Project approach or include the .NET6 projects as part of the .NET6 dependency branch!

It can be done relatively easily on the project level with the new SDK Project Format too!

As an example:

<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))'!='net'">
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" />
</ItemGroup>

This way you can still have the NET48 dependency for the designer and continue to work on your project with no issues!

It’s a different take (and a much better one) on the conditional compilation approach!

HTH,
Alaa

  • You must to post comments
0
0

Hi Frank,

Hi Yarslav,

 

we have the same problem. Our solution is to always ensure that we are using the designer using the .net 4.8 target but code everything else on the .net 6 target. Most of our .net 6 code is guarded by conditional compilation to ensure that the library is still able to compile on .net 4.6 and ensure that our controls can be used within the designer. This is a very annoying developer experience.

We are really looking forward for WiseJ designer support for .net 6 and 7. We also opened a ticket 5 months ago: https://wisej.com/support/question/drop-net-4-8-dependency

 

best regards

Bernhard

  • You must to post comments
0
0

Hi Yaroslav,

you should add the reference to the net6.0 branch instead of the net48 branch.

Best regards
Frank

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.