Dependency Injection in WPF and Asp.Net Core - wpf

I am using Asp.Net Core to write API Layer for one of my legacy application developed using WPF (.Net Framework 4.5). I have used https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection/ in Business layer which I want to access from WPF application. The version of this DI is not supported by .Net Framework 4.5 so I am unable to use it from WPF. Any suggestions how should I go with this ? The other approach is to use anyother DI container supported by .Net framework 4.5 and Asp.Net Core

I have upgraded my WPF project to .Net Framework 4.6 and rest of the layers are created using .Net Standard Library 2.0.

Related

about ef core winforms net framework support problem

I want to develop a general project, the desktop application must be .Net Framework and I will use EF Core 5.0 in the background and the libraries must be .net standard so that they are compatible with xamarin and Asp.net Core. Everything is fine, but the net framework does not support 2.1. How do I overcome this problem?.
NET 5.0 desktop toolbox has problems. I am someone who uses Devexpress and it does not come out in vehicles. I asked Devexpress and they said they have microsoft-side problems. I didn't know what to do. Syncfusion components do not look the same, unfortunately :(
You have to develop Winforms application using .NET 5. It is replacement of .NET Framework which become deprecated.
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/?view=netdesktop-5.0

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 :)

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.

Can we use XBAP (WPF browser app) built using .net 3.5, on client machine having only .net 3.0

I have an XBAP application built using .net framework 3.5. It's published with full trust on a web server. I am able to use it on client machine having .net framework 3.5.
Question: can I also use this XBAP application on a client machine having only .net framework 3.0? That is no .net 3.5 on client machine.
Thanks in advance for help.
No.
.Net applications require the .Net runtime.
You cannot run a .Net 3.5 application in machine that does not have the .Net 3.5 runtime installed.

Exchanging data between MVC 2 asp.net 3.5 and Silverlight 4

I wrote an application using RIA services in a .net 4.0 project that used domain services to communicate with a client-side Silverlight 4 application. By the way this is my first data driven Silverlight.
I just found out that I will need to make it run in a MVC2 project running .net 3.5 on the server.
Is it possible to make RIA services work in 3.5?
If not, what would be the best way to recreate the project in 3.5?
Unfortunately this scenario is not going to work. Your choices are either host the server on .NET 4.0 or backport with .NET 3.5, SL3 and Beta2 of RIA Services.

Resources