-
Jan 18th, 2021, 05:15 AM
#1
Thread Starter
Junior Member
Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
I have an application which use Rich Text Box on .NET Framework 4.0 (the code compiles fine with VS2010 as well as VS2019).
I have used the .NET 5 Rich Text Box and noticed some improvements.
Is it possible to use .NET 5 Rich Text Box with .NET Framework 4.0 Windows Forms application?
If yes, how?
Thanx.
-
Jan 18th, 2021, 06:10 AM
#2
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
Of course it isn't possible. For one thing, .NET 5.0 is .NET Core, not .NET Framework. Even if they were compatible though, a .NET 4.0 application is .NET 4.0, not .NET 5.0, so it only has access to .NET 4.0 features and functionality. If it had access to .NET 5.0 features and functionality then it would be .NET 5.0.
-
Jan 18th, 2021, 06:18 AM
#3
Thread Starter
Junior Member
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
Ah OK, I thought somehow I could use a .NET Core DLL in .NET Framework
-
Jan 18th, 2021, 06:40 AM
#4
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
Originally Posted by mobi12
Ah OK, I thought somehow I could use a .NET Core DLL in .NET Framework
They work fairly differently. The .NET Framework is installed on the user's system and that contains all the standard types that your app uses. With .NET Core, the standard types are deployed with your application and the WinForms types are a package that you can't even reference separately.
-
Jan 18th, 2021, 07:15 AM
#5
Thread Starter
Junior Member
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
Yes noticed that. What was a 1 MB EXE in .NET Framework, after publishing in .NET Core it became 140 MB even after trimming
-
Jan 18th, 2021, 07:51 AM
#6
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
It's not something I've tried to do but it is possible to install .NET Core once on a system and for applications to share libraries, just like with .NET Framework.
https://docs.microsoft.com/en-us/dot...-vs?tabs=vs156
-
Jan 18th, 2021, 09:28 AM
#7
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
Originally Posted by mobi12
Yes noticed that. What was a 1 MB EXE in .NET Framework, after publishing in .NET Core it became 140 MB even after trimming
This is simply not true. If you edit your project, you can set if you want to publish _all_ libraries, so destination system may not have .NET 5/Core runtime installed and still run the project, or not.
These are the settings in the project:
Code:
<PublishReadyToRun>true</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
When PublishReadyToRun is false, then the result executable is few kilobytes.
When project is not published "ready to run" with all dependencies, then it requires .NET Core runtime to be installed - exactly like .NET Framework on old Windows versions (XP, 2003).
-
Jan 18th, 2021, 09:31 AM
#8
Re: Using .NET 5 Rich Text Box with .NET 4 Windows Forms application
.NET 5/Core and .NET Framework can share libraries but I doubt this will work for duplicate libraries required for WinForms. Check .NET Standard about compatibility between different "frameworks" and "cores".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|