Category Archives: Visual Basic

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.

Useful links to learn Windows 10 and VS2015

images images
I am sure that you all are new to Win10 and VS2015. You may be looking for learning resource. Here I listed some of the sample site for you and so you could get some learning on these 2 new products.

Opportunity URLs Remarks
Developer Tools Download https://www.visualstudio.com/ Download any Visual Studio skus, including VS 2015
Developer for Windows 10  -What’s New
Get Started
Design
Develop
Publish
https://dev.windows.com/en-us/getstarted/whats-new-windows-10/
https://dev.windows.com/en-us/getstarted/
https://dev.windows.com/en-us/design/
https://dev.windows.com/en-us/develop/
https://dev.windows.com/en-us/publish/
All the info developers may need to write apps
Windows 10 courses in MVA https://www.microsoftvirtualacademy.com/en-US/training-courses/getting-started-with-windows-10-for-it-professionals-10629/ Great site to get online courses on Windows 10
Channel https://channel9.msdn.com/windows/ Another great online resource for Windows 10 related videos
Windows 10 Jumpstart http://www.microsoftvirtualacademy.com/liveevents/preparing-your-enterprise-for-windows-10-as-a-service/ A live event on August 14th

Visual Studio 2015 is released

VS2015.is.born
VS2015.is.born

As many of you might know that VS2015 is already released on 20th July 2015. If you are MSDN Subscriptor, you could download and install it now. For the Team Foundation Server 2015, you might have to wait for a little bit longer.

Watch the keynote on demand below to learn about the latest features and technologies. You can also watch the Visual Studio developer team create an end-to-end solution for an open-source project and see how they tackled problems along the way.

For more Visual Studio 2015 deep dive videos, please visit https://channel9.msdn.com/Series/ConnectOn-Demand

To download Visual Studio 2015, please visit https://www.visualstudio.com/downloads/download-visual-studio-vs

For more information about Visual Studio 2015, please visit https://www.visualstudio.com/vs-2015-product-editions

Free online training access on WintellectNow for 21 days

Wintellectnow

WintellectNOW is an on demand training solution that delivers real-world ready-to-use knowledge, tools and techniques so individuals and businesses can expertly develop software, programs, apps and more.

We got a promote code to give away and it allows you to take any online training for 21 days of free access.

The promo code to share is: HKNUGMSTC315

To use the Promo Code follow these instructions:

  1. Go to www.wintellectNOW.com
  2. Click on the Sign up Now button.
  3. Select “Use Promo Code”
  4. Enter HKNUGMSTC315 in the Promo code box.
  5. Fill out the rest of the form.

Enable ASP.NET AJAX v1.0 to your existing ASP.NET 2.0 Web Site or Web Application.

Few days ago, I shared about how to upgrade your ASP.NET 1.1 to ASP.NET 2.0, this time I am going to discuss about enabling ASP.NET AJAX v1.0 to your existing Web Site or Web Application.



1) You have to downlaod and install the ASP.NET 2.0 AJAX Extensions 1.0. Here
2) You may download and extract the ASP.NET AJAX Control Toolkit. Here


After install it, you will found out that you may create AJAX Enabled Web Application when creating new projects(Web Site or Web Application). You may also found out that there is a new tab called “AJAX Extensions” in Toolbox. If you have extracted the ASP.NET AJAX Control Toolkit, you may do the following,



1) Create new tab called “AJAX Control Toolkit”;
2) Right click under the created tab and click on “Choose Items…”;
3) Click “Browse…” and browse to the folder which you extract the ASP.NET AJAX Control Toolkit, and then browse to “~\SampleWebSite\Bin\” and select AjaxControlToolokit.dll
4) Now you will see a lot of controls which you are ready to use. You may browse and view the “Toolkit Live” to get the sample and idea on the controls.


You are now ready to build your AJAX web site or web application. However, if you have any existing ASP.NET 2.0 Web Site or Web Application, you do the normal action to write AJAX, you will found out that the AJAX is not working in your existing Web Site or Web Application. You have to do the following in order to let your existing ASP.NET 2.0 Web Site or Web Application to be “AJAX Enabled”,



1) Open web.config from your existing web site or web application
2) Add the following XML under <configuration> tab.



<configSections>
    <sectionGroup name=”system.web.extensions” type=”System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
      <sectionGroup name=”scripting” type=”System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
          <section name=”scriptResourceHandler” type=”System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication”/>
        <sectionGroup name=”webServices” type=”System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″>
          <section name=”jsonSerialization” type=”System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”Everywhere” />
          <section name=”profileService” type=”System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication” />
          <section name=”authenticationService” type=”System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”false” allowDefinition=”MachineToApplication” />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>


  <system.web>
    <pages>
      <controls>
        <add tagPrefix=”asp” namespace=”System.Web.UI” assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      </controls>
    </pages>
    <!–
          Set compilation debug=”true” to insert debugging
          symbols into the compiled page. Because this
          affects performance, set this value to true only
          during development.
    –>
    <compilation debug=”false”>
      <assemblies>
        <add assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      </assemblies>
    </compilation>


    <httpHandlers>
      <remove verb=”*” path=”*.asmx”/>
      <add verb=”*” path=”*.asmx” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add verb=”*” path=”*_AppService.axd” validate=”false” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ validate=”false”/>
    </httpHandlers>


    <httpModules>
      <add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
    </httpModules>
  </system.web>


  <system.web.extensions>
    <scripting>
      <webServices>
      <!– Uncomment this line to customize maxJsonLength and add a custom converter –>
      <!–
      <jsonSerialization maxJsonLength=”500″>
        <converters>
          <add name=”ConvertMe” type=”Acme.SubAcme.ConvertMeTypeConverter”/>
        </converters>
      </jsonSerialization>
      –>
      <!– Uncomment this line to enable the authentication service. Include requireSSL=”true” if appropriate. –>
      <!–
        <authenticationService enabled=”true” requireSSL = “true|false”/>
      –>


      <!– Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. –>
      <!–
      <profileService enabled=”true”
                      readAccessProperties=”propertyname1,propertyname2″
                      writeAccessProperties=”propertyname1,propertyname2″ />
      –>
      </webServices>
      <!–
      <scriptResourceHandler enableCompression=”true” enableCaching=”true” />
      –>
    </scripting>
  </system.web.extensions>


  <system.webServer>
    <validation validateIntegratedModeConfiguration=”false”/>
    <modules>
      <add name=”ScriptModule” preCondition=”integratedMode” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
    </modules>
    <handlers>
      <remove name=”WebServiceHandlerFactory-Integrated” />
      <add name=”ScriptHandlerFactory” verb=”*” path=”*.asmx” preCondition=”integratedMode”
           type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add name=”ScriptHandlerFactoryAppServices” verb=”*” path=”*_AppService.axd” preCondition=”integratedMode”
           type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
      <add name=”ScriptResource” preCondition=”integratedMode” verb=”GET,HEAD” path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
    </handlers>
  </system.webServer>


Now you are ready to make your web site or web application to be “AJAX Enabled”.