Quantcast
Channel: .NET Blog
Viewing all 4000 articles
Browse latest View live

.NET Framework December 2018 Security and Quality Rollup

$
0
0

Today, we are releasing the December 2018 Security and Quality Rollup.

Security

CVE-2018-8540 – Windows Remote Code Execution Vulnerability

This security update resolves a vulnerability in Microsoft .NET Framework that could allow remote code execution when Microsoft .NET Framework doesn’t validate input correctly. The attacker who successfully exploits this vulnerability could take control of an affected system. An attacker could then install programs; view, change, or delete data; or create new accounts that use full user rights. Users whose accounts are configured to have fewer user rights on the system could be less affected than users who are granted administrative user rights.

Getting the Update

The Security and Quality Rollup is available via Windows Update, Windows Server Update Services, Microsoft Update Catalog, and Docker.

Microsoft Update Catalog

You can get the update via the Microsoft Update Catalog. For Windows 10, .NET Framework updates are part of the Windows 10 Monthly Rollup.

The following table is for Windows 10 and Windows Server 2016+.

Product Version Security and Quality Rollup KB
Windows 10 1809 (October 2018 Update)
Windows Server 2019
Catalog
4470502
.NET Framework 3.5 4470502
.NET Framework 4.7.2 4470502
Windows 10 1803 (April 2018 Update) Catalog
4471324
.NET Framework 3.5 4471324
.NET Framework 4.7.2 4471324
Windows 10 1709 (Fall Creators Update) Catalog
4471329
.NET Framework 3.5 4471329
.NET Framework 4.7.1, 4.7.2 4471329
Windows 10 1703 (Creators Update) Catalog
4471327
.NET Framework 3.5 4471327
.NET Framework 4.7, 4.7.1, 4.7.2 4471327
Windows 10 1607 (Anniversary Update)
Windows Server 2016
Catalog
4471321
.NET Framework 3.5 4471321
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2 4471321
Windows 10 1507 Catalog
4471323
.NET Framework 3.5 4471323
.NET Framework 4.6, 4.6.1, 4.6.2 4471323

The following table is for earlier Windows and Windows Server versions.

Product Version Security and Quality Rollup KB Security Only Update KB
Windows 8.1
Windows RT 8.1
Windows Server 2012 R2
Catalog
4471989
Catalog
4471983
.NET Framework 3.5 4470630 4470602
.NET Framework 4.5.2 4470622 4470491
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 4470639 4470499
Windows Server 2012 Catalog
4471988
Catalog
4471982
.NET Framework 3.5 4470629 4470601
.NET Framework 4.5.2 4470623 4470492
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 4470638 4470498
Windows 7
Windows Server 2008 R2
Catalog
4471987
Catalog
4471984
.NET Framework 3.5.1 4470641 4470600
.NET Framework 4.5.2 4470637 4470493
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 4470640 4470500
Windows Server 2008 Catalog
4471990
Catalog
4471984
.NET Framework 3.5 SP1 4471102 4470633
.NET Framework 4.5.2 4470637 4470493
.NET Framework 4.6 4470640 4470500

Docker Images

We are updating the following .NET Framework Docker images for today’s release:

Note: Look at the “Tags” view in each repository to see the updated Docker image tags.

Previous Monthly Rollups

The last few .NET Framework Monthly updates are listed below for your convenience:


Visual Studio 2019 Preview .NET Productivity

$
0
0

As you hopefully heard, the first preview of Visual Studio 2019 is now available. In this post I’ll cover some of the productivity improvements for .NET developers we’re most excited about. For a complete list, check out the release notes.

Regex Language Support

Any regular expressions in your C# or Visual Basic files now have syntax highlighting, compiler diagnostics, and code fixes! This parsing support can recognize strings passed to the regex constructor and strings immediately preceded with a comment containing the string `language=regex`. The language features currently included in this release are classification, brace matching, highlight references, and compiler diagnostics.

Export editor settings to Editorconfig

You can now export editor settings to an Editorconfig file through Tools > Options > Text Editor > C# > Code Style with the button “Generate .editorconfig file from settings”.

Generate your code style settings to a .editorconfig file.

Code Fixes and Refactorings

We added several of the top-requested code fixes and refactorings in Visual Studio 2019 Preview 1. Many were implemented by the community so hats off to our awesome contributors! Refactorings and quick actions are available using (Ctrl + .) or (Alt + Enter).

Foreach loop to LINQ query

Foreach loops to LINQ queries or LINQ methods now join the other loop refactoring options including converting LINQ to Foreach, For loop to Foreach, and Foreach to For loop.

Add “Using” Statement on copy/paste

Convert anonymous type to class

Convert local function to method

More new code fixes and refactorings:

  • Convert tuple to a named-struct.
  • Dead code analysis for unused private members with an optional code fix to remove unused member declaration.
  • Generate a deconstruct method.
  • Add “await” where it is implied, but there is no compiler warning.

View all the code fixes and refactorings for .NET in our docs.

Document health indicator

The document health indicator allows you to look in one place to know if code style errors or warnings are present in the file you have open and makes it easy to jump to them. The indicator appears in the bottom right corner of your code editor making it easy to access code style configurations and run code cleanup.

Document Health Indicator

Find All References and CodeLens Razor support

Find All Reference (Shift-F12) and CodeLens now show results from Razor (.cshtml) files in the solution. You can then navigate to the identified code in the relevant Razor files.

CodeLens now shows Razor (.cshtml) results.

Razor results in Find All References.

Run tests from Solution Explorer

You can now right-click on tests, test classes, or test projects in the Solution Explorer to run or debug tests.

Right-click to run tests from the Solution Explorer.

As always, thank you for trying out previews, giving feedback on Developer Community, and using the Report a Problem tool in Visual Studio. Read more or watch a video on other Visual Studio 2019 Preview 1 features in the blog post.

Announcing .NET Framework 4.8 Early Access Build 3707

$
0
0

We have another early access build to share today! This release includes several accessibility, performance, reliability and stability fixes across the major framework libraries. We will continue to stabilize this release and take more fixes over the coming months and we would greatly appreciate it if you could help us ensure Build 3707 is a high-quality release by trying it out and providing feedback on the new features via the .NET Framework Early Access GitHub repository.

We’d also like to note that the set of supported OS platforms for this EAP build now match the same set of OS platforms supported for .NET 4.7.2 (with Windows 10, version 1809 and Windows Server 2019 being new additions).

Supported Windows Client versions: Windows 10 version 1809, Windows 10 version 1803, Windows 10 version 1709, Windows 10 version 1703, Windows 10 version 1607, Windows 8.1, Windows 7 SP1

Supported Windows Server versions: Windows Server 2019, Windows Server version 1803, Windows Server version 1709, Windows Server 2016, Windows Server 2012, Windows Server 2012 R2, Windows Server 2008 R2 SP1

This build includes an updated .NET 4.8 runtime as well as the .NET 4.8 Developer Pack (a single package that bundles the .NET Framework 4.8 runtime, the .NET 4.8 Targeting Pack and the .NET Framework 4.8 SDK). Please note: this build is not supported for production use.

 Next steps:
To explore the new build, download the .NET 4.8 Developer Pack. Instead, if you want to try just the .NET 4.8 runtime, you can download either of these:

You can checkout the fixes included in this preview build or if you would like to see the complete list of improvements in 4.8 so far, please go here.

.NET Framework build 3707 is also included in the next update for Windows 10. You can sign up for Windows Insiders to validate that your applications work great on the latest .NET Framework included in the latest Windows 10 releases.

Thanks!

.NET Framework January 2019 Security and Quality Rollup

$
0
0

Today, we are releasing the January 2019 Security and Quality Rollup.

Security

CVE-2019-0545 – Windows Security Feature Bypass Vulnerability

This security update resolves a vulnerability in Microsoft .NET Framework that may cause an information disclosure that allows bypassing Cross-origin Resource Sharing (CORS) configurations. An attacker who successfully exploits the vulnerability could retrieve from a web application content that’s normally restricted. This security update addresses the vulnerability by enforcing CORS configuration to prevent its bypass.

CVE-2019-0545

Getting the Update

The Security and Quality Rollup is available via Windows Update, Windows Server Update Services, Microsoft Update Catalog, and Docker.

Microsoft Update Catalog

You can get the update via the Microsoft Update Catalog. For Windows 10, .NET Framework updates are part of the Windows 10 Monthly Rollup.

The following table is for Windows 10 and Windows Server 2016+ versions.

Product Version Security and Quality Rollup KB
Windows 10 1809 (October 2018 Update)
Windows Server 2019

Catalog
4480056
.NET Framework 3.5, 4.7.2 4480056
Windows 10 1803 (April 2018 Update) Catalog
4480966
.NET Framework 3.5, 4.7.2 4480966
Windows 10 1709 (Fall Creators Update) Catalog
4480978
.NET Framework 3.5, 4.7.1, 4.7.2 4480978
Windows 10 1703 (Creators Update) Catalog
4480973
.NET Framework 3.5, 4.7, 4.7.1, 4.7.2 4480973
Windows 10 1607 (Anniversary Update)
Windows Server 2016
Catalog
4480961
.NET Framework 3.5, 4.6.2, 4.7, 4.7.1, 4.7.2< 4480961
Windows 10 1507 Catalog
4480962
.NET Framework 3.5, 4.6, 4.6.1, 4.6.2< 4480962

The following table is for earlier Windows and Windows Server versions.

 

Product Version Security and Quality Rollup KB Security Only Update KB
Windows 8.1
Windows RT 8.1
Windows Server 2012 R2
Catalog
4481485
Catalog
4481484
.NET Framework 3.5 Catalog
4480064
Catalog
4480086
.NET Framework 4.5.2 Catalog
4480057
Catalog
4480074
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480054
Catalog
4480071
Windows Server 2012 Catalog
4481482
Catalog
4481483
.NET Framework 3.5 Catalog
4480061
Catalog
4480083
.NET Framework 4.5.2 Catalog
4480058
Catalog
4480075
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480051

Catalog
4480070
Windows 7 SP1
Windows Server 2008 R2 SP1
Catalog
4481480
Catalog
4481481
.NET Framework 3.5.1 Catalog
4480063
Catalog
4480085
.NET Framework 4.5.2 Catalog
4480059
Catalog
4480076
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480055
Catalog
4480072
Windows Server 2008 Catalog
4481486
Catalog
4481487
.NET Framework 2.0, 3.0 Catalog
4480062
Catalog
4480084
.NET Framework 4.5.2 Catalog
4480059
Catalog
4480076
.NET Framework 4.6 Catalog
4480055
Catalog
4480072

Docker Images

We are updating the following .NET Framework Docker images for today’s release:

Note: Look at the “Tags” view in each repository to see the updated Docker image tags.

Note: Significant changes have been made with Docker images recently. Please look at .NET Docker Announcements for more information.

Previous Monthly Rollups

The last few .NET Framework Monthly updates are listed below for your convenience:

.NET Core January 2019 Updates – 2.1.7 and 2.2.1

$
0
0

Today, we are releasing the .NET Core January 2019 Update. These updates contain security and reliability fixes.

Security

CVE-2019-0545: .NET Core Information Disclosure Vulnerability

The security update addresses the vulnerability by enforcing Cross-origin Resource Sharing (CORS) configuration to prevent its bypass in .NET Core 2.1 and 2.2. An attacker who successfully exploited the vulnerability could retrieve content, that is normally restricted, from a web application.

CVE-2019-0548: ASP.NET Core Denial Of Service Vulnerability

This security vulnerability exists in ASP.NET Core 1.0, 1.1, 2.1 and 2.2. If an application is hosted on Internet Information Server (IIS) a remote unauthenticated attacker can use a specially crafted request to cause a Denial of Service.

CVE-2019-0564: ASP.NET Core Denial Of Service Vulnerability

This security vulnerability exists in ASP.NET Core 1.0, 1.1, 2.1 and 2.2. If an application is hosted on Internet Information Server (IIS) a remote unauthenticated attacker can use a specially crafted request to cause a Denial of Service.

CVE-2018-8416: .NET Core Tampering Vulnerability

A security vulnerability exists wherein .NET Core 2.1 improperly handles specially crafted files. An attacker who successfully exploited this vulnerability could write arbitrary files and directories to certain locations on a vulnerable system. However, an attacker would have limited control over the destination of the files and directories.

To exploit the vulnerability, an attacker must send a specially crafted file to a vulnerable system.

Windows ARM support

This release includes the first availability of .NET Core for Windows Server, version 1809 ARM32. Runtime zips can be found on the downloads page. The SDK zip is expected to be live on the 9th and this note will be updated when that happens.

Getting the Update

The latest .NET Core updates are available on the .NET Core download page. This update is included in the Visual Studio 15.9.5 update, which is also releasing today.

See the .NET Core release notes ( 2.1.7 | 2.2.1 ) for details on the release including a detailed commit list and affected files.

Docker Images

The .NET Core Docker images have been updated for this release. Details on our Docker versioning and how to work with the images can be seen in “Staying up-to-date with .NET Container Images”.

microsoft/dotnet
microsoft/dotnet-samples
microsoft/aspnetcore

Azure App Services deployment

Update: Deployment of .NET Core 2.1.7 and 2.2.1 to Azure App Services is complete. 2.1.7 and 2.2.1 are available in all regions.

Tell us your thoughts on ML.NET, an open source and cross-platform machine learning framework

$
0
0

ML.NET is an open source and cross-platform machine learning framework made for .NET developers. .NET developers can use their C# or F# skills to easily integrate custom machine learning into their web, mobile, desktop, gaming, or IoT applications without any prior expertise in developing or tuning machine learning models. ML.NET covers many machine learning scenarios, including classification, regression, recommendation, clustering, anomaly detection, ranking, and deep learning.

ML.NET is still new, and as we are developing it, we would love to get your feedback! Please fill out the brief survey below and help shape the future of ML.NET by telling us about your usage and interest in Machine Learning and ML.NET.

Take the survey now!

At the end of the survey, you can leave your name and e-mail address (optional) so that an engineer on the .NET team can reach out to you to talk a little bit more about your experiences and thoughts.

We appreciate your contribution!

Announcing ML.NET 0.9 – Machine Learning for .NET

$
0
0

Announcing ML.NET 0.9 – Machine Learning for .NET

alt text

ML.NET is an open-source and cross-platform machine learning framework (Windows, Linux, macOS) for .NET developers. Using ML.NET, developers can leverage their existing tools and skillsets to develop and infuse custom AI into their applications by creating custom machine learning models.

ML.NET allows you to create and use machine learning models targeting common tasks such as classification, regression, clustering, ranking, recommendations and anomaly detection. It also supports the broader open source ecosystem by proving integration with popular deep-learning frameworks like TensorFlow and interoperability through ONNX. Some common use cases of ML.NET are scenarios like Sentiment Analysis, Recommendations, Image Classification, Sales Forecast, etc. Please see our samples for more scenarios.

Today we’re happy to announce the release of ML.NET 0.9. ( ML.NET 0.1 was released at //Build 2018). This release focuses on: API improvements, model explainability and feature contribution, support for GPU when scoring ONNX models and significant clean up of the framework internals.

This blog post provides details about the following topics in the ML.NET 0.9 release:

Feature Contribution Calculation and other model explainability improvements

Feature Contribution Calculation (FCC)

The Feature Contribution Calculation (FCC for short) shows which features are most influential for a model’s prediction on a particular and individual data sample by determining the amount each feature contributed to the model’s score for that particular data sample.

FCC is particulary important when you initialy have a lot of features/attributes in your historic data and you want to select and use only the most important features because using too many features (especially if including features that don’t influence the model) can reduce the model’s performance and accuracy. Therefore, with FCC you can identify the most influential positive and negative contributions from the initial attribute set.

You can use FCC to produce feature contributions with code like the following:

// Create a Feature Contribution Calculator
// Calculate the feature contributions for all features given trained model parameters

var featureContributionCalculator = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11, normalize: false);

// FeatureContributionCalculatingEstimator can be use as an intermediary step in a pipeline. 
// The features retained by FeatureContributionCalculatingEstimator will be in the FeatureContribution column.

var pipeline = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11)
    .Append(mlContext.Regression.Trainers.OrdinaryLeastSquares(featureColumn: "FeatureContributions"));
The output of the above code is:

  Label   Score   BiggestFeature         Value   Weight   Contribution

  24.00   27.74   RoomsPerDwelling        6.58    98.55   39.95
  21.60   23.85   RoomsPerDwelling        6.42    98.55   39.01
  34.70   29.29   RoomsPerDwelling        7.19    98.55   43.65
  33.40   27.17   RoomsPerDwelling        7.00    98.55   42.52

FCC can be used as a step in the ML pipeline and complements the current explainability tools in ML.NET like Permutation Feature Importance (PFI). With ML.NET 0.8, we already provided initial APIs for model explainability to help machine learning developers better understand the feature importance of models (“Overall Feature Importance”) and create (“Generalized Additive Models”)

Sample for FCC.

Additional model explainability improvements for features selection

In addition to FCC, we also extended the capabilities of Permutation Feature Importance (PFI) and Generalized Additive Models (GAMs):

  • PFI now supports most learning tasks: Regression, Binary Classification, Multiclass Classification, and Ranking.

  • PFI now allows you to calculate confidence intervals on feature importance scores to allow you to get a better estimate of the mean.

  • GAMs now supports Feature Contribution Calculation (FCC) so you can quickly see which features drove an individual prediction.

Sample for PFI.

Added GPU support for ONNX Transform

alt text

In ML.NET 0.9 we added the capability to score/run ONNX models using CUDA 10.0 enabled GPUs (such as most NVIDIA GPUs), by integrating the high performance ONNX Runtime library. GPU support for ONNX models is currently available only on Windows 64-bit (not x86,yet), with Linux and Mac support coming soon. Learn here about supported ONNX/CUDA formats/version.

Sample code plus a Test here.

New Visual Studio ML.NET project templates preview

alt text

