Inter Framework package references - wpf

I develop a Xamarin project for Android, it uses Xam.plugin.audio to play sound files, and works on android.
The project which uses the audio plugin is in .net standard 2.0
I developped an .Net framework project to load in a WPF application the .net standard 2.0 project which contains the xaml file of my app.
when I build the windows wpf project, I have my direct dependency, but not the audio.dll.
the nuget package of the audio.dll contains different frameworks:
framework of audio plugin
below:
Crok.wpf : .net framework references Crock.view (.net standard) , which references crok.business (.net standard) which references the audio plugin:
project references
I have copy local true on my Wpf
And a wpf standalone app manages to use this plugin.
The question is : How do I instruct visual studio that my .Net framework project should copy local the plugin which is indirectly referenced, and copy the correct framework version
there is a very long video which show you the problem here:
Inter framework plugin problem

The solution is to target multiple frameworks for the dependency which is used by the .NET Framework.
I made a new video with the steps here.

Related

How can I add the .NET framework 5.0 to Visual Studio Professional 2019?

I have downloaded and installed the new .NET framework 5.0 from this website.
But I would like to know how to add this framework to a project created on Visual Studio 2019 16.8.0.
Note:
I have launched VS installer and I have searched for the new framework, but I can't find it.
I have already opened: Project -> Properties -> Target Framework.
But the most recent framework that I got is .NET framework 4.8
How can I add the new framework to the target frameworks in Visual Studio 2019?
Update:
I have a conflict now and I would like to know what's the difference between .NET framework SDK and .NET framework Developer pack, I'm wrong in this point.
As mentioned in the link above, there is no .NET framework 5.0 in the developer pack list.
Can anyone explain this to me?
Download and install the Visual Studio 2019 SDK from the .NET Core releases site.
.NET 5.0 is continued development of .NET Core and it no longer follows the old (.NET 4 and older) targeting pack. Instead, .NET 5 is installed as an SDK into the .NET Core framework & sdk directory structure. For folks who have been doing .NET Core for some time, this feels natural, but coming from .NET 4, it's new.
Create a new .NET Core project type and set the .NET version to .NET 5.0:
There are specific .NET (not .NET Framework) project templates for Winforms and a few other project types. These will also target .NET 5 or .NET Core where appropriate:
Unfortunately, there is no magic wizard to upgrade a .NET 4 project over to .NET 5. The step-by-step guidance can be found here:
Winforms Migration from .NET 4 to .NET 5
WPF Migration from .NET 4 to .NET 5
Many ASP.NET folks have gone through these steps to move from .NET 4 to .NET Core in the past. There are many blog posts on the issues they bumped into and how they solved that. The process is very similar and there are some tools now to help you along the way.
The main steps are the same for every .NET 4 project:
Change your packages.config to <packageReference> format.
Change your project file to the new SDK project format.
Run the API Compatibility analyzers. This will tell you where to expect breaking changes.
Switch the target framework to .NET 5 in the project file
Update/change/add required nuget packages to the versions that support .NET Core/.NET 5.
Fix any build issues.
Alternatively:
Create a new .NET 5 project of the desired target type.
Add the required project configurations etc.
Add the NuGet Packages you're going to need.
Copy the sources over from your .NET 4 project. Or copy the project file into the folder where your existing project resides. It should automatically import all source files.
Fix build issues
It may be possible there won't be a NuGet package of 3rd party components you use that are compatible with .NET 5. In that case you'll need to either wait for one to be released or find an alternative. Of course, in case of open source projects, you could help them out by porting the package for them and sending a pull request.
The Migration guidance linked above gives you multiple approaches to achieve each step.

Can i use .dll library targeted .net framework v3.5 in application having targeted framework 4.0?

Hello currently I'm working on desktop application using WPF. I create application by targeting .net framework 4.0. but I have facing some problems related targeted frameworks.
First there is a library which i have to use in my application.A library supports targeted .net framework v3.5 but I also want to use the DataGrid control (only available above than v4.0 targeted .net framework) for table so now i'm confuse what i should do now? how can i achieve my goal? i want to use both library + Datagrid control in my application which is targeting .net framework v4.0.
Thanks in advance :)

How to create MSI for WPF .Net Core 3 Application?

When working with .Net Framework 4.7 & WPF, we use fody weaver to package up all the project dlls etc... into one dll, so we could then use Wix installer.
This is extremely convenient, and fody worked a treat.
With a .Net Core 3.1 Wpf app I cant get fody to work and they have put it in maintenance mode because of .net core 3's new single- file exe's.
I can create a single file exe but still need to install my app as its code signed and I want the user experience to be familiar with the standard ms installer ui.
At the moment im sure I can create a Wix project and include all the dll's, but there are hundreds of them with .net core & this is an immense amount of work.
Can anyone shed any light on how to install a .net core 3 WPF app using Wix?

What versions of .NET and WPF, does the ModernUI framework support?

I'm working with a WPF app that was written using the ModernUI framework. I'm wondering what versions of the .NET Framework does the ModernUI support?
The ModernUI assemblies target .NET Framework 4.5 which means that the library is compatible with any version equal to or larger than 4.5.
You can confirm this by looking at the <TargetFrameworkVersion> elements in the .csproj files on GitHub:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

Consume .Net Core library from .Net standard project

I have a standard WPF application developed in .Net framework 4. Now, my client wants a website which I am planning to develop using .Net Core. In order to share the business logic, I need to move the database along business layer to a separate project and here I am planning to use .Net Core. So, all the layers i.e. Data/ Business/ API will be re-written using latest version of .Net Core.
Would I be able to reference business layer written in .Net Core from WPF (.Net Framework 4) project?
Any pointers will be highly appreciated.....
You should implement the common functionality in a .NET Standard library. You will then be able to reference this assembly from all apps that are compatible with the version of the .NET Standard that your common project targets.
The various .NET implementations target specific versions of .NET Standard and the following table on MSDN lists all versions of .NET Standard and the platforms supported: https://learn.microsoft.com/en-us/dotnet/standard/net-standard.
The latest version of .NET Core (currently 2.0 at the time of writing) implements .NET Standard 2.0. The oldest version of the .NET Framework that implements .NET Standard 2.0 is 4.6.1. This means that your WPF app should target 4.6.1 to be able to consume a .NET Standard 2.0 assembly.
.NET Core 1.0 and .NET Framework 4.5 support .NET Standard 1.0.
The .NET Framework 4.0 doesn't support any version of .NET Standard though so you should re-target your WPF app against (at least) .NET Framework 4.5.
Would I be able to reference business layer written in .Net Core from WPF (.Net Framework 4) project?
The answer is yes. You can try it: In Visual Studio create a WPF application project and a .NET Standard library project and then add a reference from the application project to the library project.
There will be NuGet packages that you cannot reference in your .NET Standard project because they only support full .NET Framework but most popular NuGet packages can be referenced from a .NET Standard project. Your question is also tagged [entity-framework-6]. If you want to use Entity Framework from a .NET Standard project you will have to use Entity Framework Core as Entity Framework 6 requires the full framework.
You should probably create a quick spike to determine if you can build your application how you intend to.

Resources