Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) MindFusion Diagram 6.8.6 not support .NET 6 or above (Read 3099 times)
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
MindFusion Diagram 6.8.6 not support .NET 6 or above
May 29th, 2023 at 8:59am
Print Post  
Hi,

When implementing the .NET 6 or above, it will show unexpected error message when running the application.

This issue happen when the application try to initialize the Class Library which is still under .Net Framework.

It does not having any issue when I point to .NET 5 instead of .NET 6 or above.
  

Issue.jpg ( 355 KB | 42 Downloads )
Issue.jpg
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #1 - May 29th, 2023 at 9:15am
Print Post  
Hi,

I'm not seeing problems running our .NET 6 sample projects. Please check if you aren't missing some assembly references shown in them. Otherwise please post the full stack trace or attach your test project.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #2 - May 30th, 2023 at 1:54am
Print Post  
Here is the attachment. The issue does not arise if the mindfusion is reference directly in .NET 6


https://drive.google.com/file/d/14TMg4putifeq8RKnJvSSSJFiXU_fpDt9/view?usp=share
_link
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #3 - May 30th, 2023 at 7:05am
Print Post  
Hi,

I think problem is your class library targets .NET 4.7:



If I recreate it as .NET 6 one, the application loads without complaining:



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #4 - May 31st, 2023 at 2:14am
Print Post  
I know it will not having this issue when changing the class library .Net framework.

However, the caller side should not affect the class library as the reference and initialization is only located at the class library.

Furthermore, I think it not suitable to change the Class Library version as it work correctly as before until I change the caller side .NET version to 6 and above. (Changing the WinFormsApp1 Project to .NET 5 does not trigger the same issue)

Do you have any alternative solution beside changing the class library as I cannot simply change it for my production environment.
  

Target_Framework.jpg ( 98 KB | 43 Downloads )
Target_Framework.jpg
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #5 - May 31st, 2023 at 6:40am
Print Post  
Problem is your setup makes diagram's static constructors called twice (maybe loading two different .NET app domains), and we don't know of another solution than using proper target for your class library. You might test if changing target to .NET Standard target helps, if you need to use same binary dll in both .NET Framework 4 and .NET 6, but overall don't see the problem compiling different dll files for different frameworks.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #6 - May 31st, 2023 at 1:57pm
Print Post  
Hi,

Unfortunately, I cannot simply set the version of the classLibrary.

It just weird the behaviour become different when the Winform is set from .NET 5 to 6

Furthermore, I found out that, if I add a new Nuget Package for WinForm. It will not trigger the issue. Will they any possible issue if I do it like that?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #7 - Jun 1st, 2023 at 6:52am
Print Post  
Hi,

You will face difficulties once you actually try to integrate any user controls from the library into the form, if the dll has references to .NET 4 System.WinForms and the application loads .NET 6 version. If somehow you manage to build the .NET 4 library with references to .NET 6 Windows Forms, it might work but then there's no point in it being .NET 4 one. Anyway we provide separate .NET 4/6 builds for a reason, and your configuration is not something we intend to pursue further.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #8 - Jun 1st, 2023 at 11:45am
Print Post  
Hi,

Thanks for the advice. I agree with you that it is better to point to the same version to prevent any possible issue. Due to the project complexity, we unable to make the changes in a short period of time.

Furthermore, I do found out that migrate the existing packages.config to Package References allow me to run without issue.

I observe the dll version it generate is 6.8.6.600 after I migrate the packages.config. (Previously, it compile as 6.8.6.450)

Appreciate your suggestion/advice regarding this method. Thank You.


  

Migrate_packages.jpg ( 159 KB | 45 Downloads )
Migrate_packages.jpg
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #9 - Jun 2nd, 2023 at 5:22am
Print Post  
Nuget's 6.8.6.600 vs package.config 6.8.6.450 are .NET 6 and .NET 4.5 builds respectively. So it means you are loading the .NET 6 diagram version in .NET 6 app and it's working. I believe your class library won't work in .NET 4 app now though, so still no point not migrating it to .NET 6 Wink
  
Back to top
 
IP Logged
 
Tan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: May 29th, 2023
Re: MindFusion Diagram 6.8.6 not support .NET 6 or above
Reply #10 - Jun 2nd, 2023 at 6:19am
Print Post  
Hi,

Thanks for the explanation. It explain a lot why it resolve.

Ya, I will consider about it on .NET 4 class library to ensure it will able to work after changing it. As the class library is used by many area that not only happen in .NET6 project.

By the way, thank you for the information you provided. Smiley

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint