How I’ve met .NET Core and a little story about my drama with the framework. This talk will reveal some of my projects and experience with .NET Core and what we can learn from them. We will take a look of some interesting features from .NET Core 3.0 and in the end why I love this framework and the way Microsoft is going.
23. vladimirgeorgiev.com
Assembly Metadata Reading
MetadataLoadContext in .NET Core 3.0
Same as ReflectionOnlyLoad from .NET Framework
Reading assembly metadata without affecting the caller’s application domain
Available in System.Reflection.MetadataLoadContext
Loaded into the reflection-only context
24. vladimirgeorgiev.com
Assembly Metadata Reading
var paths = new string[] { @"C:myappapp.dll" };
var resolver = new PathAssemblyResolver(paths);
using (var lc = new MetadataLoadContext(resolver))
{
Assembly a = lc.LoadFromAssemblyName("app");
Type myInterface = a.GetType("App.IReconnectApplication");
foreach (Type t in a.GetTypes())
{
if (t.IsClass && myInterface.IsAssignableFrom(t))
Console.WriteLine($"Class {t.FullName}");
}
}
25. vladimirgeorgiev.com
Assembly Metadata Reading
var paths = new string[] { @"C:myappapp.dll" };
var resolver = new PathAssemblyResolver(paths);
using (var lc = new MetadataLoadContext(resolver))
{
Assembly a = lc.LoadFromAssemblyName("app");
Type myInterface = a.GetType("App.IReconnectApplication");
foreach (Type t in a.GetTypes())
{
if (t.IsClass && myInterface.IsAssignableFrom(t))
Console.WriteLine($"Class {t.FullName}");
}
}
26. vladimirgeorgiev.com
Assembly Metadata Reading
var paths = new string[] { @"C:myappapp.dll" };
var resolver = new PathAssemblyResolver(paths);
using (var lc = new MetadataLoadContext(resolver))
{
Assembly a = lc.LoadFromAssemblyName("app");
Type myInterface = a.GetType("App.IReconnectApplication");
foreach (Type t in a.GetTypes())
{
if (t.IsClass && myInterface.IsAssignableFrom(t))
Console.WriteLine($"Class {t.FullName}");
}
}
27. vladimirgeorgiev.com
Assembly Metadata Reading
var paths = new string[] { @"C:myappapp.dll" };
var resolver = new PathAssemblyResolver(paths);
using (var lc = new MetadataLoadContext(resolver))
{
Assembly a = lc.LoadFromAssemblyName("app");
Type myInterface = a.GetType("App.IReconnectApplication");
foreach (Type t in a.GetTypes())
{
if (t.IsClass && myInterface.IsAssignableFrom(t))
Console.WriteLine($"Class {t.FullName}");
}
}
28. vladimirgeorgiev.com
Assembly Metadata Reading
var paths = new string[] { @"C:myappapp.dll" };
var resolver = new PathAssemblyResolver(paths);
using (var lc = new MetadataLoadContext(resolver))
{
Assembly a = lc.LoadFromAssemblyName("app");
Type myInterface = a.GetType("App.IReconnectApplication");
foreach (Type t in a.GetTypes())
{
if (t.IsClass && myInterface.IsAssignableFrom(t))
Console.WriteLine($"Class {t.FullName}");
}
}
29. vladimirgeorgiev.com
Tiered Compilation – How JIT works?
App Start JIT
App Start JIT
Fast Application Loading
Low application performance
Slow application loading
High application performance
31. vladimirgeorgiev.com
Tiered Compilation
Add MSBuild property to the default property group in project file:
Add in configProperties to the runtimeconfig.json:
<TieredCompilation>true</TieredCompilation>
"System.Runtime.TieredCompilation": true
33. vladimirgeorgiev.com
The Future of .NET Core
High performance
High quality
High developer productivity
Multi-platform support
Multi-language support
Easy deployment
Minimize chance of errors