All posts by Ken Lin

Update on C# and VB in VS2017

The latest version on Visual Studio 2017 at this moment is still in Release Candidate (RC) stage on build 26127.03, released on 1st Feb 2017. There are many new features in this VS2017 which it is too long to write all of them down here. You may visit the release notes for more detail.

Here I want to highlight the new support for C# & VB, and also 2 new members in VS2017, Visual Studio for Mac and Visual Studio Mobile Center.

Visual Studio for the Mac

is built from the ground up for the Mac and focused on full-stack, client-to-cloud native mobile development, using Xamarin for Visual Studio, ASP.NET Core, and Azure. To learn more, please read Miguel de Icaza’s blog post introducing Visual Studio for Mac.

 

Visual Studio Mobile Center

is “mission control for mobile apps.” It brings together multiple services commonly used by mobile developers into a single, integrated service that allows you to build, test, deploy, and monitor cloud attached apps in one place. To learn more, please read Nat Friedman’s post elaborating on Visual Studio Mobile Center.

 

OK, let’s talk about the new feature support for C# & VB in VS2017.

IDE Experience and Productivity

Visual Studio provides new refactorings to allow you to organize source code with one action:

  • New in RC Simplify object initialization with an initializer:
  • New in RC Move out variable declarations inline, leveraging a new C#7 feature:
  • New in RC Simplify null checks and throw expressions using null-coalescing operator, leveraging a new C#7 feature:
  • Move type to matching file: Extract a type from one file and put it in another file with a matching name with one click via Ctrl+..
  • Sync file and type name: If your file and type name are out of sync, you can use Ctrl+..
  • Convert String.Format to string interpolation: take advantage of the C# 6 language feature with this Quick Action.

This release also introduces improvements to IntelliSense that will make you more productive when working in a large solution or an unfamiliar codebase. We have added an icon tray to IntelliSense that enables you to filter the member list by type (e.g., methods, properties, classes, etc.). Each filter toggle has an associated keyboard shortcut which you can discover by hovering over the icon. To enable this feature, go to Tools > Options > Text Editor > [C# | Visual Basic] > IntelliSense and check the options for filtering and highlighting.

We’ve also added/updated style analyzers to help you customize and enforce coding conventions on your team, including:

  • Naming style rules.
  • Use of “var” or explicit types.
  • Use of “this.” or “Me.” on member access.
  • Missing braces.
  • Missing switch case.

New in RC Building on Visual Studio’s support for EditorConfig, we worked with the community to add .NET code style settings to the file format. This means that you can configure your team’s code style conventions, check them into source control, and have violations appear live in the editor as developers are typing. You can see all the code style options in the Roslyn repo’s .editorconfig or in the documentation.

Other new features in this release include:

  • You can now split a long string into multiple concatenated strings by positioning the cursor mid-string and pressing Enter.
  • A new code action for converting a property to a method.
  • We now use fuzzy matching in the NavigateTo search results.

Look for the following improvements to the IDE experience that are also in Visual Studio 2015 Updates:

  • A new quick fix option to add a reference to a NuGet package.
  • Refactorings that simplify delegate invocations and raising events using the null condition operator.
  • Refactorings to make async methods synchronous where applicable.
  • Improvements to Add Using command to support “fuzzy” matching for misspelled types, including adding any needed project or metadata references.

Language Extensions and Analyzers

This release includes some proposed new language extensions that we are working on for the next versions of C# and Visual Basic. These new language features are enabled by default and include:

For C#:

  • Task-like return types for async methods: This introduces the ability to return any task-like type from an async method. Previously these return types were constrained to Task<T> and Task.
  • Value tuples introduce language support for using tuples to temporarily group a set of typed values. To learn more, please review the design notes on GitHub.
  • Nested local functions extend the language to support declaration of functions in a block scope.
  • Pattern matching extensions enable many of the benefits of algebraic data types and pattern matching from functional languages.
  • Ref returns enable functions to return values by reference.

For Visual Basic:

  • Value tuples introduce language support for using tuples to temporarily group a set of typed values: Dim point As (x As Integer, y As Integer) = GetOffset().
  • ByRef return consumption extend the language to support consumption of functions and properties from libraries which have ByRef returns.
  • Binary literals and digit group separators allow native representation of binary numbers. This is super convenient for bitmasks and flags enumerations: &B1001_0011.

For more information, follow our development on GitHub to learn more about these and other proposed language extensions and APIs.

Finally, we have done considerable work to improve responsiveness of the IDE in presence of background operations that compute diagnostics and CodeLens information.

New Evolution of the Microsoft MVP Award

On 1st Feb 2017, Steve Guggs, Corp Vice President of Microsoft’s Developer & Platform Evangelism (DPE) group, announced that a new evolution of the Microsoft MVP Award. You can read more here.

For public, there is a good news. In the past, you could be nominated yourself or someone that you believe deserves this recognition in quarterly, Jan, Apr, July, and Oct. But now, you could be nominated monthly. Yes, Monthly. If you believes that you should be recognized, please contact me and I could give you a hand by helping you review on what you have done in the past year.

You could watch a video about this,

 

MVP Reconnect Program for all former MVP!!!

This morning, I was told by my MVP Lead that there is a new program for all former MVP. You are correct, all former MVP, that means all former MVPs that ended their award tenure in “good standing” and with a minimum award period of 1 year are eligible to join this MVP Reconnect program.

 

It is a very good news to have such program to “REconnect” all the MVPs together again with the product group. Want to know more? read the following blog/post.

https://blogs.msdn.microsoft.com/stevengu/2016/11/03/announcing-the-mvp-reconnect-program-the-2016-mvp-global-summit/

https://mvp.microsoft.com/en-us/Pages/reconnect-whatis

mvp_reconnect

https://medium.com/@callkathy/mvp-reconnect-launches-496210632d05#.6fcojvprv

 

At the same time, if you wanna know about how to become an MVP, you could also visit this,

https://mvp.microsoft.com/en-US/pages/what-it-takes-to-be-an-mvp

At the same time, Microsoft will send the member of MVP Reconnect program with a special metal to you. Here is the Youtube link,

mvp_reconnect_kit_02
mvp_reconnect_kit

AdminPack / RSAT in Windows 10 for Windows Server 2016

I have blogged about AdminPack/RAST in the past,
1) Where is AdminPak in Windows 2008 and R2 ?
2) AdminPak / RSAT for Windows Server 2012 and R2