We are pleased to announce a preview of Visual Studio project templates for ML.NET. These templates make it very easy to get started with machine learning. You can download these templates from Visual Studio gallery here.

The templates cover the following scenarios:

  • ML.NET Console Application – Sample app that demonstrates how you can use a machine learning model in your application.
  • ML.NET Model Library – Creates a new machine learning model library which you can consume from within your application.

VS ML.NET templates screenshot

Additional API improvements in ML.NET 0.9

In this release we have also added other enhancements to our APIs such as the following.

Text data loading is simplified

In ML.NET 0.9, when using the TextLoader class you can either directly provide the attributes/columns in the file as you were able to do it in previous versions or as a new improvement and optional choice you can instead specify those columns/attributes through a data-model class.

Before ML.NET v0.9 you always needed to have explicit code like the following:

//
//... Your code...
var mlContext = new MLContext();

// Create the reader: define the data columns and where to find them in the text file.
var reader = mlContext.Data.CreateTextReader(new[] {
        new TextLoader.Column("IsOver50K", DataKind.BL, 0),
        new TextLoader.Column("Workclass", DataKind.TX, 1)
    },hasHeader: true
);
var dataView = reader.Read(dataPath);

With 0.9, you can simply load the type as follows.

//
//... Your code in your class...
var mlContext = new MLContext();

// Read the data into a data view.
var dataView = mlContext.Data.ReadFromTextFile<InspectedRow>(dataPath, hasHeader: true);

// The data model. This type will be used from multiple code. 
private class InspectedRow
{
    [LoadColumn(0)]
    public bool IsOver50K { get; set; }
    [LoadColumn(1)]
    public string Workclass { get; set; }
}

Sample code.

Get prediction confidence factor

With Calibrator Estimators, in addition to the score column you can get when evaluating the quality of your model you can now get a probability column as well (probability of this example being on the predicted class; prediction confidence indicator).

For instance, you could get a list of the probabilities per each predicted value, like in the following list:

Score - 0.458968    Probability 0.4670409
Score - 0.7022135   Probability 0.3912723
Score 1.138822      Probability 0.8703266

Sample code

New Key-Value mapping estimator and transform

This feature replaces the TermLookupTransform and provides a way to
specify the mapping betweeen two values (note this is specified and not
trained). You can specify the mapping by providing a keys list and
values list that must be equal in size.

Sample code

Other improvements and changes

  • Allow ML.NET to run on Windows Nano containers or Windows machines without Visual C++ runtime installed.
  • Metadata Support In DataView Construction with information about the model, like the evaluation metrics which is encoded metadata into the model and can be programatically extracted and therefore visualized in any tool. This feature can be useful for ISVs.
  • For a with list of breaking changes in v0.9 that impacted the ML.NET samples, check this Gist here

Moving forward

While on the past 9 months we have been adding new features and improving ML.NET, in the forthcoming 0.10, 0.11 and upcoming releases before we reach v1.0, we will focus on the overall stability of the package, continue to refine the API, increase test coverage and improve documentation and samples.

Provide your feedback through the new ML.NET survey!

ML.NET is new, and as we are developing it, we would love to get your feedback! Please fill out the brief survey below and help shape the future of ML.NET by telling us about your usage and interest in Machine Learning and ML.NET.

Take the survey now!

alt text

Get started!

alt text

If you haven’t already get started with ML.NET here.

Next, going further explore some other resources:

We will appreciate your feedback by filing issues with any suggestions or enhancements in the ML.NET GitHub repo to help us shape ML.NET and make .NET a great platform of choice for Machine Learning.

Thanks and happy coding with ML.NET!

The ML.NET Team.

This blog was authored by Cesar de la Torre and Pranav Rastogi plus additional contributions from the ML.NET team

.NET Framework January 2019 Preview of Quality Rollup

$
0
0

Today, we are releasing the January 2019 Preview of Quality Rollup.

Quality and Reliability

This release contains the following quality and reliability improvements.

SQL

Mitigatecompatibility breaks seen in some System.Data.SqlClient usage scenarios. [721209]

WCF

Addressed a race condition with IIS hosted net.tcp WCF services when the port sharing service is restarted which resulted in the service being unavailable. [663905]

Getting the Update

The Security and Quality Rollup is available via Windows Update, Windows Server Update Services, and Microsoft Update Catalog.

Microsoft Update Catalog

You can get the update via the Microsoft Update Catalog. For Windows 10, .NET Framework updates are part of the Windows 10 Monthly Rollup.

The following table is for Windows 10 and Windows Server 2016+ versions.

Product Version Preview of Quality Rollup KB
Windows 10 1803 (April 2018 Update) Catalog
4480976
.NET Framework 3.5, 4.7.2 4480976
Windows 10 1709 (Fall Creators Update) Catalog
4480967
.NET Framework 3.5, 4.7.1, 4.7.2 4480967
Windows 10 1703 (Creators Update) Catalog
4480959
.NET Framework 3.5, 4.7, 4.7.1, 4.7.2 4480959

The following table is for earlier Windows and Windows Server versions.

Product Version Preview of Quality Rollup KB
Windows 8.1
Windows RT 8.1
Windows Server 2012 R2
Catalog
4481490
.NET Framework 3.5 Catalog
4480064
.NET Framework 4.5.2 Catalog
4480057
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480095
Windows Server 2012 Catalog
4481489
.NET Framework 3.5 Catalog
4480061
.NET Framework 4.5.2 Catalog
4480058
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480094
Windows 7 SP1
Windows Server 2008 R2 SP1
Catalog
4481488
.NET Framework 3.5.1 Catalog
4480063
.NET Framework 4.5.2 Catalog
4480059
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2 Catalog
4480096
Windows Server 2008 Catalog
4481491
.NET Framework 2.0, 3.0 Catalog
4480062
.NET Framework 4.5.2 Catalog
4480059
.NET Framework 4.6 Catalog
4480096

Previous Monthly Rollups

The last few .NET Framework Monthly updates are listed below for your convenience:


Help us help you! What desktop apps are you bringing to .NET Core 3.0?

$
0
0

Windows Desktop applications are coming to .NET Core. The recently released .NET Core 3.0 Preview 1 version includes WinForms and WPF support.

To make .NET Core 3.0 viable for as many of you as possible, we have created a survey to understand the types of desktop applications you want to build with .NET Core. Based on the information you provide, we may contact some of you (if you agree) to collaborate on your .NET Core 3.0 efforts. We’ll learn from working with you how to improve the experience and documentation for bringing desktop applications to .NET Core.

There are many reasons to choose .NET Core for building desktop apps, such as:

  • More deployment options (like the ability to install multiple versions of .NET Core. side-by-side as well as publish self-contained apps).
  • Better high DPI support.
  • More frequent updates.
  • Improved performance.
  • Benefiting from the open-source community.
  • New features that are only available on .NET Core (such as Span<T>).

Take survey!

The survey should take about 3 minutes to complete.

See also

.NET Framework January 22, 2018 Cumulative Update for Windows 10 version 1809 and Windows Server 2019

$
0
0

Today, we are releasing the January 22, 2018 .NET Framework Cumulative Update for Windows 10 version 1809 and Windows Server 2019.

For more information about the new Cumulative Updates for .NET Framework for Windows 10 version 1809 and Windows Server 2019 please refer to this recent announcement.

Quality and Reliability

This release contains the following quality and reliability improvements.

CLR

Addresses a garbage collection issue in JIT-compiled code. [672191]

SQL

Mitigatecompatibility breaks seen in some System.Data.SqlClient usage scenarios. [721209]

WCF

Addressed a race condition with IIS hosted net.tcp WCF services when the portsharing service is restarted which resulted in the service being unavailable. [663905]

Getting the Update

The Security and Quality Rollup is available via Windows Update, Windows Server Update Services, and Microsoft Update Catalog.

Microsoft Update Catalog

You can get the update via the Microsoft Update Catalog. For Windows 10, .NET Framework updates are part of the Windows 10 Monthly Rollup.

The following table is for Windows 10 and Windows Server 2016+ versions.

 

Product Version Preview of Quality Rollup KB
Windows 10 1809 (October 2018 Update) Catalog
4481031
.NET Framework 3.5, 4.7.2 4481031

 

.NET Core tooling update for Visual Studio 2019 Preview 2

$
0
0

Another preview of Visual Studio 2019, another update on the cool stuff going into it!

We’re pleased to announce some updates to the .NET Core tools for Visual Studio 2019. You can try these changes out starting with Preview 2. We’d love for you to try out these new features and give us feedback.

Debugging console apps will use the new Integrated Console

Console apps that target .NET Core (or .NET Framework via the .NET SDK) will default to using the new Integrated Console experience when pressing f5 or ctrl+f5:

This should prevent the need to add Console.Read() calls to console apps to prevent the console window from closing immediately after the program has finished executing. The launched console window is also re-used for subsequent runs, so if you’re used to using ctrl+f5, you won’t have lots of console windows to close after you’ve launched your application a few times.

If you’d like to turn this off, you can do so under Tools > Options > Automatically close the console when debugging stops.

Project files are easier to use

