Microsoft.Bot.Connector.DirectLine Support in .NET MAUI - botframework

I am converting my Xamarin Forms Application to .NET MAUI.
In existing app we have used Microsoft.Bot.Connector.DirectLine(3.0.2) for using the Bot Framework Direct Line REST API.
Is Microsoft.Bot.Connector.DirectLine package supported in .net MAUI?
In the Microsoft.Bot.Connector.DirectLine Nuget Link I don't see the net6.0 as the compatible target framework.
If it's not supported is there any alternative package?
Any help is appreciated!

This is an old package which hasn't been updated since 2017. It likely doesn't support .NET 6.0 and probably won't be updated to support it.
The good news is that you do not need this package to communicate with a bot over Direct Line. You can use .NET Standard Library objects (such as HttpClient) to communicate with Direct Line as you would any other REST API. There may be other libraries and frameworks you could use as well.
See the Direct Line 3.0 Documentation to see how to use the API.

Related

What Non-4.* .NET App Versions play well with Standard?

I am building an MVC Web API (Service) with Views returned in specific cases. As an architectural decision, I've been directed to NOT build the service project in .NET Framework 4.*. Rather, I am to attempt .NET 5.0 first, and then Core 3.1 if 5.0 doesn't work.
This service project in my solution will depend on a few class library projects, call them DataLibrary, ComplexLibrary, and DocLibrary. DataLibrary will depend on a Nuget package of Oracle, be it ODP or Oracle Managed Data, in order to query an Oracle database via an Oracle Package on that database. DocLibrary will depend on a Nuget package of Aspose Word & Aspose PDF. ComplexLibrary will depend on Oracle AND Aspose.
Here's my dilemma:
Aspose Word's latest stable release (21.6) will report that it is compatible with 5.0 and Standard 2.0, but not .NET Core.
Oracle Managed Data reports that it is compatible with Standard 2.1 or Standard 2.0, but not 5.0 or .NET Core.
My own libraries have reported that they are not compatible with my API .csproj if...
3a. The API is 5.0 and the libraries are .NET Core or .NET Standard
3b. The API is Core 3.1 and the libraries are .NET Standard.
Since my compile script naturally requires a run of Nuget to retrieve all the necessary dependencies, I cannot get a clean compile because I seemingly have no combination of versions for my WebAPI and libraries that satisfy each others' compatibility needs. Since Standard libraries are the only common .NET version that satisfy the needs of both Aspose & Oracle, What available version for my WebAPI (i.e. I don't believe that Standard is an option for anything other than a class library) is compatible with .NET Standard libraries?
Thanks.
Please see the following article https://learn.microsoft.com/en-us/dotnet/standard/net-standard.
.NET Standard is not a framework it is kind f specification and .NET Core, .NET 5, Mono framework etc are .NET Standard implementations.
So for library projects I would select .NET Standard and for the service .NET Core or .NET 5 (which is actually the next version of .NET Core)
Well, don't I feel silly.
Turns out, the issue wasn't incompatibilities within Aspose, Office, .NET Core, 5.0, and Standard, but a failure of a prior version of NuGet to handle the different versions.
While my VS 2019 install was able to compile the whole solution effectively, my local install of NuGet was not. This was due to VS2019 likely using the most up-to-date version as of this post (5.9.#), while my locally installed version was 4.9.#. Thus, VS was able to sail through while my compile script kept failing at the NuGet stage (which I have included prior to the actual compile.) Once I ran a NuGet update, everything was good to go.
Long story short: KEEP YOUR NUGET VERSION UP-TO-DATE!!!

For a Xamarin Forms application is the PCL architecture becoming obsolete?

I have a Xamarin Forms application that uses shared code. It has three projects, shared, iOS and Android. These are very similar to those which are created when I create a sample application from the Xamarin new project menu.
I am looking to have the application updated and published by a company that has experience in doing this but I am not sure I understand a couple of the work items that have been suggested to me:
Currently, architecture is PCL which is becoming
obsolete.
Move to .NET standards
Could someone explain to me what these work items might mean?
Yes, it will become obsolete at some point. .NET Standard is the evolvement of the PCL libraries.
With PCL libraries you could target a number of platforms and only the functionality that was supported for all targeted platforms were available to you. Associated with each combination of platforms were the profiles. A profile was identified by two or three digits. Notable ones for Xamarin were 111 or 259. Read more on PCLs here: https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/pcl
.NET Standard is a specification of the APIs associated to it. If a platform supports a certain version of the .NET Standard, you are guaranteed that all APIs are available. This way, you can simply target a specific .NET Standard version and each platform that supports it will support your application. The .NET Standard specification has gained a lot of traction and is already more cross-platform than a PCL ever was. Most of the creators of NuGet packages are supporting it already and also Xamarin/Microsoft has replaced the PCL with a .NET Standard library in their templates. Read more on .NET Standard as a concept here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard
So, if you have the possibility it might be wise to start moving to the .NET Standard library. That is, if you want to keep supporting your app and need new libraries coming in. If your app is fine the way it is, you can probably keep going with the PCL for a while. Converting is basically: change the csproj structure to the new structure. Retarget your library to netstandard and reinstall all the libraries you have installed, this time to download the .NET Standard compatible version. The last step might be a bit of a pain.
A good resource on converting might be this by Adam Pedley: https://xamarinhelp.com/upgrade-pcl-net-standard-class-library/
There is also a solution to do it automatically: https://smellyc0de.wordpress.com/2018/03/23/automatically-converting-pcl-to-net-standard-2-0-project/
.Net Standard is a specification for a set of APIs. and is the way things are going. With it, comes a higher level of range of .Net SDK APIs you can use, plus most 3rd party Nuget packages will support it. They can support a wider range of platforms. by targeting .Net Standard. Thus you will get access to a larger number of nuget packages. See https://learn.microsoft.com/en-us/dotnet/standard/net-standard
I put my Forms Apps into a .Net Standard library, because it easier to unit test. There is a Xamarin Forms nuget package you can use for testing, which means a lot of UI paths can be verified in code, where previously you had to do it on a device, perhaps with automated testing. https://github.com/jonathanpeppers/Xamarin.Forms.Mocks
Upgrading an existing PCL project to .net standard is a pain. Any more, I just create a new Xamarin Forms solution with the same name/root namespace, with the app as .Net Standard, then copy files over.

Xamarin cross platform .net2.0

I've created a Cross platform Application for Xamarin in Visual Studio. The application is running on .NET Standard 2.0 and it's not possible to select a higher version.
Isn't possible to run a Xamarin project on a newer .NET version? The problem is that a want to install nuget packages that requires at least .NET 4.5.
Thanks in advance.
You are confusing .net and .net standard. .net standard gathers many other .net platform (for example .net core, uwp, windows phone etc...) including the classical .net (from 4.5 to 4.6.1). Take a look at this table to have a better understanding.
This means that you should be able to include your library that targets .net 4.5.
Now that you know that, you can define a fallback version if the library does not target .net standard. To do so add this line in your .net standard .csproj in the PropertyGroup node
<PackageTargetFallback>$(PackageTargetFallback);portable-win+net45+wp8+win81+wpa8</PackageTargetFallback>
.NET Standard is a standard, official documentation is nicely covering it. Beside that must read, here is a compatibility table.
So please, read the official documentation. Setup your mind and come back with a proper question. Currently it does not make sense.
Good luck!
P.S.: Currently you are trying to use an outdated library that does not support .NET Standard, you might want to look for alternatives.

Is there a way to use enterprise library in .NET Core 1.1.2 web api

I am planning to use Enterprise Library for database access on a Web API project which is going to be built using .Net core app.
But I am unable to install Enterprise library using NuGet as the latest version of Enterprise Library is not compatible with.Net core app framework.
Note, I don't want to use Entity Framework.
Appreciate if the community can help on this.
If you can migrate your application to .Net Core 2.0 which is still in preview mode, but Microsoft promised to release it by Q3 2017, I have forked out the Enterprise Library project and ported that to .Net Core 2.0 which you can find it under this repository:
https://github.com/Chavoshi/EnterpriseLibrary.NetCore
And also this is the Nuget package for Data Application Block:
https://www.nuget.org/packages/EnterpriseLibrary.Data.NetCore
Still there are some missing parts such as OdbcFactory and OleDbFactory which they are not available in .Net ported APIs (Or Nuget package is not published yet), but I am keep working on them to maybe port them by myself or update it since the API will be available. I appreciate anyone who can contribute on this project as well. :)

How can I create a REST API client for a Windows Runtime project in Visual Studio / by external tools?

In Visual Studio for .net projects I can use built in tools to generate API clients by swagger. It simply and works great.
This option is missing from Windows Runtime projects as well, like Windows 10 IOT ones.
What is the best way to create API clients by swagger for this? If there is no built in tool / extension for VS, any external tools are highly appriciated.
Thanks a lot!
I don't get your question completely; on Windows IOT Core you can run UWP (background) apps; they are compatible with .net framework and .net standard up to version 1.4. This should work with a generated client from swagger.
Also you can use Refit to create a REST client according to best practices based upon an interface with attribute decorations.

Resources