{"id":21505,"date":"2019-01-29T09:57:06","date_gmt":"2019-01-29T16:57:06","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/?p=21505"},"modified":"2019-02-22T15:20:10","modified_gmt":"2019-02-22T22:20:10","slug":"announcing-net-core-3-preview-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-core-3-preview-2\/","title":{"rendered":"Announcing .NET Core 3 Preview 2"},"content":{"rendered":"<p>Today, we are announcing .NET Core 3 Preview 2. It includes new features in .NET Core 3.0 and C# 8, in addition to the <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">large number of new features in Preview 1<\/a>. <a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/aspnet-core-3-preview-2\/\" rel=\"nofollow\">ASP.NET Core 3.0 Preview 2<\/a>\u00a0 is also\u00a0released today. C# 8 Preview 2 is part of .NET Core 3 SDK, and was also released last week with <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2019-preview-2-is-now-available\/\" rel=\"nofollow\">Visual Studio 2019 Preview 2<\/a>.<\/p>\n<p><a href=\"https:\/\/aka.ms\/netcore3download\" rel=\"nofollow\">Download and get started with .NET Core 3 Preview 2<\/a> right now on Windows, macOS and Linux.<\/p>\n<p>In case you missed it, we made some big announcements with <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">Preview 1<\/a>, including adding support for <a href=\"https:\/\/github.com\/dotnet\/winforms\">Windows Forms<\/a> and <a href=\"https:\/\/github.com\/dotnet\/wpf\">WPF<\/a> with .NET Core, on Windows, and that both UI frameworks will be open source. We also announced that we would support <a href=\"https:\/\/www.nuget.org\/packages\/EntityFramework\/\" rel=\"nofollow\">Entity Framework 6<\/a> on .NET Core, which will come in a later preview. ASP.NET Core is also adding many features including Razor components.<\/p>\n<p>Please provide feedback on the release in the comments below or at <a href=\"https:\/\/github.com\/dotnet\/core\/issues\/2263\">dotnet\/core #2263<\/a>. You can see complete details of the release in the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/release-notes\/3.0\/preview\/3.0.0-preview2.md\" rel=\"nofollow\">.NET Core 3 Preview 2 release notes<\/a>.<\/p>\n<p>.NET Core 3 will be supported in Visual Studio 2019, Visual Studio for Mac and Visual Studio Code. Visual Studio 2019 Preview 2 was released last week and has support for C# 8. The Visual Studio Code C# Extension (in <a href=\"https:\/\/github.com\/OmniSharp\/omnisharp-vscode\/releases\/tag\/v1.18.0-beta5\">pre-release channel<\/a>) was also just updated to support C# 8.<\/p>\n<h2><a id=\"user-content-c-8\" class=\"anchor\" href=\"#c-8\"><\/a>C# 8<\/h2>\n<p>C# 8 is a major release of the language, as Mads describes in <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/do-more-with-patterns-in-c-8-0\/\" rel=\"nofollow\">Do more with patterns in C# 8.0<\/a>, <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/take-c-8-0-for-a-spin\/\" rel=\"nofollow\">Take C# 8.0 for a spin<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/building-c-8-0\/\" rel=\"nofollow\">Building C# 8.0<\/a>. In this post, I&#8217;ll cover a few favorites that are new in Preview 2.<\/p>\n<h3><a id=\"user-content-using-declarations\" class=\"anchor\" href=\"#using-declarations\"><\/a>Using Declarations<\/h3>\n<p>Are you tired of <em>using statements<\/em> that require indenting your code? No more! You can now write the following code, which attaches a <em>using declaration<\/em> to the scope of the current statement block and then disposes the object at the end of it.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/7213b5dcaf011ad0cbe3d2582697b228.js\"><\/script><\/p>\n<h3><a id=\"user-content-switch-expressions\" class=\"anchor\" href=\"#switch-expressions\"><\/a>Switch Expressions<\/h3>\n<p>Anyone who uses C# probably loves the idea of a <em>switch statement<\/em>, but not the syntax. C# 8 introduces <em>switch expressions<\/em>, which enable the following: terser syntax, returns a value since it is an expression, and fully integrated with pattern matching. The <code>switch<\/code> keyword is &#8220;infix&#8221;, meaning the keyword sits between the tested value (here, that&#8217;s <code>o<\/code>) and the list of cases, much like <a href=\"https:\/\/docs.microsoft.com\/dotnet\/csharp\/programming-guide\/statements-expressions-operators\/lambda-expressions#expression-lambdas\" rel=\"nofollow\">expression lambdas<\/a>. The following examples use the lambda syntax for methods, which integrates well with switch expressions but isn&#8217;t required.<\/p>\n<p>You can see the syntax for <em>switch expressions<\/em> in the following example:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/ddd9bfbcc26256376ed8bb1e2a9929b2.js\"><\/script><\/p>\n<p>There are two patterns at play in this example. <code>o<\/code> first matches with the <code>Point<\/code> <em>type pattern<\/em> and then with the <em>property pattern<\/em> inside the <em>{curly braces}<\/em>. The <code>_<\/code> describes the <code>discard pattern<\/code>, which is the same as <code>default<\/code> for <em>switch statements<\/em>.<\/p>\n<p>You can go one step further, and rely on tuple deconstruction and parameter position, as you can see in the following example:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/0a2d3276a449a487421ebdd27dd5d763.js\"><\/script><\/p>\n<p>In this example, you can see you do not need to define a variable or explicit type for each of the cases. Instead, the compiler can match the tuple being testing with the tuples defined for each of the cases.<\/p>\n<p>All of these patterns enable you to write declarative code that captures your intent instead of procedural code that implements tests for it. The compiler becomes responsible for implementing that boring procedural code and is guaranteed to always do it correctly.<\/p>\n<p>There will still be cases where <em>switch statements<\/em> will be a better choice than <em>switch expressions<\/em> and patterns can be used with both syntax styles.<\/p>\n<h3><a id=\"user-content-async-streams\" class=\"anchor\" href=\"#async-streams\"><\/a>Async streams<\/h3>\n<p>Async streams are another major improvement in C# 8. They have been changing with each preview and require that the compiler and the framework libraries match to work correctly. You need .NET Core 3.0 Preview 2 to use async streams if you want to develop with either Visual Studio 2019 Preview 2 or the latest preview of the <a href=\"https:\/\/github.com\/OmniSharp\/omnisharp-vscode\/releases\/tag\/v1.18.0-beta5\">C# extension for Visual Studio Code<\/a>. If you are using .NET Core 3.0 Preview 2 at the commandline, then everything will work as expected.<\/p>\n<h2><a id=\"user-content-ieee-floating-point-improvements\" class=\"anchor\" href=\"#ieee-floating-point-improvements\"><\/a>IEEE Floating-point improvements<\/h2>\n<p>Floating point APIs are in the process of being updated to comply with <a href=\"https:\/\/en.wikipedia.org\/wiki\/IEEE_754-2008_revision\" rel=\"nofollow\">IEEE 754-2008 revision<\/a>. The goal of <a href=\"https:\/\/github.com\/dotnet\/corefx\/issues\/31901\">this floating point project<\/a> is to expose all &#8220;required&#8221; operations and ensure that they are behaviorly compliant with the IEEE spec.<\/p>\n<p>Parsing and formatting fixes:<\/p>\n<ul>\n<li>Correctly parse and round inputs of any length.<\/li>\n<li>Correctly parse and format negative zero.<\/li>\n<li>Correctly parse Infinity and NaN by performing a case-insensitive check and allowing an optional preceding <code>+<\/code> where applicable.<\/li>\n<\/ul>\n<p>New <a href=\"https:\/\/github.com\/dotnet\/corefx\/issues\/31903\">Math APIs<\/a>:<\/p>\n<ul>\n<li><code>BitIncrement\/BitDecrement<\/code> &#8212; corresponds to the <code>nextUp<\/code> and <code>nextDown<\/code> IEEE operations. They return the smallest floating-point number that compares greater or lesser than the input (respectively). For example, <code>Math.BitIncrement(0.0)<\/code> would return <code>double.Epsilon<\/code>.<\/li>\n<li><code>MaxMagnitude\/MinMagnitude<\/code> &#8212; corresponds to the <code>maxNumMag<\/code> and <code>minNumMag<\/code> IEEE operations, they return the value that is greater or lesser in magnitude of the two inputs (respectively). For example, <code>Math.MaxMagnitude(2.0, -3.0)<\/code> would return <code>-3.0<\/code>.<\/li>\n<li><code>ILogB<\/code> &#8212; corresponds to the <code>logB<\/code> IEEE operation which returns an integral value, it returns the integral base-2 log of the input parameter. This is effectively the same as <code>floor(log2(x))<\/code>, but done with minimal rounding error.<\/li>\n<li><code>ScaleB<\/code> &#8212; corresponds to the <code>scaleB<\/code> IEEE operation which takes an integral value, it returns effectively <code>x * pow(2, n)<\/code>, but is done with minimal rounding error.<\/li>\n<li><code>Log2<\/code> &#8212; corresponds to the <code>log2<\/code> IEEE operation, it returns the base-2 logarithm. It minimizes rounding error.<\/li>\n<li><code>FusedMultiplyAdd<\/code> &#8212; corresponds to the <code>fma<\/code> IEEE operation, it performs a fused multiply add. That is, it does <code>(x * y) + z<\/code> as a single operation, there-by minimizing the rounding error. An example would be <code>FusedMultiplyAdd(1e308, 2.0, -1e308)<\/code> which returns <code>1e308<\/code>. The regular <code>(1e308 * 2.0) - 1e308<\/code> returns <code>double.PositiveInfinity<\/code>.<\/li>\n<li><code>CopySign<\/code> &#8212; corresponds to the <code>copySign<\/code> IEEE operation, it returns the value of <code>x<\/code>, but with the sign of <code>y<\/code>.<\/li>\n<\/ul>\n<h2><a id=\"user-content-net-platform-dependent-intrinsics\" class=\"anchor\" href=\"#net-platform-dependent-intrinsics\"><\/a>.NET Platform Dependent Intrinsics<\/h2>\n<p>We&#8217;ve added APIs that allow access to certain perf-oriented CPU instructions, such as the SIMD or Bit Manipulation instruction sets. These instructions can help achieve big performance improvements in certain scenarios, such as processing data efficiently in parallel. In addition to exposing the APIs for your programs to use, we have begun using these instructions to accelerate the .NET libraries too.<\/p>\n<p>The following CoreCLR PRs demonstrate a few of the intrinsics, either via implementation or use:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/15585\">Implement simple SSE2 hardware instrinsics<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/15538\">Implement the SSE hardware intrinsics<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/16822\">Arm64 Base HW Intrinsics<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/21073\">Use TZCNT and LZCNT for Locate{First|Last}Found{Byte|Char}<\/a><\/li>\n<\/ul>\n<p>For more information, take a look at <a href=\"https:\/\/github.com\/dotnet\/designs\/blob\/master\/accepted\/platform-intrinsics.md\">.NET Platform Dependent Intrinsics<\/a>, which defines an approach for defining this hardware infrastructure, allowing Microsoft, chip vendors or any other company or individual to define hardware\/chip APIs that should be exposed to .NET code.<\/p>\n<h2><a id=\"user-content-introducing-a-fast-in-box-json-writer--json-document\" class=\"anchor\" href=\"#introducing-a-fast-in-box-json-writer--json-document\"><\/a>Introducing a fast in-box JSON Writer &amp; JSON Document<\/h2>\n<p>Following the introduction of the JSON reader in preview1, we&#8217;ve added <code>System.Text.Json.Utf8JsonWriter<\/code> and <code>System.Text.Json.JsonDocument<\/code>.<\/p>\n<p>As described in our <a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/master\/src\/System.Text.Json\/roadmap\/README.md\">System.Text.Json roadmap<\/a>, we plan to provide a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Plain_old_CLR_object\" rel=\"nofollow\">POCO<\/a> serializer and deserializer next.<\/p>\n<h3><a id=\"user-content-utf8jsonwriter\" class=\"anchor\" href=\"#utf8jsonwriter\"><\/a>Utf8JsonWriter<\/h3>\n<p>The <code>Utf8JsonWriter<\/code> provides a high-performance, non-cached, forward-only way to write UTF-8 encoded JSON text from common .NET types like <code>String<\/code>, <code>Int32<\/code>, and <code>DateTime<\/code>. Like the reader, the writer is a foundational, low-level type, that can be leveraged to build custom serializers. Writing a JSON payload using the new <code>Utf8JsonWriter<\/code> is 30-80% faster than using the writer from <code>Json.NET<\/code> and does not allocate.<\/p>\n<p>Here is a sample usage of the <code>Utf8JsonWriter<\/code> that can be used as a starting point:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/4c1377ebec06aa0526c086843bdae946.js\"><\/script><\/p>\n<p>The <code>Utf8JsonWriter<\/code> accepts <code>IBufferWriter&lt;byte&gt;<\/code> as the output location to synchronously write the json data into and you, as the caller, need to provide a concrete implementation. The platform does not currently include an implementation of this interface, but we plan to provide one that is backed by a resizable byte array. That implementation would enable synchronous writes, which could then be copied to any stream (either synchronously or asynchronously). If you are writing JSON over the network and include the <code>System.IO.Pipelines<\/code> package, you can leverage the <code>Pipe<\/code>-based implementation of the interface called <code>PipeWriter<\/code> to skip the need to copy the JSON from an intermediary buffer to the actual output.<\/p>\n<p>You can take inspiration from this <a href=\"https:\/\/gist.github.com\/ahsonkhan\/c76a1cc4dc7107537c3fdc0079a68b35\">sample implementation<\/a> of <code>IBufferWriter&lt;T&gt;<\/code>. The following is a skeleton array-backed concrete implementation of the interface:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/a1eeff9d51b05264caf93867a8a87ea3.js\"><\/script><\/p>\n<h3><a id=\"user-content-jsondocument\" class=\"anchor\" href=\"#jsondocument\"><\/a>JsonDocument<\/h3>\n<p>In preview2, we&#8217;ve also added <code>System.Text.Json.JsonDocument<\/code> which was built on top of the <code>Utf8JsonReader<\/code>. The <code>JsonDocument<\/code> provides the ability to parse JSON data and build a read-only Document Object Model (DOM) that can be queried to support random access and enumeration. The JSON elements that compose the data can be accessed via the <code>JsonElement<\/code> type which is exposed by the <code>JsonDocument<\/code> as a property called <code>RootElement<\/code>. The <code>JsonElement<\/code> contains the JSON array and object enumerators along with APIs to convert JSON text to common .NET types. Parsing a typical JSON payload and accessing all its members using the <code>JsonDocument<\/code> is 2-3x faster than <code>Json.NET<\/code> with very little allocations for data that is reasonably sized (i.e. &lt; 1 MB).<\/p>\n<p>Here is a sample usage of the <code>JsonDocument<\/code> and <code>JsonElement<\/code> that can be used as a starting point:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/richlander\/530947180fb95b4df3f1123170ba8701.js\"><\/script><\/p>\n<h2><a id=\"user-content-gpio-support-for-raspberry-pi\" class=\"anchor\" href=\"#gpio-support-for-raspberry-pi\"><\/a>GPIO Support for Raspberry Pi<\/h2>\n<p>We added initial support for <a href=\"https:\/\/learn.adafruit.com\/adafruits-raspberry-pi-lesson-4-gpio-setup\/the-gpio-connector\" rel=\"nofollow\">GPIO<\/a> with Preview 1. As part of Preview 2, we have released two NuGet packages that you can use for GPIO programming.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.nuget.org\/packages\/System.Device.Gpio\/0.1.0-prerelease.19078.2\" rel=\"nofollow\">System.Device.Gpio<\/a><\/li>\n<li><a href=\"https:\/\/www.nuget.org\/packages\/Iot.Device.Bindings\/0.1.0-prerelease.19078.2\" rel=\"nofollow\">Iot.Device.Bindings<\/a><\/li>\n<\/ul>\n<p>The GPIO Packages includes APIs for GPIO, SPI, I2C and PWM devices. The IoT bindings package includes <a href=\"https:\/\/github.com\/dotnet\/iot\/blob\/master\/src\/devices\/README.md\">device bindings<\/a> for various chips and sensors, the same ones available at <a href=\"https:\/\/github.com\/dotnet\/iot\/tree\/master\/src\/devices\">dotnet\/iot &#8211; src\/devices<\/a>.<\/p>\n<p>Updated serial port APIs were announced as part of Preview 1. They are not part of these packages but are available as part of the .NET Core platform.<\/p>\n<h2><a id=\"user-content-local-dotnet-tools\" class=\"anchor\" href=\"#local-dotnet-tools\"><\/a>Local dotnet tools<\/h2>\n<p>Local dotnet tools have been improved in Preview 2. Local tools are similar to dotnet global tools but are associated with a particular location on disk. This enables per-project and per-repository tooling. You can read more about them <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">in the .NET Core 3.0 Preview 1<\/a> post.<\/p>\n<p>In this preview, we have added 2 new commands:<\/p>\n<ul>\n<li><code>dotnet new tool-manifest<\/code><\/li>\n<li><code>dotnet tool list<\/code><\/li>\n<\/ul>\n<p>To add local tools, you need to add a manifest that will define the tools and versions available. The <code>dotnet new tool-manifest<\/code> command automates creation of the manifest required by local tools. After this file is created, you can add tools to it via <code>dotnet tool install &lt;packageId&gt;<\/code>.<\/p>\n<p>The command <code>dotnet tool list<\/code> lists local tools and their corresponding manifest. The command <code>dotnet tool list -g<\/code> lists global tools.<\/p>\n<p>There was a change in .NET Core Local Tools between .NET Core 3.0 Preview 1 and .NET Core 3.0 Preview 2. If you tried out local tools in Preview 1 by running a command like <code>dotnet tool restore<\/code> or <code>dotnet tool install<\/code>, you need to delete your local tools cache folder before local tools will work correctly in Preview 2. This folder is located at:<\/p>\n<p>On mac, Linux: <code>rm -r $HOME\/.dotnet\/toolResolverCache<\/code><\/p>\n<p>On Windows: <code>rmdir \/s %USERPROFILE%\\.dotnet\\toolResolverCache<\/code><\/p>\n<p>If you do not delete this folder, you will receive an error.<\/p>\n<h2><a id=\"user-content-assembly-unloadability\" class=\"anchor\" href=\"#assembly-unloadability\"><\/a>Assembly Unloadability<\/h2>\n<p>Assembly unloadability is a new capability of AssemblyLoaderContext. This new feature is largely transparent from an API perspective, exposed with just a few new APIs. It enables a loader context to be unloaded, releasing all memory for instantiated types, static fields and for the assembly itself. An application should be able to load and unload assemblies via this mechanism forever without experiencing a memory leak.<\/p>\n<p>We expect this new capability to be used for the following scenarios:<\/p>\n<ul>\n<li>Plugin scenarios where dynamic plugin loading and unloading is required.<\/li>\n<li>Dynamically compiling, running and then flushing code. Useful for web sites, scripting engines, etc.<\/li>\n<li>Loading assemblies for introspection (like ReflectionOnlyLoad), although <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">MetadataLoadContext<\/a> (released in Preview 1) will be a better choice in many cases.<\/li>\n<\/ul>\n<p>More information:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/22166\">Design doc<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/coreclr\/pull\/22221\">Using Unloadability doc<\/a><\/li>\n<\/ul>\n<p>Assembly unloading requires significant care to ensure that all references to managed objects from outside a loader context are understood and managed. When the loader context is requested to be unloaded, any outside references need to have been unreferenced so that the loader context is self-consistent only to itself.<\/p>\n<p>Assembly unloadability was provided in the .NET Framework by Application Domains (AppDomains), which are not supported with .NET Core. AppDomains had both benefits and limitations compared to this new model. We consider this new loader context-based model to be more flexible and higher performance when compared to AppDomains.<\/p>\n<h2><a id=\"user-content-windows-native-interop\" class=\"anchor\" href=\"#windows-native-interop\"><\/a>Windows Native Interop<\/h2>\n<p>Windows offers a rich native API, in the form of flat C APIs, COM and WinRT. We&#8217;ve had support for P\/Invoke since .NET Core 1.0, and have been adding the ability to CoCreate COM APIs and Activate WinRT APIs as part of the .NET Core 3.0 release. We have had many requests for these capabilities, so we know that they will get a lot of use.<\/p>\n<p>Late last year, we announced that we had managed to <a href=\"https:\/\/twitter.com\/runfaster2000\/status\/1053704090671185920\" rel=\"nofollow\">automate Excel from .NET Core<\/a>. That was a fun moment. You can now try this same demo yourself with the <a href=\"https:\/\/github.com\/dotnet\/samples\/tree\/master\/core\/extensions\/ExcelDemo\">Excel demo<\/a> sample. Under the covers, this demo is using COM interop features like NOPIA, object equivalence and custom marshallers.<\/p>\n<p>Managed C++ and WinRT interop are coming in a later preview. We prioritized getting COM interop built first.<\/p>\n<h2><a id=\"user-content-wpf-and-windows-forms\" class=\"anchor\" href=\"#wpf-and-windows-forms\"><\/a>WPF and Windows Forms<\/h2>\n<p>The WPF and Windows Forms teams opened up their repositories, <a href=\"https:\/\/github.com\/dotnet\/wpf\">dotnet\/wpf<\/a> and <a href=\"https:\/\/github.com\/dotnet\/winforms\">dotnet\/winforms<\/a>, respectively, on December 4th, the same day <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">.NET Core 3.0 Preview 1<\/a> was released. Much of the last month, beyond holidays, has been spent interacting with the community, merging PRs, and responding to issues. In the background, they&#8217;ve been integrating WPF and Windows Forms into the .NET Core build system, including adopting the <a href=\"https:\/\/github.com\/dotnet\/arcade\">Arcade<\/a> SDK. Arcade is an MSBuild SDK that exposes functionality which is needed to build the .NET Platform. The WPF team will be publishing more of the WPF source code over the coming months.<\/p>\n<p>The same teams have been making a final set of changes in .NET Framework 4.8. These same changes have also been added to the .NET Core versions of WPF and Windows Forms.<\/p>\n<h2><a id=\"user-content-visual-studio-support\" class=\"anchor\" href=\"#visual-studio-support\"><\/a>Visual Studio support<\/h2>\n<p>Desktop development on .NET Core 3 requires <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-2019-preview-2-is-now-available\/\">Visual Studio 2019<\/a>. We added the WPF and Windows Forms templates to the New Project Dialog to make it easier starting your new applications without using the command line.<\/p>\n<p>The WPF and Windows Forms designer teams are continuing to work on an updated designer for .NET Core, which will be part of a Visual Studio 2019 Update.<\/p>\n<h3><a id=\"user-content-msix-deployment-for-desktop-apps\" class=\"anchor\" href=\"#msix-deployment-for-desktop-apps\"><\/a>MSIX Deployment for Desktop apps<\/h3>\n<p><a href=\"https:\/\/docs.microsoft.com\/windows\/msix\/\" rel=\"nofollow\">MSIX<\/a> is a new Windows app package format. It can be used to deploy .NET Core 3 desktop applications to Windows 10.<\/p>\n<p>The <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/porting\/desktop-to-uwp-packaging-dot-net\" rel=\"nofollow\">Windows Application Packaging Project<\/a>, available in Visual Studio 2019 preview 2, allows you to create MSIX packages with <a href=\"https:\/\/docs.microsoft.com\/dotnet\/core\/deploying\/#self-contained-deployments-scd\" rel=\"nofollow\">self-contained<\/a> .NET Core applications.<\/p>\n<blockquote><p>Note: The .NET Core project file must specify the supported runtimes in the <code>&lt;RuntimeIdentifiers&gt;<\/code> property:<\/p><\/blockquote>\n<div class=\"highlight highlight-text-xml\">\n<pre class=\"lang:default decode:true\">&lt;RuntimeIdentifiers&gt;win-x86;win-x64&lt;\/RuntimeIdentifiers&gt;<\/pre>\n<\/div>\n<h2><a id=\"user-content-install-net-core-30-previews-on-linux-with-snap\" class=\"anchor\" href=\"#install-net-core-30-previews-on-linux-with-snap\"><\/a>Install .NET Core 3.0 Previews on Linux with Snap<\/h2>\n<p>Snap is the preferred way to install and try .NET Core previews on <a href=\"https:\/\/docs.snapcraft.io\/installing-snapd\/6735\" rel=\"nofollow\">Linux distributions that support Snap<\/a>. At present, only X64 builds are supported with Snap. We&#8217;ll look at supporting ARM builds, too.<\/p>\n<p>After configuring Snap on your system, run the following command to install the <a href=\"https:\/\/snapcraft.io\/dotnet-sdk\" rel=\"nofollow\">.NET Core SDK 3.0 Preview SDK<\/a>.<\/p>\n<div class=\"highlight highlight-text-shell-session\">\n<pre class=\"lang:default decode:true \">sudo snap install dotnet-sdk --beta --classic<\/pre>\n<p><span style=\"font-size: 1rem;\">When .NET Core in installed using the Snap package, the default .NET Core command is <\/span><code>dotnet-sdk.dotnet<\/code><span style=\"font-size: 1rem;\">, as opposed to just <\/span><code>dotnet<\/code><span style=\"font-size: 1rem;\">. The benefit of the namespaced command is that it will not conflict with a globally installed .NET Core version you may have. This command can be aliased to <\/span><code>dotnet<\/code><span style=\"font-size: 1rem;\"> with:<\/span><\/p>\n<\/div>\n<div class=\"highlight highlight-text-shell-session\">\n<pre class=\"lang:default decode:true \">sudo snap alias dotnet-sdk.dotnet dotnet<\/pre>\n<p><span style=\"font-size: 1rem;\">Some distros require an additional step to enable access to the SSL certificate. See our <\/span><a style=\"background-color: #f7f7f9; font-size: 1rem;\" href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/Documentation\/linux-setup.md\">Linux Setup<\/a><span style=\"font-size: 1rem;\"> for details.<\/span><\/p>\n<\/div>\n<h2><a id=\"user-content-platform-support\" class=\"anchor\" href=\"#platform-support\"><\/a>Platform Support<\/h2>\n<p>.NET Core 3 will be supported on the following operating systems:<\/p>\n<ul>\n<li>Windows Client: 7, 8.1, 10 (1607+)<\/li>\n<li>Windows Server: 2012 R2 SP1+<\/li>\n<li>macOS: 10.12+<\/li>\n<li>RHEL: 6+<\/li>\n<li>Fedora: 26+<\/li>\n<li>Ubuntu: 16.04+<\/li>\n<li>Debian: 9+<\/li>\n<li>SLES: 12+<\/li>\n<li>openSUSE: 42.3+<\/li>\n<li>Alpine: 3.8+<\/li>\n<\/ul>\n<p>Chip support follows:<\/p>\n<ul>\n<li>x64 on Windows, macOS, and Linux<\/li>\n<li>x86 on Windows<\/li>\n<li>ARM32 on Windows and Linux<\/li>\n<li>ARM64 on Linux<\/li>\n<\/ul>\n<p>For Linux, ARM32 is supported on Debian 9+ and Ubuntu 16.04+. For ARM64, it is the same as ARM32 with the addition of Alpine 3.8. These are the same versions of those distros as is supported for X64. We made a conscious decision to make supported platforms as similar as possible between X64, ARM32 and ARM64.<\/p>\n<p>Docker images for .NET Core 3.0 are available at <a href=\"https:\/\/hub.docker.com\/r\/microsoft\/dotnet\/\" rel=\"nofollow\">microsoft\/dotnet on Docker Hub<\/a>. We are in the process of adopting <a href=\"https:\/\/cloudblogs.microsoft.com\/opensource\/2019\/01\/17\/improved-discovery-experience-microsoft-containers-docker-hub\/\" rel=\"nofollow\">Microsoft Container Registry (MCR)<\/a>. We expect that the final .NET Core 3.0 images will only be published to MCR.<\/p>\n<h2><a id=\"user-content-closing\" class=\"anchor\" href=\"#closing\"><\/a>Closing<\/h2>\n<p>Take a look at the <a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2018\/12\/04\/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks\/\" rel=\"nofollow\">.NET Core 3.0 Preview 1 post <\/a> if you missed that. It includes a broader description of the overall release including the initial set of features, which are also included and improved on in Preview 2.<\/p>\n<p>Thanks to everyone that installed .NET Core 3.0 Preview 1. We appreciate you trying out the new version and for your feedback. Please share any feedback you have about Preview 2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are announcing .NET Core 3 Preview 2. It includes new features in .NET Core 3.0 and C# 8, in addition to the large number of new features in Preview 1. ASP.NET Core 3.0 Preview 2\u00a0 is also\u00a0released today. C# 8 Preview 2 is part of .NET Core 3 SDK, and was also released [&hellip;]<\/p>\n","protected":false},"author":336,"featured_media":21785,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[196],"tags":[9,433],"class_list":["post-21505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet-core","tag-net-core","tag-preview"],"acf":[],"blog_post_summary":"<p>Today, we are announcing .NET Core 3 Preview 2. It includes new features in .NET Core 3.0 and C# 8, in addition to the large number of new features in Preview 1. ASP.NET Core 3.0 Preview 2\u00a0 is also\u00a0released today. C# 8 Preview 2 is part of .NET Core 3 SDK, and was also released [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/336"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=21505"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/21505\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/21785"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=21505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=21505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=21505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}