We’ve also done a lot of work to make working with project files easier. A lot of users have started to use project files directly now that they are much more human-readable, but tooling support for doing so in Visual Studio has lagged behind.

First, we’ve made project files significantly easier to open. Single-click on a project node will open the file in a Preview tab. Double-click will open the file in a normal file tab:

Project files will now show up in Go to All results (ctrl+T):

MSBuild elements in project files now show up in Find in Files results:

Finally, if a project is misauthored and an error is caused, you can open the project file by double-clicking an error from the error list.

Wrapping up

We’d love to hear your feedback on these features when you try them out! And if you encounter a problem, please don’t hesitate to file and issue with the Report A Problem tool in Visual Studio 2019.

Happy hacking!

Announcing F# 4.6 Preview

$
0
0

We’re excited to announce that Visual Studio 2019 will ship a new version of F# when it releases: F# 4.6!

F# 4.6 is a smaller update to the F# language, making it a “true” point-release. As with previous versions of F#, F# 4.6 was developed entirely via an open RFC (requests for comments) process. The F# community has offered very detailed feedback in discussions for this version of the language. You can view all RFCs that correspond with this release here:

This post will detail the feature set and how to get started.

Get started

First, install either:

Next, update your FSharp.Core dependency to FSharp.Core 4.6 (or higher). If you’re using Visual Studio, you can do this with the NuGet Package Management UI. If you are not using Visual Studio, or prefer hand-editing project files, add this to the project file:

Once you have installed the necessary bits, you can use F# 4.6 with Visual Studio, Visual Studio for Mac, or Visual Studio Code with Ionide.

Anonymous Records

Aside from various bug fixes, the only language change in F# 4.6 is the introduction of Anonymous Record types.

Basic usage

From an F#-only perspective, Anonymous Records are F# record types that don’t have explict names and can be declared in an ad-hoc fasion. Although they are unlikely to fundamentally change how you write F# code, they do fill many smaller gaps F# programmers have encountered over time, and can be used for succinct data manipuation that was not previously possible.

They’re quite easy to use. For example, here how you can interact with a function that produces an anonymous record:

However, they can be used for more than just basic data containers. The following expands the previous sample to use a more type-safe printing function:

If you attempt to call `printCircleStats` with an anonymous record that had the same underlying data types but different labels, it will fail to compile:

This is exactly how F# record types work, except everything has been declared ad-hoc rather than up-front. This has benefits and drawbacks depending on your particular situation, so we recommend using anonymous records judiciously rather than replacing all your up-front F# record declarations.

Struct anonymous records

Anonymous records can also be structs by using the struct keyword:

You can call a function that takes a struct anonymous record can be done explicitly like this:

Or you can use “structness inference” to elide the `struct` at the call site:

This will treat the instance of the anonymous record you created as if it were a struct.

Note that the reverse is not true:

It is not currently possible to define IsByRefLike or IsReadOnly struct anonymous record types. There is a language suggestion that proposes this enhancement, but due to oddities in syntax it is still under discussion.

Taking things further

Anonymous records can be used in a broader set of more advanced contexts.

Anonymous records are serializable

You can serialize and deserialize anonymous records:

This outputs what you might expect:

Here’s a sample library that is also called in another project:

This may make things easier for scenarios like lightweight data going over a network in a system made up of microservices.

Anonymous records can be combined with other type definitions

You may have a tree-like data model in your domain, such as the following example:

It is typical to see cases modeled as tuples with named union fields, but as data gets more complicated, you may extract each case with records:

This recursive definition can now be shortened with anonymous records if it suits your codebase:

As with previous examples, this technique should be applied judiciously and when applicable to your scenario.

Anonymous records ease the use of LINQ in F#

F# programmers typically prefer using the List, Array, and Sequence combinators when working with data, but it can sometimes be helpful to use LINQ. This has traditionally been a bit painful, since LINQ makes use of C# anonymous types.

With anonymous records, you can use LINQ methods just as you would with C# and anonymous types:

This prints:

Anonymous records ease working with Entity Framework and other ORMs

F# programmers using F# query expressions to interact with a database should see some minor quality of life improvements with anonymous records.

For example, you may be used to using tuples to group data with a `select` clause:

But this results in columns with names like Item1 and Item2 that are not ideal. Prior to anonymous records, you would need to declare a record type and use that. Now you don’t need to do that:

Not need to specify the record type up front! This makes query expressions much more aligned with the actual SQL that they model.

Anonymous records also let you avoid having to create AnonymousObject types in more advanced queries just to create an ad-hoc grouping of data for the purposes of the query.

Anonymous records ease the use of custom routing in ASP.NET Core

You may be using ASP.NET Core with F# already, but may have run into an awkwardness when defining custom routes. As with previous examples, this could still be done by defining a record type up front, but this has often been seen as unnecessary by F# developers. Now you can do it inline:

It’s still not ideal due to the fact that F# is strict about return types (unlike C#, where you need not explicitly ignore things that return a value). However, this does let you remove previously-defined record definitions that served no purpose other than to allow you to send data into the ASP.NET middleware pipeline.

Copy and update expressions with anonymous records

As with Record types, you can use copy-and-update syntax with anonymous records:

However, copy-and-update expressions do not restrict the resulting anonymous record to be the same type:

The original expression can also be a record type:

You can also copy data to and from reference and struct anonymous records:

The use of copy-and-update expressions gives anonymous records a high degree of flexibility when working with data in F#.

Equality and pattern matching

Anonymous records are structurally equatable and comparable:

However, the types being compared must have the same “shape”:

Although you can equate and compare anonymous records, you cannot pattern match over them. This is for two reasons:

  • A pattern must account for every field of an anonymous record, unlike record types. This is because anonymous records do not support structural subtyping – they are nominal types.
  • There is no ability to have additional patterns in a pattern match expression, as each distinct pattern would imply a different anonymous record type.
  • The requirement to account for every field in an anonymous record would make a pattern more verbose than the use of “dot” notation.

Instead, “dot”-syntax is used to extract values from an anonymous record. This will always be at most as verbose as if pattern matching were used, and in practice is likely to be less verbose due to not always extracting every value from an anonymous record. Here’s how to work with a previous example where anonymous records are a part of a discriminated union:

There is currently an open suggestion to allow pattern matching on anonymous records in the limited contexts that they could actually be enabled. If you have a proposed use case, please use that issue to discuss it!

FSharp.Core additions

It wouldn’t be another F# release without additions to the F# Core Library!

ValueOption expansion

The ValueOption type introduces in F# 4.5 now has a few more goodies attached to the type:

  • The DebuggerDisplay attribute to help with debugging
  • IsNone, IsSome, None, Some, op_Implicit, and ToString members

This gives it “parity” with the Option type.

Additionally, there is now a ValueOption module containing the same functions the the `Option` module has:

This should alleviate any concerns that `ValueOption` is the weird sibling of `Option` that doesn’t get the same set of functionality.

tryExactlyOne for List, Array, and Seq

This fine function was contributed by Grzegorz Dziadkiewicz. Here’s how it works:

Wrapping up

Although the total list of features in F# 4.6 isn’t huge, they still go quite deep! We encourage you to try out F# 4.6 and leave us feedback so that we can fine-tune things before the full release. As always, thank you to the F# community for their contributions – both in code and design discussion – that help us continue to advance the F# language.

Cheers, and happy hacking!

Do more with patterns in C# 8.0

$
0
0

Do more with patterns in C# 8.0

Visual Studio 2019 Preview 2 is out! And with it, a couple more C# 8.0 features are ready for you to try. It’s mostly about pattern matching, though I’ll touch on a few other news and changes at the end.

More patterns in more places

When C# 7.0 introduced pattern matching we said that we expected to add more patterns in more places iin the future. That time has come! We’re adding what we call recursive patterns, as well as a more compact expression form of switch statements called (you guessed it!) switch expressions.

Here’s a simple C# 7.0 example of patterns to start us out:

class Point
{
    public int X { get; }
    public int Y { get; }
    public Point(int x, int y) => (X, Y) = (x, y);
    public void Deconstruct(out int x, out int y) => (x, y) = (X, Y);
}

static string Display(object o)
{
    switch (o)
    {
        case Point p when p.X == 0 && p.Y == 0:
            return "origin";
        case Point p:
            return $"({p.X}, {p.Y})";
        default:
            return "unknown";
    }
}

Switch expressions

First, let’s observe that many switch statements really don’t do much interesting work within the case bodies. Often they all just produce a value, either by assigning it to a variable or by returning it (as above). In all those situations, the switch statement is frankly rather clunky. It feels like the 5-decades-old language feature it is, with lots of ceremony.

We decided it was time to add an expression form of switch. Here it is, applied to the above example:

static string Display(object o)
{
    return o switch
    {
        Point p when p.X == 0 && p.Y == 0 => "origin",
        Point p                           => $"({p.X}, {p.Y})",
        _                                 => "unknown"
    };
}

There are several things here that changed from switch statements. Let’s list them out:

  • The switch keyword is "infix" between the tested value and the {...} list of cases. That makes it more compositional with other expressions, and also easier to tell apart visually from a switch statement.
  • The case keyword and the : have been replaced with a lambda arrow => for brevity.
  • default has been replaced with the _ discard pattern for brevity.
  • The bodies are expressions! The result of the selected body becomes the result of the switch expression.

