The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,444 other followers

Archive for the ‘.NET’ Category

Take C# 8.0 for a spin | .NET Blog

Posted by jpluimers on 2018/12/06

[WayBack] Take C# 8.0 for a spin | .NET Blog: A first-hand look from the .NET engineering teams

Either:

download and install Preview 1 of .NET Core 3.0 and Preview 1 of Visual Studio 2019.

or with Visual Studio Code

[WayBack] Bill Wagner on Twitter: “@cecilphillip @MadsTorgersen @VisualStudio @code Yes, install .NET Core 3 preview, add the 8.0 element and it works fine.”

Then play around with:

  • Nullable reference types
  • Ranges and indices
  • Asynchronous streams

Via: [WayBack] Mads Torgersen on Twitter: “I blogged a little walkthrough of the three major C# 8.0 features (nullable reference types, range and index expressions and async streams) shipping in Preview 1 of @VisualStudio 2019 and Preview 1 of .NET Core 3.0. Hope you like it!https://t.co/4uM7JlSRwE”

–jeroen

Read the rest of this entry »

Posted in C#, C# 8, Development, Software Development | Leave a Comment »

UTF-8 support for single byte character sets is beta in Windows and likely breaks a lot of applications not expecting this (via Unicode in Microsoft Windows: UTF-8 – Wikipedia)

Posted by jpluimers on 2018/12/04

Uh-oh: [WayBack] Unicode in Microsoft Windows: UTF-8 – Wikipedia:

Microsoft Windows has a code page designated for UTF-8code page 65001. Prior to Windows 10 insider build 17035 (November 2017),[7] it was impossible to set the locale code page to 65001, leaving this code page only available for:

  • Explicit conversion functions such as MultiByteToWideChar
  • The Win32 console command chcp 65001 to translate stdin/out between UTF-8 and UTF-16.

This means that “narrow” functions, in particular fopen, cannot be called with UTF-8 strings, and in fact there is no way to open all possible files using fopen no matter what the locale is set to and/or what bytes are put in the string, as none of the available locales can produce all possible UTF-16 characters.

On all modern non-Windows platforms, the string passed to fopen is effectively UTF-8. This produces an incompatibility between other platforms and Windows. The normal work-around is to add Windows-specific code to convert UTF-8 to UTF-16 using MultiByteToWideChar and call the “wide” function.[8] Conversion is also needed even for Windows-specific api such as SetWindowText since many applications inherently have to use UTF-8 due to its use in file formats, internet protocols, and its ability to interoperate with raw arrays of bytes.

There were proposals to add new API to portable libraries such as Boost to do the necessary conversion, by adding new functions for opening and renaming files. These functions would pass filenames through unchanged on Unix, but translate them to UTF-16 on Windows.[9] This would allow code to be “portable”, but required just as many code changes as calling the wide functions.

With insider build 17035 and the April 2018 update (nominal build 17134) for Windows 10, a “Beta: Use Unicode UTF-8 for worldwide language support” checkbox appeared for setting the locale code page to UTF-8.[a] This allows for calling “narrow” functions, including fopen and SetWindowTextA, with UTF-8 strings. Microsoft claims this option might break some functions (a possible example is _mbsrev[10]) as they were written to assume multibyte encodings used no more than 2 bytes per character, thus until now code pages with more bytes such as GB 18030 (cp54936) and UTF-8 could not be set as the locale.[11]


  1. Jump up^ [WayBack“UTF-8 in Windows”Stack Overflow. Retrieved July 1, 2011.
  2. Jump up^ [WayBack“Boost.Nowide”.
  3. Jump up^ [WayBackhttps://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strrev-wcsrev-mbsrev-mbsrev-l
  4. Jump up^ [WayBack“Code Page Identifiers (Windows)”msdn.microsoft.com.

Via [WayBack] Microsoft Windows Beta UTF-8 support for Ansi API could break things. Wiki Article of the Change… – Tommi Prami – Google+

Related, as handling encoding is hard, especially if it is changed or not your default:

–jeroen

Posted in .NET, C, C++, Delphi, Development, Power User, Software Development, Windows, Windows 10 | 2 Comments »

An In Depth Guide Into a Ridiculously Simple API Using .NET Core

Posted by jpluimers on 2018/11/27

Since I am going to be involved with building some REST API servers and clients in .NET, here are some links to get me up to speed.

Posted in .NET, .NET ORM, ASP.NET, C#, Development, EF Entity Framework, NHibernate, Software Development | Leave a Comment »

Build Lambda Expressions Dynamically – CodeProject

Posted by jpluimers on 2018/11/08

On my research list: [WayBackBuild Lambda Expressions Dynamically – CodeProject

GitHub Source: dbelmont/ExpressionBuilder

–jeroen

Posted in .NET, Development, Software Development | Leave a Comment »

Creating a full off-line installation directory for Visual Studio 2017 Community

Posted by jpluimers on 2018/11/01

Steps:

  1. mkdir C:\Installs\VS2017Community\VS2017CommunityLayout
  2. pushd C:\Installs\VS2017Community
  3. bitsadmin.exe /transfer "VS2017CommunityBootstrap" https://aka.ms/vs/15/release/vs_community.exe C:\Installs\VS2017Community\vs_community.exe
  4. vs_community.exe --lang en-US --layout C:\Installs\VS2017Community\VS2017CommunityLayout
  5. VS2017CommunityLayout\vs_community.exe

Step 3 needs a full path to the destination file.

Step 4 can take a relative path.

Step 4 takes considerable time (for 15.2 about 90 minutes on a 100 Mibit/s fiber connection with an ~8 millisecond ping time to download.visualstudio.microsoft.com; for 15.8 with 80 Mibit/s and a ~4 millisecond ping about 120 minutes) resulting in ~40 gigabyte download.

After download, run the vs_setup.exe in theVS2017CommunityLayout directory.

Note that upgrading to a newer version of Visual Studio 2017 will require downloads! See [WayBack] Offline Install Modify always goes to the WEB – Developer Community.

Note that after installation, Visual Studio 2017 needs considerable disk space as found via visual studio 2017 disk size – Google Search:

[WayBack] Visual Studio 2017 System Requirements | Microsoft Docs:

Find the minimum system requirements, supported hardware, and languages for the Visual Studio 2017 product family.

Hardware
  • 1.8 GHz or faster processor. Dual-core or better recommended
  • 2 GB of RAM; 4 GB of RAM recommended (2.5 GB minimum if running on a virtual machine)
  • Hard disk space: up to 130 GB of available space, depending on features installed; typical installations require 20-50 GB of free space.
  • Hard disk speed: to improve performance, install Windows and Visual Studio on a solid state drive (SSD).
  • Video card that supports a minimum display resolution of 720p (1280 by 720); Visual Studio will work best at a resolution of WXGA (1366 by 768) or higher.

For instance, the choices below require about 22 gigabyte of space, while adding mobile .NET development adds another 13 gigabyte.

Via:

–jeroen

Posted in .NET, Development, Software Development, Visual Studio 2017, Visual Studio and tools | Leave a Comment »

 
%d bloggers like this: