The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The M-Files API COM Interop supports .Net 6/7?

Hello,

I am relatively new to the .net framework and I apologize if any vagueness is done.


After upgrading the .net version (from 4.8 to 6) in our machines, we lost the functions previously developed using the Mfiles COM API.

Is this an expected behaviour, the COM API is not compatible with the .net 6?

If not, is there any alternative or a plan to make it compatible in the future? 

How about the rest  API, would we face the same issue?

Thank you again for the excellent support!




Parents
  • To answer your last question...

    The REST API is fundamentally different, as you use HTTP requests to interact with it, rather than the COM interface.  There are advantages (e.g. you can use any language or operating system to interact, as long as it can make HTTP requests) and disadvantages (e.g. the REST API does not have the breadth of functionality that the COM API does) to using the REST API.  You pick your poison.

    But: no, you shouldn't need to move just because you've updated the framework runtime you've targeted.

Reply
  • To answer your last question...

    The REST API is fundamentally different, as you use HTTP requests to interact with it, rather than the COM interface.  There are advantages (e.g. you can use any language or operating system to interact, as long as it can make HTTP requests) and disadvantages (e.g. the REST API does not have the breadth of functionality that the COM API does) to using the REST API.  You pick your poison.

    But: no, you shouldn't need to move just because you've updated the framework runtime you've targeted.

Children


  • When testing a simple connection with the COM API, I failed to import the dependency using the .Net6. 

    Isn't the Interop.MFilesAPI the correct dependency to work with the COM API? Is there any piece I am missing?



    Thank you!

  • Aha, you're using the nuget package.  I notice that the nuget package only explicitly targets .NET Framework.  I will speak to PD about getting that updated.

    You should be able to remove the nuget package and instead add a COM reference to the M-Files API.

    Note, though, that the machine running this needs to be Windows, and to have some component of M-Files (e.g. the desktop client) installed.  If you can't guarantee those things then you would perhaps need to move to the REST API.  If so, then you may want to look at something like the open-source MFWSClient sample library.