Skip to content
0:00 / 0:00

#dotnet7#interop#libraryimport

.NET Interop Improvements in .NET 7 | .NET Conf 2022

dotnet

357K subscribers • 45 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Made by the vendor. The company whose product it covers made or sponsored it.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Advanced. Deep dive for people who know the field.

5.3K views3 years ago1 recommendation

Systems programmingProgramming languagesC# and .NETPerformance and optimizationCompilers and interpreters

This .NET Conf 2022 talk explains the new Roslyn-based source generator technology and LibraryImport for interop in .NET 7.

Interop in .NET has made many advancements in .NET 7 and now uses the new Roslyn-based source generator technology to provide many new features and better usability. Come learn how to utilize these new features! dotnetconf.net #DotNet #dotnetconf #dotnet7 🙋‍♀️🙋‍♂️ Get your questions answered on the Microsoft Q&A for .NET: aka.ms/dotnet-qa 🏫 Learn C#, F#, and .NET with free self-guided learning from Microsoft Learn: aka.ms/learndotnet

Why it's here

1 person recommends this

What people say. Recommended for understanding the shift from DllImport to LibraryImport in .NET 7.

u/extra_specticlesin r/dotnet • Recommends

On “Including non-.NET languages inside solution.”

Have you watched this? .NET Interop Improvements in .NET 7 | .NET Conf 2022 And : Microsoft: Platform Invoke in .NET 7.0 sweeps away ‘old weird behaviors’ in fundamental shift > .NET 7 replaces `DLLImport` with a new attribute called `LibraryImport`. It sounds similar but it is not. LibraryImport instructs the compiler to invoke a Roslyn Source Generator to create C# code that implements the native function wrapper. Currently, it only works with C#, not Visual Basic. I suspect that this should be the way that you connect compiled Rust libraries. To build them you can use external commands in projects/Msbuild using the Exec Task