Experience. Net Core for Linux

Source: Internet
Author: User
Tags dotnet stack trace

At the Build 2015 conference a few days ago, Microsoft launched the Code Editor for Windows, Mac OS X, and Linux platforms, and also released the. Net core preview for Linux and Mac OS X. So many years have passed. NET finally officially support cross-platform, or a little excited. Get an Ubuntu experience on Hyper-V.

Visual Studio code can be downloaded in https://code.visualstudio.com/, the installation steps can refer to here Https://code.visualstudio.com/Docs/setup#_linux

In fact, the installation is very simple, download and then drag directly to Ubuntu decompression, double-click on the code can be. Looking at the blue vs icon is not a bit cordial. However, the functionality is simply a simple code editor compared to Visual Studio. :D

The following is mainly about CORECLR installation and test code execution.

The installation steps refer to the official https://github.com/dotnet/coreclr/blob/master/Documentation/get-dotnetcore-dnx-linux.md

Everything went well, but at the end of the day, there was an error in executing the test code in the article.

System.IO.FileLoadException: Resource string id=0x1A88File name: ‘net-core-test, Culture=neutral, PublicKeyToken=null‘ ---> System.TypeInitializationException: The type initializer for ‘Roslyn.Utilities.SHA1CryptoServiceProvider‘ threw an exception. ---> System.TypeInitializationException: The type initializer for ‘Roslyn.Utilities.HashAlgorithm‘ threw an exception. ---> System.InvalidOperationException: Sequence contains no elements   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)   at Roslyn.Utilities.HashAlgorithm..cctor()   --- End of inner exception stack trace ---   at Roslyn.Utilities.HashAlgorithm.LoadAlgorithmCreate(String name)   at Roslyn.Utilities.SHA1CryptoServiceProvider..cctor()   --- End of inner exception stack trace ---.....

Think about it, the only thing that's different from the article is the CORECLR version number.

In the article:

Active Version              Runtime Arch Location             Alias------ -------              ------- ---- --------             -----  *    1.0.0-beta5-11649    coreclr x64  ~/.dnx/runtimes             1.0.0-beta5-11649    mono         ~/.dnx/runtimes      default

of my own machine:

I think it was CoreCLR and released a new version, so I didn't care. But the problem is about it. After a search, other people also encountered the same problem. For details, refer to https://github.com/dotnet/coreclr/issues/898
This exception is a 11682 version of a bug, sure enough is a very rough preview of Ah, not reliable is very-_-!

The solution is to use an older version of CORECLR. The commands I use are as follows:

DNVM Install 1.0.0-beta5-11657-r coreclr-u
DNVM Use 1.0.0-beta5-11657-r coreclr
Dnx. Run

The expected Hello Linux has finally appeared:

Experience. Net Core for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.