The Future of C++/CLI and .NET Core 3

Avatar

Will

.NET Core 3.0 is now available and we have received a lot of questions about what that means for the future of C++/CLI. First, we would like to let everyone know that we are committed to supporting C++/CLI for .NET Core to enable easy interop between C++ codebases and .NET technologies such as WPF and Windows Forms. This support isn’t going to be ready when .NET Core 3.0 first ships, but it will be available in .NET Core 3.1 which ships with Visual Studio 2019 16.4 – roadmap.

C++/CLI will have full IDE support for targeting .NET Core 3.1 and higher. This support will include projects, IntelliSense, and mixed-mode debugging (IJW) on Windows. We don’t currently have plans for C++/CLI for targeting macOS or Linux. Additionally, compiling with “/clr:pure” and “/clr:safe” won’t be supported for .NET Core.

The first public previews for C++/CLI are right around the corner. Visual Studio 2019 16.4 Preview 1 includes an updated compiler with “/clr:netcore” if you want to try it out with full IDE support coming in a subsequent preview. Keep an eye on the C++ Team Blog for more info; it’s coming soon! As always, let us know if you have any questions. Feedback and suggestions can be posted on Developer Community.

Avatar
Will Buik

Follow Will   

15 comments

  • Avatar
    David Hunter

    Thanks for the work this is great news for all of us C++/CLI fans! I was wondering if you could post a simple “Hello World” Visual Studio 4.1 Preview project file somewhere, it would help us to start with something you guys are happy with.

    BTW I did look at the roadmap page but it seems to only go out to Q3 2019 which is basically now.

    • Avatar
      Will Buik

      We are still working on the IDE and MSBuild integration, so I can’t share a sample project quite yet. Once it’s available, likely with 16.4 Preview 2 or 3, we will post an update on the blog. That post will include many more details including how to get .NET Core C++/CLI project up and running.

  • Avatar
    László Csöndes

    Great news! I guess C++/CLI is still on life support and not getting support for newer .NET features such as extension methods or named tuple members?

      • Avatar
        László Csöndes

        There was no language support for declaring or consuming extension methods last time I checked, the only option you had was manually adding the attributes and then using the ClassName::Method(whatWouldBeThis, …); syntax to call them, which gets very ugly and verbose if you’re using an API that was originally designed as a set of extension methods that you’re supposed to chain (ASP.NET Core, Rx, or even LINQ itself for instance).

        • Avatar
          Mark Fonnemann

          I see what you are saying. Defining the enums in C++/CLI for consumption C# works well but if you want to define and consume within that same (or another) C++/CLI project it can get ugly. Agree 100% that this should be improved.

  • Avatar
    Jeff Hawson

    This is great. Nothing matches C++/CLI in terms of its ability to wrap complex native APIs for a .NET audience. I hope that Microsoft continues to invest in this technology. It will be very exciting if Linux support is eventually offered — that would unlock a lot of possibilities!

  • Avatar
    François Bouteruche

    It would be awesome to add in your plan the support for macOS and Linux. I can imagine great use cases where I could easily wrap native image processing libraries in my .NET apps.

  • Avatar
    Oliver Weichhold

    Considering that the majority of our workloads are now developed on Windows but run in inside Linux containers in production, not supporting Linux is unfortunate.

  • Avatar
    Mark Fonnemann

    Any chance for some modern c# features? String interpolation seems like low hanging fruit. ValueTuples would be nice as well. There’s probably something I’m forgetting here.

  • Avatar
    Arlie Davis

    Could you elaborate on why /clr:pure and /clr:safe are not supported? I imagine it has to do with the very different nature of the compilation pipeline on .NET Core; are these compilation options no longer meaningful, or just being dropped for practical reasons?

Leave a comment