Since an expression needs to either have a value or throw an exception, a switch expression that reaches the end without a match will throw an exception. The compiler does a great job of warning you when this may be the case, but will not force you to end all switch expressions with a catch-all: you may know better!

Of course, since our Display method now consists of a single return statement, we can simplify it to be expression-bodied:

    static string Display(object o) => o switch
    {
        Point p when p.X == 0 && p.Y == 0 => "origin",
        Point p                           => $"({p.X}, {p.Y})",
        _                                 => "unknown"
    };

To be honest, I am not sure what formatting guidance we will give here, but it should be clear that this is a lot terser and clearer, especially because the brevity typically allows you to format the switch in a "tabular" fashion, as above, with patterns and bodies on the same line, and the =>s lined up under each other.

By the way, we plan to allow a trailing comma , after the last case in keeping with all the other "comma-separated lists in curly braces" in C#, but Preview 2 doesn’t yet allow that.

Property patterns

Speaking of brevity, the patterns are all of a sudden becoming the heaviest elements of the switch expression above! Let’s do something about that.

Note that the switch expression uses the type pattern Point p (twice), as well as a when clause to add additional conditions for the first case.

In C# 8.0 we’re adding more optional elements to the type pattern, which allows the pattern itself to dig further into the value that’s being pattern matched. You can make it a property pattern by adding {...}‘s containing nested patterns to apply to the value’s accessible properties or fields. This let’s us rewrite the switch expression as follows:

static string Display(object o) => o switch
{
    Point { X: 0, Y: 0 }         p => "origin",
    Point { X: var x, Y: var y } p => $"({x}, {y})",
    _                              => "unknown"
};

Both cases still check that o is a Point. The first case then applies the constant pattern 0 recursively to the X and Y properties of p, checking whether they have that value. Thus we can eliminate the when clause in this and many common cases.

The second case applies the var pattern to each of X and Y. Recall that the var pattern in C# 7.0 always succeeds, and simply declares a fresh variable to hold the value. Thus x and y get to contain the int values of p.X and p.Y.

We never use p, and can in fact omit it here:

    Point { X: 0, Y: 0 }         => "origin",
    Point { X: var x, Y: var y } => $"({x}, {y})",
    _                            => "unknown"

One thing that remains true of all type patterns including property patterns, is that they require the value to be non-null. That opens the possibility of the "empty" property pattern {} being used as a compact "not-null" pattern. E.g. we could replace the fallback case with the following two cases:

    {}                           => o.ToString(),
    null                         => "null"

The {} deals with remaining nonnull objects, and null gets the nulls, so the switch is exhaustive and the compiler won’t complain about values falling through.

Positional patterns

The property pattern didn’t exactly make the second Point case shorter, and doesn’t seem worth the trouble there, but there’s more that can be done.

Note that the Point class has a Deconstruct method, a so-called deconstructor. In C# 7.0, deconstructors allowed a value to be deconstructed on assignment, so that you could write e.g.:

(int x, int y) = GetPoint(); // split up the Point according to its deconstructor

C# 7.0 did not integrate deconstruction with patterns. That changes with positional patterns which are an additional way that we are extending type patterns in C# 8.0. If the matched type is a tuple type or has a deconstructor, we can use positional patterns as a compact way of applying recursive patterns without having to name properties:

static string Display(object o) => o switch
{
    Point(0, 0)         => "origin",
    Point(var x, var y) => $"({x}, {y})",
    _                   => "unknown"
};

Once the object has been matched as a Point, the deconstructor is applied, and the nested patterns are applied to the resulting values.

Deconstructors aren’t always appropriate. They should only be added to types where it’s really clear which of the values is which. For a Point class, for instance, it’s safe and intuitive to assume that the first value is X and the second is Y, so the above switch expression is intuitive and easy to read.

Tuple patterns

A very useful special case of positional patterns is when they are applied to tuples. If a switch statement is applied to a tuple expression directly, we even allow the extra set of parentheses to be omitted, as in switch (x, y, z) instead of switch ((x, y, z)).

Tuple patterns are great for testing multiple pieces of input at the same time. Here is a simple implementation of a state machine:

static State ChangeState(State current, Transition transition, bool hasKey) =>
    (current, transition) switch
    {
        (Opened, Close)              => Closed,
        (Closed, Open)               => Opened,
        (Closed, Lock)   when hasKey => Locked,
        (Locked, Unlock) when hasKey => Closed,
        _ => throw new InvalidOperationException($"Invalid transition")
    };

Of course we could opt to include hasKey in the switched-on tuple instead of using when clauses – it is really a matter of taste:

static State ChangeState(State current, Transition transition, bool hasKey) =>
    (current, transition, hasKey) switch
    {
        (Opened, Close,  _)    => Closed,
        (Closed, Open,   _)    => Opened,
        (Closed, Lock,   true) => Locked,
        (Locked, Unlock, true) => Closed,
        _ => throw new InvalidOperationException($"Invalid transition")
    };

All in all I hope you can see that recursive patterns and switch expressions can lead to clearer and more declarative program logic.

Other C# 8.0 features in Preview 2

While the pattern features are the major ones to come online in VS 2019 Preview 2, There are a few smaller ones that I hope you will also find useful and fun. I won’t go into details here, but just give you a brief description of each.

Using declarations

In C#, using statements always cause a level of nesting, which can be highly annoying and hurt readability. For the simple cases where you just want a resource to be cleaned up at the end of a scope, you now have using declarations instead. Using declarations are simply local variable declarations with a using keyword in front, and their contents are disposed at the end of the current statement block. So instead of:

static void Main(string[] args)
{
    using (var options = Parse(args))
    {
        if (options["verbose"]) { WriteLine("Logging..."); }
        ...
    } // options disposed here
}

You can simply write

static void Main(string[] args)
{
    using var options = Parse(args);
    if (options["verbose"]) { WriteLine("Logging..."); }

} // options disposed here

Disposable ref structs

Ref structs were introduced in C# 7.2, and this is not the place to reiterate their usefulness, but in return they come with some severe limitations, such as not being able to implement interfaces. Ref structs can now be disposable without implementing the IDisposable interface, simply by having a Dispose method in them.

Static local functions

If you want to make sure your local function doesn’t incur the runtime costs associated with "capturing" (referencing) variables from the enclosing scope, you can declare it as static. Then the compiler will prevent reference of anything declared in enclosing functions – except other static local functions!

Changes since Preview 1

The main features of Preview 1 were nullable reference types and async streams. Both have evolved a bit in Preview 2, so if you’ve started using them, the following is good to be aware of.

Nullable reference types