I just found out that one of the RAST package is no longer available, it is the RAST in Win8.1. If you are looking for the RSAT for win2012R2, you might need to get the RSAT package for Win10. And here is the link,

RSAT for Win10

IMPORTANT: Remove all older versions of Administration Tools Pack or Remote Server Administration Tools—including older prerelease versions, and releases of the tools for different languages or locales—from the computer before you install Remote Server Administration Tools for Windows 10. Only one copy at a time of Remote Server Administration Tools can be installed on a computer. If you have upgraded to Windows 10 from an older release of Windows, you will need to install Remote Server Administration Tools for Windows 10 on the computer; no earlier releases of Remote Server Administration Tools are still installed on a computer that you have upgraded to Windows 10.

Remote Server Administration Tools for Windows 10 includes support for remote management of computers that are running the Server Core installation option or the Minimal Server Graphical Interface configuration of Windows Server Technical Preview. However, Remote Server Administration Tools for Windows 10 cannot be installed on any releases or installation options of the Windows Server operating system.

Earlier releases of Remote Server Administration Tools (such as those for Windows 8.1) are not available–nor do they run–on Windows 10.

Server Manager is included with Remote Server Administration Tools for Windows 10; GUI-based tools that are part of this release of Remote Server Administration Tools can be opened by using commands on the Tools menu of the Server Manager console. To use Server Manager to access and manage remote servers that are running Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, or Windows Server 2016, you must install several updates on the older operating systems.

*P.S., RSAT (Remote Server Administration Tools) is the replacement toolkit to the AdminPak before Windows Server 2008

Bootstrap 3 Datepicker (eonasdan) does not work with jQuery 3.0 or above

if you are developing MVC, and you might have chance to look for a DateTimePicker for your MVC project. One of the favorites DateTimePicker is “Bootstrap 3 DatePicker” developed by Eonasdan (http://eonasdan.github.io/bootstrap-datetimepicker/ ). You may download and get it from Nuget. You may also install by using Bower, Rails, Angular, Meteor or manually. The latest version in Nuget is v4.15.35.1.

nuget_bootstrapdatepicker

One of the dependency is the jQuery. I have installed the latest one jQuery v3.1.1 at the moment I am writing to this blog.

I have followed the sample code Eonasdan has provided but I could not make it working. After some searching, I found out that Eonasdan has developed it when jQuery was still in v2. And jQuery has some changes from v2 to v3. One of the changes is jQuery does not provide the object.count() for jQuery object. It is changed into object.length

So, now you could make some code changes to the bootstrap-datetimepicker.js and the DatePicker will be working again. There are 2 locations of code that you have to change. Just simply search for “count()” and replace it as “length”.

Hope that my blog will help you to fix it. And as I know, someone has also point this out to the GitHub and commit into a new branch. But Eonasdan has not yet merge it into the release branch. Let’s do this fix in our way before he release the fixed code so that we could get a corrected js from Nuget.

bootstrapdatepicker_js_before
bootstrapdatepicker_js_after