M-Files / MFilesSamplesAndLibraries

A series of samples and libraries to help developers build applications upon the M-Files Information Management System.
http://developer.m-files.com
MIT License
66 stars 100 forks source link

DotNet Standard #8

Closed OzBob closed 4 years ago

OzBob commented 6 years ago

Upgrade MFaaP.MFWSClient to DotNetStandard 2.0, and possibly dotnet Core.

Attached is the MFaaP.MFWSClient ApiAnalyzer report.

ApiPortAnalysisMFilesMFWS.xlsx

ApiAnlyzer VSIX ApiAnalyzer Desktop app

"Details", 2nd Sheet reports only one recommended change: "T:System.Web.HttpException | MFaaP.MFWSClient | Not supported"

Suggestion: mark as Obsolete, with a recommendation that users of "MFaaP.MFWSClient.Exception(WebServiceError info)" set Response Code to info.Status, and throw a new ExternalException(info.ToString(), info.Exception == null ? null : (Exception)info.Exception).

p.s. I don't have the COM component 'MFilesAPI' to build the MFaaP.MFilesAPI project.

CraigHawker commented 6 years ago

Thank you for the analysis. I agree that we should look at whether other .NET targets would be beneficial to the community, although I think we should look for feedback as to which are useful.

I am going to share this to the development community and ask for feedback.

Craig.

dmusic commented 4 years ago

Hi Craig, Are there any plans to upgrade client to .NET standard/.NET Core. This would be very beneficial because all new .NET applications are going to be built with new .NET framework. Also any plans to publish client as a Nuget package? Best regards, Dejan

CraigHawker commented 4 years ago

We are looking at how best to support this as we move through 2020. It is likely that this repository will undergo some restructuring, and I'd like to update the REST wrapper sample library at the same time.

The option to publish to nuget has also been mentioned, and this is something which I am interesting in looking at. The primary concern that I have is that this is a library with zero official support, so I don't want people to assume that a published nuget package changes that fact somehow.

CraigHawker commented 4 years ago

I now have a nuget package of the code (not published) which multi-targets .NET 4.6 and .NET standard 2.0 (I have chosen to avoid other targets due to incompatibilities with the libraries that we're using). All unit tests are green, but it needs some manual testing before I'm happy.

The questions still remain as to where this "lives" (separate repository?) and under what account it's published. I'll try and get those moving forward in the next couple of weeks, though.

CraigHawker commented 4 years ago

An initial release has been published to nuget: https://www.nuget.org/packages/MFaaP.MFWSClient

This release (1.0.0-alpha) is the first version that explicitly targets .NET standard 2.0 (along with .NET 4.6). These runtimes were chosen largely due to the fact that the RestSharp library provides nuget packages targeting these runtimes. Whilst the tests are green, I had to make some changes to the tests due to the way in which the newer builds of RestSharp works, and I have only done a small amount of real-world testing.

Please note that the release in nuget is not the same as the source code here. This will be published somewhere separate.

dmusic commented 4 years ago

Hi Craig, In a meantime, I've upgraded project to .net 4.8 (latest patched version) and also updated all libraries including restsharp (this still code from old repo). It works well so far but I am still on refactoring of some features. Hope I come to the point to share also those adaptation I suggested in another ticket. Dejan

CraigHawker commented 4 years ago

Hi Dejan,

I suggest that, at some point, you look to refactor the code based off the new repo. Whilst there have not been many code-level changes, the project structure has been migrated to the new SDK format and updated to target multiple frameworks.

I'd be really happy to look over any subsequent submissions that you'd like to make to the new repository.

Regards,

Craig.