We’ve added more options to control nullable warnings both in source (through #nullable and #pragma warning directives) and at the project level. We also changed the project file opt-in to <NullableContextOptions>enable</NullableContextOptions>.

Async streams

We changed the shape of the IAsyncEnumerable<T> interface the compiler expects! This brings the compiler out of sync with the interface provided in .NET Core 3.0 Preview 1, which can cause you some amount of trouble. However, .NET Core 3.0 Preview 2 is due out shortly, and that brings the interfaces back in sync.

Have at it!

As always, we are keen for your feedback! Please play around with the new pattern features in particular. Do you run into brick walls? Is something annoying? What are some cool and useful scenarios you find for them? Hit the feedback button and let us know!

Happy hacking,

Mads Torgersen, design lead for C#

.NET and TypeScript at FOSDEM 2019

$
0
0

The schedule for the .NET and Typescript Developer Room at FOSDEM has now been published!

FOSDEM is one of the longest running Free and Open Source conferences, and we’re excited to have a .NET and TypeScript Developer Room this year, with lots of great speakers and sessions.

The conference is Saturday 2nd to Sunday 3rd February at the ULB Solbosch Campus in Brussels. Attendance is free, and there’s no need to register. The .NET and TypeScript Developer Room will run all day Saturday from 10:30am to 7pm in room K.3.201.

Additionally, Scott Hanselman will have a talk on the Main Track Open Source C#, .NET and Blazor at 3pm on Sunday in room Janson. FOSDEM has posted an interview with Scott where you can learn more about his hopes for the talk.

If you missed the call for participation, don’t fret — you can bring a lightning talk on the day.

Debugging .NET Apps with Time Travel Debugging (TTD)

$
0
0

When you are debugging an application, there are many tools and techniques you can use, like logs, memory dumps and Event Tracing for Windows (ETW). In this post, we will talk about Time Travel Debugging, a tool used by Microsoft Support and product teams and more advanced users, but I encourage everyone to try this approach when diagnosing hard to find bugs.

Time Travel Debugging

Time Travel Debugging or TTD, is the process of recording and then replay the execution of a process, both forwards and backward, to understand what is happening during the execution. It is vital to fixing bugs when the root cause is not clear, and the symptoms appear moments later when the source of the problem is gone. In a way it’s similar to Intellitrace (available in Visual Studio 2017 Enterprise), but while Intellitrace records specific events and associated data – call stack, function parameters and return value -, TTD embraces a more general approach and let you move at a single instruction level and access any process data (heap, registers, stack).

The same way you can debug a native or managed process, you can also use TTD in both cases, including .NET Core, but it is limited to Windows.
In the following sections, we’ll describe particularities when debugging a managed process.

It also allows you to rewind and play how many times you want, helping you to isolate the problem when it happened, and setting breakpoints just as you usually do in Windbg. Even when you don’t need to rewind, TTD has advantages over Live Debugging, since it doesn’t interrupt the process, you can create a trace and analyze it offline, but be aware that TTD is very intrusive and ideally you shouldn’t use it for more than a few minutes or the traces files can become very large (>5GB).

Demo Lab

The demo application is a simple Windows Forms bugged applications that writes a log file to disk. You can download the code from GitHub and compile it, or download the binaries. The machine where we’ll record the traces must be a Windows 10 version 1809, Windows Server 2019 or newer.

Open the application and click on Save several times and after some seconds it doesn’t work anymore:

Recording a trace

You can use WinDbg Preview to record the trace, but for this Lab, we’ll use the built-in TTTracer.exe available on Windows 10 (1809 or newer) and Windows Server 2019, because sometimes it’s impossible to install tools in a production environment.

1. Open the LabWindbgTTD.exe in the target machine and take a note of its PID:

2. Open a Command Line as admin and enter the following command, replacing <PID> with the PID of the process:

TTTracer -attach <PID>

Now, the TTD is recording the process execution.

3. Go to the LabWindbgTTD application and click on Save several times until you receive the error. After the error appears, in a different Command Prompt (with admin privileges), execute the following command to stop the trace:

TTTracer -stop <PID>

4. You are going to be notified about the trace stop in the first Command Prompt:

5. TTTracer will generate two files: LabWindbgTTD01.out and LabWindbgTTD01.run

Replay and Analyze

Copy both files to your machine, you can use WinDbg or WinDbg Preview to analyze it and don’t forget to set up the symbols to be able to resolve the function names. We’ll use WinDbg Preview, but the steps are similar in WinDbg, click File -> Open Trace File and select the “.run” file:

When debugging a TTD file, you can Step Into (t), Step Out and Step Over (p) like you do when Live Debugging:

You can see the current Time Travel Position when stepping through the application, like in the image above.

Using the !tt <POSITION> command you can navigate to a specific position:

The !positions command show the positions for all threads:

But it gets interesting when using the Step command contrariwise, instead of p, t, and g, you can execute p- (Step Back), t- (Trace Back), and g- (Go Back):

Loading Data Access Component and SOS debugging extension

When debugging .NET applications in a different machine from where the dump or trace was created, you need to copy the Data Access and SOS dlls:

  • For .NET Framework: mscordacwks.dll and SOS.dll in C:\Windows\Microsoft.NET\Framework\v4.0.30319\ (or C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ for 64 bits processes)
  • For .NET Core: mscordaccore.dll and SOS.dll in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\X.X.X\

And execute this command in WinDbg:

.cordll -ve -u -lp <PATH>

.NET Framework

.NET Framework

 

.NET Core

.NET Core

Finding the problem

Now we know how to navigate into the TTD file, how can we find the bug?

Let’s try to stop when the error occurs, to do this you could use “sxe clr;g” like you would do in a Live Debug, but the TTD extends the Session and Process data model objects, exposing events like Exceptions. To see them all, execute “dx @$curprocess.TTD” and “dx @$cursession.TTD“:

dx Command

We can take advantage of this feature and filter the Exception events, “dx -r2 @$curprocess.TTD.Events.Where(t => t.Type == “Exception”).Select(e => e.Exception)“:

dx Exception Command

Click on [Time Travel] to navigate to the moment when the Exception was thrown and execute !pe to see the System.ObjectDisposedException.

pe

You can now execute !clrstack to see exactly which method is throwing the Exception, but it isn’t helpful since the BtnSave_Click just call StreamWriter.WriteAsync and is not disposing the object.

ClrStack

In this case, a log containing the Stack Trace, or a Dump file wouldn’t help. The application is small and simple enough that looking the code you would easily find the problem, but let’s continue the analysis using the WinDbg.

Execute !dso (or !DumpStackObjects) to see the objects in the current stack and click on StreamWriter address.

dso Exception

Click the address to execute !do (or !DumpObj) that shows the details of the object, including its fields, where we can see the stream is null, which means it is disposed.

do streamwriter

We know that at this point the StreamWrite.Dispose method has been called and we need to find out who called it. Set a breakpoint to this method and continue the execution in reverse, “!bpmd mscorlib.dll System.IO.StreamWriter.Dispose;g-“:

bpmd

You’ll stop at Dispose method of StreamWriter. Execute !dso again, we can see a StreamWriter in the same address as before, let’s inspect the object and the underlying stream to find more details about it.

dso

The object address may be different because a Garbage Collection happened or just because we are looking at a different instance of StreamWriter. In this case, you would need to check if the object is the same.

Another option, to see if the object is the same, is to use !GCRoot to find references to the object, this way we can see if in both moments the StreamWriter object is the LogFile field in Form1.

GCRoot

If it is not the object you are looking for, execute g- again until you find it, then execute !clrstack to show the Stack Trace and find the method that is Disposing the StreamWriter:

ClrSTack Dispose

Conclusion

TTD makes it viable to analyze many scenarios that would be extremely difficult to reproduce or to collect the right data. The possibility of going back and forth is powerful and has the potential to greatly reduce troubleshooting time.

Microsoft Docs has many more details about TTTracer and Windbg Preview.


Help us plan the future of .NET and Big Data

$
0
0

We’re currently looking into how we can make .NET great for Big Data scenarios.   

Please fill out the survey below and help shape how we can improve .NET for Big Data by sharing your experiences, challenges, and needs. It should only take 10 minutes or less to complete! 

Take the survey now! 

Thanks, 
.NET Team  

Announcing .NET Framework 4.8 Early Access Build 3734

$
0
0

We are getting closer to the final version now! This release includes several accessibility, performance and reliability fixes across the major framework libraries. We will continue to stabilize this release and take more fixes over the coming weeks and we would greatly appreciate it if you could help us ensure Build 3734 is a high-quality release by trying it out and providing feedback on the new features via the .NET Framework Early Access GitHub repository.

Supported Windows Client versions: Windows 10 version 1809, Windows 10 version 1803, Windows 10 version 1709, Windows 10 version 1703, Windows 10 version 1607, Windows 8.1, Windows 7 SP1

Supported Windows Server versions: Windows Server 2019, Windows Server version 1803, Windows Server version 1709, Windows Server 2016, Windows Server 2012, Windows Server 2012 R2, Windows Server 2008 R2 SP1

This build includes an updated .NET 4.8 runtime as well as the .NET 4.8 Developer Pack (a single package that bundles the .NET Framework 4.8 runtime, the .NET 4.8 Targeting Pack and the .NET Framework 4.8 SDK). Please note: this build is not supported for production use.

Next steps:
To explore the new build, download the .NET 4.8 Developer Pack. Instead, if you want to try just the .NET 4.8 runtime, you can download either of these:

You can checkout the fixes included in this preview build or if you would like to see the complete list of improvements in 4.8 so far, please go here.

.NET Framework build 3734 is also included in the next update for Windows 10. You can sign up for Windows Insiders to validate that your applications work great on the latest .NET Framework included in the latest Windows 10 releases.

Thanks!

Announcing .NET Core 3 Preview 2

$
0
0

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  is also released today. C# 8 Preview 2 is part of .NET Core 3 SDK, and was also released last week with Visual Studio 2019 Preview 2.

Download and get started with .NET Core 3 Preview 2 right now on Windows, macOS and Linux.

In case you missed it, we made some big announcements with Preview 1, including adding support for Windows Forms and WPF with .NET Core, on Windows, and that both UI frameworks will be open source. We also announced that we would support Entity Framework 6 on .NET Core, which will come in a later preview. ASP.NET Core is also adding many features including Razor components.

Please provide feedback on the release in the comments below or at dotnet/core #2263. You can see complete details of the release in the .NET Core 3 Preview 2 release notes.

.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 pre-release channel) was also just updated to support C# 8.

C# 8

C# 8 is a major release of the language, as Mads describes in Do more with patterns in C# 8.0, Take C# 8.0 for a spin and Building C# 8.0. In this post, I’ll cover a few favorites that are new in Preview 2.

Using Declarations

Are you tired of using statements that require indenting your code? No more! You can now write the following code, which attaches a using declaration to the scope of the current statement block and then disposes the object at the end of it.

Switch Expressions

Anyone who uses C# probably loves the idea of a switch statement, but not the syntax. C# 8 introduces switch expressions, which enable the following: terser syntax, returns a value since it is an expression, and fully integrated with pattern matching. The switch keyword is “infix”, meaning the keyword sits between the tested value (here, that’s o) and the list of cases, much like expression lambdas. The following examples use the lambda syntax for methods, which integrates well with switch expressions but isn’t required.

You can see the syntax for switch expressions in the following example:

There are two patterns at play in this example. o first matches with the Point type pattern and then with the property pattern inside the {curly braces}. The _ describes the discard pattern, which is the same as default for switch statements.

You can go one step further, and rely on tuple deconstruction and parameter position, as you can see in the following example:

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.

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.

There will still be cases where switch statements will be a better choice than switch expressions and patterns can be used with both syntax styles.

Async streams

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 C# extension for Visual Studio Code. If you are using .NET Core 3.0 Preview 2 at the commandline, then everything will work as expected.

IEEE Floating-point improvements

Floating point APIs are in the process of being updated to comply with IEEE 754-2008 revision. The goal of this floating point project is to expose all “required” operations and ensure that they are behaviorly compliant with the IEEE spec.

Parsing and formatting fixes:

  • Correctly parse and round inputs of any length.
  • Correctly parse and format negative zero.
  • Correctly parse Infinity and NaN by performing a case-insensitive check and allowing an optional preceding + where applicable.

New Math APIs:

  • BitIncrement/BitDecrement — corresponds to the nextUp and nextDown IEEE operations. They return the smallest floating-point number that compares greater or lesser than the input (respectively). For example, Math.BitIncrement(0.0) would return double.Epsilon.
  • MaxMagnitude/MinMagnitude — corresponds to the maxNumMag and minNumMag IEEE operations, they return the value that is greater or lesser in magnitude of the two inputs (respectively). For example, Math.MaxMagnitude(2.0, -3.0) would return -3.0.
  • ILogB — corresponds to the logB IEEE operation which returns an integral value, it returns the integral base-2 log of the input parameter. This is effectively the same as floor(log2(x)), but done with minimal rounding error.
  • ScaleB — corresponds to the scaleB IEEE operation which takes an integral value, it returns effectively x * pow(2, n), but is done with minimal rounding error.
  • Log2 — corresponds to the log2 IEEE operation, it returns the base-2 logarithm. It minimizes rounding error.
  • FusedMultiplyAdd — corresponds to the fma IEEE operation, it performs a fused multiply add. That is, it does (x * y) + z as a single operation, there-by minimizing the rounding error. An example would be FusedMultiplyAdd(1e308, 2.0, -1e308) which returns 1e308. The regular (1e308 * 2.0) - 1e308 returns double.PositiveInfinity.
  • CopySign — corresponds to the copySign IEEE operation, it returns the value of x, but with the sign of y.

.NET Platform Dependent Intrinsics

We’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.

The following CoreCLR PRs demonstrate a few of the intrinsics, either via implementation or use:

For more information, take a look at .NET Platform Dependent Intrinsics, 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.

Introducing a fast in-box JSON Writer & JSON Document

Following the introduction of the JSON reader in preview1, we’ve added System.Text.Json.Utf8JsonWriter and System.Text.Json.JsonDocument.

As described in our System.Text.Json roadmap, we plan to provide a POCO serializer and deserializer next.

Utf8JsonWriter

The Utf8JsonWriter provides a high-performance, non-cached, forward-only way to write UTF-8 encoded JSON text from common .NET types like String, Int32, and DateTime. 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 Utf8JsonWriter is 30-80% faster than using the writer from Json.NET and does not allocate.

Here is a sample usage of the Utf8JsonWriter that can be used as a starting point:

The Utf8JsonWriter accepts IBufferWriter<byte> 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 System.IO.Pipelines package, you can leverage the Pipe-based implementation of the interface called PipeWriter to skip the need to copy the JSON from an intermediary buffer to the actual output.

You can take inspiration from this sample implementation of IBufferWriter<T>. The following is a skeleton array-backed concrete implementation of the interface:

JsonDocument

In preview2, we’ve also added System.Text.Json.JsonDocument which was built on top of the Utf8JsonReader. The JsonDocument 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 JsonElement type which is exposed by the JsonDocument as a property called RootElement. The JsonElement 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 JsonDocument is 2-3x faster than Json.NET with very little allocations for data that is reasonably sized (i.e. < 1 MB).

Here is a sample usage of the JsonDocument and JsonElement that can be used as a starting point:

GPIO Support for Raspberry Pi

We added initial support for GPIO with Preview 1. As part of Preview 2, we have released two NuGet packages that you can use for GPIO programming.

The GPIO Packages includes APIs for GPIO, SPI, I2C and PWM devices. The IoT bindings package includes device bindings for various chips and sensors, the same ones available at dotnet/iot – src/devices.

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.

Local dotnet tools

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 in the .NET Core 3.0 Preview 1 post.

In this preview, we have added 2 new commands:

  • dotnet new tool-manifest
  • dotnet tool list

To add local tools, you need to add a manifest that will define the tools and versions available. The dotnet new tool-manifest command automates creation of the manifest required by local tools. After this file is created, you can add tools to it via dotnet tool install <packageId>.

The command dotnet tool list lists local tools and their corresponding manifest. The command dotnet tool list -g lists global tools.

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 dotnet tool restore or dotnet tool install, you need to delete your local tools cache folder before local tools will work correctly in Preview 2. This folder is located at:

On mac, Linux: rm -r $HOME/.dotnet/toolResolverCache

On Windows: rmdir /s %USERPROFILE%\.dotnet\toolResolverCache

If you do not delete this folder, you will receive an error.

Assembly Unloadability

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.

We expect this new capability to be used for the following scenarios:

  • Plugin scenarios where dynamic plugin loading and unloading is required.
  • Dynamically compiling, running and then flushing code. Useful for web sites, scripting engines, etc.
  • Loading assemblies for introspection (like ReflectionOnlyLoad), although MetadataLoadContext (released in Preview 1) will be a better choice in many cases.

More information:

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.

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.

Windows Native Interop

Windows offers a rich native API, in the form of flat C APIs, COM and WinRT. We’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.

Late last year, we announced that we had managed to automate Excel from .NET Core. That was a fun moment. You can now try this same demo yourself with the Excel demo sample. Under the covers, this demo is using COM interop features like NOPIA, object equivalence and custom marshallers.

Managed C++ and WinRT interop are coming in a later preview. We prioritized getting COM interop built first.

WPF and Windows Forms

The WPF and Windows Forms teams opened up their repositories, dotnet/wpf and dotnet/winforms, respectively, on December 4th, the same day .NET Core 3.0 Preview 1 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’ve been integrating WPF and Windows Forms into the .NET Core build system, including adopting the Arcade 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.

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.

Visual Studio support

Desktop development on .NET Core 3 requires Visual Studio 2019. 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.

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.

MSIX Deployment for Desktop apps

MSIX is a new Windows app package format. It can be used to deploy .NET Core 3 desktop applications to Windows 10.

The Windows Application Packaging Project, available in Visual Studio 2019 preview 2, allows you to create MSIX packages with self-contained .NET Core applications.

Note: The .NET Core project file must specify the supported runtimes in the <RuntimeIdentifiers> property:

<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>

Install .NET Core 3.0 Previews on Linux with Snap

Snap is the preferred way to install and try .NET Core previews on Linux distributions that support Snap. At present, only X64 builds are supported with Snap. We’ll look at supporting ARM builds, too.

After configuring Snap on your system, run the following command to install the .NET Core SDK 3.0 Preview SDK.

sudo snap install dotnet-sdk --beta --classic

When .NET Core in installed using the Snap package, the default .NET Core command is dotnet-sdk.dotnet, as opposed to just dotnet. 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 dotnet with:

sudo snap alias dotnet-sdk.dotnet dotnet

Some distros require an additional step to enable access to the SSL certificate. See our Linux Setup for details.

Platform Support

.NET Core 3 will be supported on the following operating systems:

  • Windows Client: 7, 8.1, 10 (1607+)
  • Windows Server: 2012 R2 SP1+
  • macOS: 10.12+
  • RHEL: 6+
  • Fedora: 26+
  • Ubuntu: 16.04+
  • Debian: 9+
  • SLES: 12+
  • openSUSE: 42.3+
  • Alpine: 3.8+

Chip support follows:

  • x64 on Windows, macOS, and Linux
  • x86 on Windows
  • ARM32 on Windows and Linux
  • ARM64 on Linux

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.

Docker images for .NET Core 3.0 are available at microsoft/dotnet on Docker Hub. We are in the process of adopting Microsoft Container Registry (MCR). We expect that the final .NET Core 3.0 images will only be published to MCR.

Closing

Take a look at the .NET Core 3.0 Preview 1 post 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.

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.

Submit to the Applied F# Challenge!

$
0
0

This post was written by Lena Hall, a Senior Cloud Developer Advocate at Microsoft.

F# Software Foundation has recently announced their new initiative — Applied F# Challenge! We encourage you to participate and send your submissions about F# on Azure through the participation form.

Applied F# Challenge is a new initiative to encourage in-depth educational submissions to reveal more of the interesting, unique, and advanced applications of F#.

The motivation for the challenge is uncovering more of advanced and innovative scenarios and applications of F# we hear about less often:

We primarily hear about people using F# for web development, analytical programming, and scripting. While those are perfect use cases for F#, there are many more brilliant and less covered scenarios where F# has demonstrated its strength. For example, F# is used in quantum computing, cancer research, bioinformatics, IoT, and other domains that are not typically mentioned as often.

You have some time to think about the topic for your submission because the challenge is open from February 1 to May 20 this year.

What should you submit?

Publish a new article or an example code project that covers a use case of a scenario where you feel the use of F# to be essential or unique. The full eligibility criteria and frequently asked questions are listed in the official announcement.

There are multiple challenge categories you can choose to write about:

F# for machine learning and data science.
F# for distributed systems.
F# in the cloud: web, serverless, containers, etc.
F# for desktop and mobile development.
F# in your organization or domain: healthcare, finance, games, retail, etc.
F# and open-source development.
F# for IoT or hardware programming.
F# in research: quantum, bioinformatics, security, etc.
Out of the box F# topics, scenarios, applications, or examples.

Why should you participate in the challenge?

All submissions will receive F# stickers as a participation reward for contributing to the efforts of improving the F# ecosystem and raising awareness of F# strengths in advanced or uncovered use cases.

Participants with winning submissions in each category will also receive the title of a Recognized F# Expert by F# Software Foundation and a special non-monetary prize.

Each challenge category will be judged by the committees that include many notable F# experts and community leaders, including Don Syme, Rachel Blasucci, Evelina Gabasova, Henrik Feldt, Tomas Perticek, and many more.

As the participation form suggests, you will also have an opportunity to be included in a recommended speaker list by F# Software Foundation.

Spread the word

Help us spread the word about the Applied F# Challenge by encouraging others to participate with #AppliedFSharpChallenge hashtag on Twitter!

Announcing ML.NET 0.10 – Machine Learning for .NET

$
0
0

alt text

ML.NET is an open-source and cross-platform machine learning framework (Windows, Linux, macOS) for .NET developers. Using ML.NET, developers can leverage their existing tools and skillsets to develop and infuse custom AI into their applications by creating custom machine learning models.

ML.NET allows you to create and use machine learning models targeting common tasks such as classification, regression, clustering, ranking, recommendations and anomaly detection. It also supports the broader open source ecosystem by proving integration with popular deep-learning frameworks like TensorFlow and interoperability through ONNX. Some common use cases of ML.NET are scenarios like Sentiment Analysis, Recommendations, Image Classification, Sales Forecast, etc. Please see our samples for more scenarios.

Today we’re announcing the release of ML.NET 0.10. ( ML.NET 0.1 was released at //Build 2018). Note that ML.NET follows a semantic versioning pattern, so this preview version is 0.10. There will be additional versions such as 0.11 and 0.12 before we release v1.0.

This release focuses on the overall stability of the framework, continuing to refine the API, increase test coverage and as an strategic milestone, we have moved the IDataView components into a new and separated assembly under Microsoft.Data.DataView namespace so it will favor interoperability in the future.

The main highlights for this blog post are described below in further details:

IDataView as a shared type across libraries in the .NET ecosystem

The IDataView component provides a very efficient, compositional processing of tabular data (columns and rows) especialy made for machine learning and advanced analytics applications. It is designed to efficiently handle high dimensional data and large data sets. It is also suitable for single node processing of data partitions belonging to larger distributed data sets.

For further info on IDataview read the IDataView design principles

What’s new in v0.10 for IDataView

In ML.NET 0.10 we have segregated the IDataView component into a single assembly and NuGet package. This is a very important step towards the interoperability with other APIs and frameworks.

Why segregate IDataView from the rest of the ML.NET framework?

This is a very important milestone that will help the ecosystem’s interoperability between multiple frameworks and libraries from Microsoft of third parties. By seggregating IDataView, different libraries will be able to reference it and use it from their API and allow users to pass large volumes of data between two independent libraries.

For example, from ML.NET you can of course consume and produce IDataView instances. But what if you need to integrate with a different framework by creating an IDataView from another API such as any “Data Preparation framework” library? If those frameworks can simply reference a single NuGet package with just the IDataView, then you can directly pass data into ML.NET from those frameworks without having to copy the data into a format that ML.NET consumes. Also, the additional framework wouldn’t depend on the whole ML.NET framework but just reference a very clean package limited to the IDataView.

The image below is an aspirational approach when using IDataView across frameworks in the ecosystem:

alt text

Another good example would be any plotting/charting library in the .NET ecosystem that could consume data using IDataView. You could take data that was produced by ML.NET and feed it directly into the plotting library without that library having a direct reference to the whole ML.NET framework. There would be no need to copy, or change the shape of the data at all. And there is no need for this plotting library to know anything about ML.NET.

Basically, IDataView can be an exchange data format which allows producers and consumers to pass large amounts of data in a standarized way.

For additional info check the PR #2220

Support for multiple ‘feature columns’ in recommendations (FFM based)

In previous ML.NET releases, when using the Field-aware Factorization Machine (FFM) trainer (training algorithm) you could only provide a single feature column like in this sample app

In 0.10 release we’ve added support for multiple ‘feature columns’ in your training dataset when using an FFM trainer by allowing to specify those additional column names in the trainer’s ‘Options’ parameter as shown in the following code snippet:

var ffmArgs = new FieldAwareFactorizationMachineTrainer.Options();

// Create the multiple field names.
ffmArgs.FeatureColumn = nameof(MyObservationClass.MyField1); // First field.
ffmArgs.ExtraFeatureColumns = new[]{ nameof(MyObservationClass.MyField2), nameof(MyObservationClass.MyField3) }; // Additional fields.

var pipeline = mlContext.BinaryClassification.Trainers.FieldAwareFactorizationMachine(ffmArgs);

var model = pipeline.Fit(dataView);

You can see additional code example details in this code

Additional updates in v0.10 timeframe

Support for returning multiple predicted labels

Until ML.NET v0.9, when predicting (for instance with a multi-class classification model), you could only predict and return a single label. That’s an issue for many business scenarios. For instance, in an eCommerce scenario, you could want to automatically classify a product and assign it to multiple product categories instead of just a single category.

However, when predicting, ML.NET internally already had a list of the multiple possible predictions with a score/proability per each in the schema’s data, but the API was simply not returning the list of possible predicted labels but a single one.

Therefore, this improvement allows you to access the schema’s data so you can get a list of the predicted labels which can then be related to their scores/proabilities provided by the float[] Score array in your Prediction class, such as in this sample prediction class.

For additional info check this code example

Minor updates in 0.10

  • Introducing Microsoft.ML.Recommender NuGet name instead of Microsoft.ML.MatrixFactorization name: Microsoft.ML.Recommender] is a better naming for NuGet packages based on the scenario (Recommendations) instead of the trainer’s name (Microsoft.ML.MatrixFactorization).

  • Added support in TensorFlow for using using text and sparse input in TensorFlow: Specifically, this adds support for loading a map from a file through dataview by using ValueMapperTransformer. This provides support for additional scenarios like a Text/NLP scenario) in TensorFlowTransform where model’s expected input is vector of integers.

  • Added Tensorflow unfrozen models support in GetModelSchema: For a code example loading an unfrozen TensorFlow check it out here.

Breaking changes in ML.NET 0.10

For your convenience, if you are moving your code from ML.NET v0.9 to v0.10, you can check out the breaking changes list that impacted our samples.

Instrumented code coverage tools as part of the ML.NET CI systems

We have also instrumented code coverage tools (using https://codecov.io/) as part of our CI systems and will continue to push for stability and quality in the code.

You can check it out here which is also a link in the home page of the ML.NET repo:

alt text

Once you click on that link, you’ll see the current code coverage for ML.NET:

alt text

Explore the community samples and share yours!!

As part of the ML.NET Samples repo we also have a special Community Samples page pointing to multiple samples provided by the community. These samples are not maintained by Microsoft but are very interesting and cover additional scenarios not covered by us.

Here’s an screenshot of the current community samples:

alt text

There are pretty cool samples like the following:

‘Photo-Search’ WPF app running a TensorFlow model exported to ONNX format

alt text

UWP app using ML.NET

alt text

Other very interesting samples are:

Share your sample with the ML.NET community!

alt text

We encourage you to share your ML.NET demos and samples with the community by simply submitting its brief description and URL pointing to your GitHub repo or blog posts, into this repo issue “Request for your samples!”.

We’ll do the rest and publish it at the ML.NET Community Samples page!

Planning to go to production?

alt text

If you are using ML.NET in your app and looking to go into production, you can talk to an engineer on the ML.NET team to:

  1. Get help implementing ML.NET successfully in your application.
  2. Demo your app and potentially have it featured on the .NET Blog, dot.net site, or other Microsoft channel.

Fill out this form and someone from the ML.NET team will contact you.

Get started!

alt text

If you haven’t already get started with ML.NET here.

Next, going further explore some other resources:

We will appreciate your feedback by filing issues with any suggestions or enhancements in the ML.NET GitHub repo to help us shape ML.NET and make .NET a great platform of choice for Machine Learning.

Thanks and happy coding with ML.NET!

The ML.NET Team.

This blog was authored by Cesar de la Torre and Eric Erhardt plus additional contributions of the ML.NET team

Viewing all 4000 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>