Tuesday, August 11, 2015

VSOL: Visual Studio Online versus GitHub

Visual Studio Online (visualstudioonline.com) and GitHub (GitHub.com) both support Git repositories. For those not familiar with Git, it is a distributed version control system (see: Git (software). So the question is, which is better, Microsoft's Visual Studio Online (VSOL) or the open source community's darling, GitHub? Although both provide access to Git-based revision control the model is different -- it is like comparing apples to oranges.

If your primary goal is to share a project with the hoi polloi (such as an open source project) then GitHub makes sense. The free personal plans get unlimited collaborators and unlimited public repositories while the free organizational plans get unlimited members and unlimited public repositories. The downside to the free plans offered by GitHub (whether individual or organizational) is that private repositories are not supported. Individuals and organizations are required to spend money in order make their repositories private.

Visual Studio Online (VSOL) supports unlimited Git repositories for up to five developers at no cost (Signing up for Visual Studio Online (cloud-based Team Foundation Server)). VSOL does not have a public option such as that supported by GitHub and hence there is no way to share a Visual Studio Online project with the common people (see Pulp's "Common People", a great music video). Recall also that in addition to five free source code licenses, Visual Studio Online offers unlimited licenses to stake holders (Visual Studio Online (cloud hosted TFS): Unlimited (no cost) users can Create/Access Bugs/Tasks) which allows product managers, Q.A. engineers and tech support to take advantage of the bug tracking and project management 
This blog has previously presented the cost structure of Visual Studio Online (The cost of Visual Studio Online (cloud based TFS) and 10 Visual Studio Premium Licences for a great price). The previous post is from November 14, 2013 so it is highly likely the prices have changed. It is important to note that Visual Studio places no size restrictions on projects and does not limit the number of projects that can be created. All-in-all the prices associated with Visual Studio Online were reasonable.

GitHub pricing can be found at Plans and pricing. An individual can purchase five private repositories for $7 a month (Micro plan). An organization can purchase ten private repositories for $25 a month with unlimited members and unlimited public repositories (Bronze Plan). 

With regard to the size limitations of GitHub see "What is my disk quota?"  which is shown below:


A 1GB limit is reasonable for most software projects so the previous screenshot is not meant as a criticism but is simply information for those evaluating Visual Studio Online versus GitHub.com.

To put the two in their proper perspective consider World Vision a charity that allows people to sponsor a child for $35 a month, a child that might otherwise go hungry. For every five GitHub personal plans subscribers who select the Micro Plan ($7 a month), a child goes hungry (5 * $7 = $35). Okay, that was joke.

GitHub and Visual Studio Online are both reasonable options and are reasonably priced. My choice is Microsoft because I have access to licenses as a Gold Partner and through Microsoft's Biz Spark program. I also have confidence in Microsoft's ability to manage cloud based applications including backup. This does not mean GitHub does not do a stellar job of protecting data. Microsoft is one of the main cloud players which is an incredibly high bar.

Monday, June 8, 2015

Visual Studio 2015: Displaying Line Numbers for Files

When talking about code with another develop, line numbers are extremely handy. Visual Studio (regardless of the version) does not display line numbers in source files by default. This is demonstrated below:



In order to enable line numbers, select Options from the Tools menu:


From the Options dialog navigate to Text Editor | All Languages | General.


Check the Line Numbers check box and click OK.Voila! the files displayed in Visual Studio have line numbers as demonstrated below:



Monday, June 1, 2015

Windows 7: Finding Version of Windows and System Memory

I have a client that needs to run a virtual machine (Hyper-V) in order to solve a problem running legacy software. Before making the on-site visit to configure Hyper-V, it is necessary to know the version of Windows on the client computer and the amount of physical memory.  Hyper-V can be run on Windows 7 Professional, Enterprise and Ultimate editions. The client's computer should have at least 8 GB of physical memory. The client literally needs to open a browser Window in the operating system running via Hyper-V so 8 GB is sufficient memory. 

The steps needed to determine the version of Windows 7 running on the client's computer and the physical memory are as follows:

1) Click in the Windows button

2) This reveals the Start Menu (note Control Panel on the upper right of the Start menu):



3) Click on Control Panel revealing:



4) Click on "System and Security" which displays:



5) From the "System" category select "View amount of RAM and processor speed":


The previous screen shows the version of Windows is "Windows 7 Enterprise" and the amount of "Installed memory (RAM)" is 16.0 GB.

Sunday, May 24, 2015

Enabling OS/X Keyboard support for Standard Function Keys

When coding with Visual Studio or XCode, developers rely on the F1 to F12 keys. By default an OS/X machine uses these sacred keys for monitor brightness, keyboard backlight, volume and media control. The Mac keyboard provides a function key, fn (the function key), in order to make use of F1-F12 rather than the default potpourri provided by Apple. The fn key is located on the lower left of the standard Mac keyboard:



Thankfully OS/X provides a setting that makes the F1-F12 behaves as the F1-F12 keys without hitting the function key. To configure this setting, first click on System Preferences (see below):


From the System Preferences dialog click on the Keyboard button:
The keyboard dialog is as follows and note the "Use all F1, F2, etc. keys as standard function keys" checkbox: 

Check the "Use all F1, F2, etc. keys as standard function keys" checkbox to toggle the behavior of the function keys. In order to use the keys less used by developers (monitor brightness, keyboard backlight, volume and media control) click on the function key (fn) followed by the desired action.

Visual Studio was referenced as one reason to make the fault keyboard behavior be to use the function keys, F1-F12. Visual Studio does not run on OS/X by VM Fusion does so it is possible to run a Windows Virtual machine on a Mac. This is extremely handy for developers who develop in both environments.

Wednesday, May 20, 2015

Visual Studio Online: Adding a User to a Project/Team

Introduction

As a consultant, I set up one Visual Studio Online (VSOL) repository per-client and then after a project is completed the clients own all their source code control. The client gets the security of cloud-based (automatically backed up) source code control and the client can remove my access since I am no longer engaged in work. The downside to this is what happens when I am re-engaged to perform development tasks. This write up covers how to add a user to a specific VSOL Project/Team.

Previously I provided instructions on how sign up for Visual Studio Online, "Signing up for Visual Studio Online (cloud-based Team Foundation Server)". VSOL is cloud-based source code control free for up to 5 users accessing source code control and free for unlimited users to access project management features and bug/tasks (see "Visual Studio Online (cloud hosted TFS): Unlimited (no cost) users can Create/Access Bugs/Tasks").

VSOL is organized into teams/projects where each project serves as a separate hive containing source code tasks/bugs and project management features such as the support for Agile processes (sprints, backlogs, etc.). Each project is even associated with a room where developers can post messages in a social networking fashion because it is well known fact that a developer under 30 years old cannot function unless they can post what they ate for breakfast each day. Microsoft seems to use the terms team and project interchangeably. The terms are just ways to segregate user access to different code repositories.

VSOL users can be assigned to various roles within a project where the most important role for a developer is having access to source code control (under the covers Team Foundation Version Control - TFVC). Giving a developer access to source code what will be demonstrated here.

Adding a User to Visual Studio Online

Remember to perform administrative tasks such as adding a user to project/team, the user logged into VSOL must have the appropriate permissions. Typically the account owner has such permissions. When an administrator (or any users) logs into their Visual Studio Online instance a screen such as the following is shown:


At the top of the screen are a set of tabs: Overview, Users, Rooms and Load Test.If the user to add is a new user, then select the Users tab:


A user added by clicking the appropriately named, Add button:


The "Sign-in address" is an email address that is a Microsoft ID. The "License" drop down is significant because the user being added must have access to source code control. The drop down contains the following values:


The type of licenses for a user that requires source code assess are Basic or Eligible MSDN Subscriber. Basic license are from the 5-free pool or additional Basic licenses can be purchased (including license with more functionality than Basic). MSDN Premium subscribers automatically have access to a VSOL license that includes access to source code (if permitted). The type of user that should not be added to access source code control is a Stakeholder. The Stakeholder license types are the unlimited free licenses that only have access to Bugs/Tasks and project management.

Once the new user's information has been provided, the Send Invitation button should be clicked. This button click sends the user an email so they can access VSOL. This does not, however mean the user has access to a particular project. Giving a user access to a a project is an additional administrative step within VSOL.

Adding a User to a Project/Team

To manage (including adding) the users associated with a project, go to the Room tab and select the desired project (remember the tabs along the top of VSOL are Overview, User, Rooms and Load Test):


The current room is selected on the left. It is possible select a different room using the list of rooms on the left. For a given room the "Manager users" link is visible on the right. Clicking on the "Manager users" link displays the MANGE MEMBERS dialog:


A user can be added to the project (drum roll please) using the Add button:


Selecting "Add user" allows an existing VSOL user to be added. Users can be added in groups (VSOL Groups) and all users in a VSO Group can be given access to a project using the "Add VSOL Group" option. Once the user is added, said user has access to the source code control for the project.

Saturday, March 21, 2015

Global Assembly Cache (GAC) Assembly Management with Windows File Explorer

Managing the Windows 7 Global Assembly Cache (GAC)

The problem was this, I had a complex application with an installer. Post-install on a Windows 7 machine, I needed to debug the application by overwriting an assembly (DLL) that was installed with an assembly built for for debug and its corresponding PDB file. As part of the install process, the assembly was in the Global Assembly Cache (GAC).GACUtil (Gacutil.exe (Global Assembly Cache Tool)) is a command-line utility that can add assemblies to the GAC, remove assemblies from the GAC and provide a list of assemblies in the GAC.

Ultimately GACUtil is a command-line utility where Windows File Explorer is a more natural way manage the contents of the GAC. The Global Assembly Cache is just a folder, located under: C:\Windows\assembly and appears as follows on a Windows 7 machine:


What is displayed on Windows 7 when C:\Windows\Assembly is viewed in File Explorer is Assembly Viewer. The Assembler Viewer means File Explorer (under Windows 7) cannot be used to manage the GAC, hence GACUtil become a necessity. There is no convenient drag/drop or copy/paste as is the case when simply managing files with Windows Explorer.

A quick internet search revealed a technique to disable Assembly Viewer, "How to copy or replace DLLs from your GAC." The previous link is a blog posting written by Mohammed Adenwala a senior technical evangelist with Microsoft so obviously a very knowledgeable person in the Windows arena. His blog posting is all text and no screenshots. The first comment following his write up is:



The technique demonstrated Adenwala is to navigate to HKLM\Software\Microsoft\Fusion in RegEdit and to add a 32-bit DWORD key DisableCacheViewer where the value is set to 1. Rather than assume ever develop understand the previous sentences lets demonstrate with screenshots. In order to display the registry bring up Regedit which can be found under Windows 7 as follows:



When regedit is run it displays the following:


The root level kevys of the registry each have a rather long name so developers over the years have have developed a shorthand:

  • HKEY_CLASSES_ROOT is abbreviated HKCR
  • HKEY_CURRENT_USER is abbreviated HKCU
  • HKEY_LOCAL_MACHINE is abbreviated HKLM

So the instructions to disable assembly viewer should be clear now since root key abbreviations have been itemized: within Regedit navigate to HKLM\SOFTWARE\Microsoft\Fusion and create a DWORD value named, DisableCacheViewer, with a value of 1. Using RegEdit is is possible to navigate to the location, HKLM\SOFTWARE\Microsoft\Fusion, which is shown below:



To create a new key simple click the area of RegEdit where keys are normally display and select New | DWORD (32-bit) Value:


When a new value is created it will be appear in RegEdit as follows, New Value #1:


Right clicking on the name, New Value #1, it is possible to rename it to DisableCacheViewer which is demonstrated below:


Double clicking on the name DisableCacheViewer  allows this value to be edited where a value of 1 can be specified:


Once the value of DisableCacheViewer  has be set to 1 it will appear as follows in RegEdit:


File Explorer now shows the files within the GAC (C:\Windows\Assembly) sans Assembly Viewer (no reboot required):


Below it is shown that it is simply possible to navigate to any assembly with the GAC such as AuditPolicyGPManagedStubsInterop.dll, 32-bit instance, version, \6.1.0.0, singing key 31bf3856ad364e35:



A bunch of screenshots demonstrating how to display GAC files within File Explorer should not be construed as criticism of Mr. Adenwala's blog posting. His posting provided enough information for most developers to access the DLL's in the GAC via File Explorer. My comment to Mr. Adenwala's blog posting is as follows:

Managing the Windows 8 Global Assembly Cache (GAC)

Throughout this posting, the term Windows 7 was used to specify how Assembly Viewer was dispalyed when viewing C:\Windows\Assembly was viewed in File Explorer. Under Windows 8 the following is displayed in Windows Explorer when C:\Windows\Assembly is accessed:


An experiment is in order to see if Assembly Viewer works within File Explorer on Windows 8. The registry key,. DisableCacheViewer, was added (type DWOD) under HKLM\Software\Microsoft\Fusion and the value set to 0 (which means Assembly Viewer is enabled).


Even after DisableCacheViewer is set to zero Assembly Viewer is not displayed.

Windows 8 the operating system that brought: :
  • Support for 64-bit Hyper-V virtual guest machines
  • Disabled Assembly Viewer when access the C:\Windows\Assembly
How is C:\Windows\Assembly displayed in Windows 10? Well... That is an exercise left to the reader.

Tuesday, January 27, 2015

Visual Studio Community: A Free Development Tool from Microsoft

Introduction

For nearly a decade Microsoft has provided free versions of its development tool, Visual Studio. This article presents an overview of these no-cost tools and provides instructions on where to acquire the latest versions of these tools.  The installation and setup of  Microsoft's latest free development tool, Visual Studio Comunity 2013, will be reviewed.

Visual Studio supports developing applications in C#, C++ and VB.NET, The platforms supported include web, desktop, store/app, phone, database and cloud-based development. The first iterationsof Microsoft free development tools were called Visual Studio Express editions (2005, 2008, 2010 and 2012). The current edition of Microsoft's free development tools are called Visual Studio Community 2013. Visual Studio Community 2013 added support for extensions/plugins.

Visual Studio Express

In 2005 Microsoft released several versions of Visual Studio Express 2005. This product was provided at no cost to developers in response to the plethora of free development tools from the open source community. The versions of Visual Studio Express released are  target specific languages and included Visual Studio Express 2005, Visual Studio Express 2008 and Visual Studio Express 2010. The flavors of Visual Studio Express released are:
  • Visual Basic Express
  • Visual C++ Express
  • Visual C# Express
  • Visual J# Express (only Visual Studio Express 2005): support for this language ends in 2015.
  • Visual Web Developer Express
  • Visual Studio Express for Windows Phone (only Visual Studio Express 2010)

As of 2012, Microsoft moved from per-language versions of Visual Studio Express to per-platform versions of Visual Studio Express. The versions of Visual Studio Express released after 2012 include:
  • Visual Studio Express 2012 for Web
  • Visual Studio Express 2012 for Windows 8
  • Visual Studio Express 2012 for Windows Desktop
  • Visual Studio Team Foundation Server Express 2012
  • Visual Studio Express 2013 for Web
  • Visual Studio Express 2013 for Windows: original download supported Windows 8.1 only. Update 2013.2 added support for Windows Phone 8.1.
  • Visual Studio Express 2013 for Windows Desktop
  • Visual Studio Team Foundation Server Express 2013

Visual Studio Community

On November 12, 2014 Microsoft released Visual Studio Community 2013 edition (Visual Studio Community 2013): 



Prerequisites

In order to install Visual Studio Community edition the requisite operating system must be Windows 8.1, Windows 8 or Windows 7 SP1.

The hardware requirements are as follows:
  • 1.6 GHz or faster processor
  • 1 GB of RAM
  • 20 GB of free hard disk space
  • 5400 RPM hard-drive
  • DirectX 9-Capable Video card with 1024x768 of minimum resolution

Installation

This development tool can be downloaded from Visual Studio Community 2013 download:


Clicking on the Download button displays the following:


When the application runs it will give a warning if a version of Internet Explorer is installed that is earlier than Internet Explorer 10. When the installer for Visual Studio Community is run the following screen is displayed:



A user must agree to the licensing terms to install. The vast majority of developers do not modify the installation folder. Clicking on Next displays the following:





The previous screen is displayed during the installation of Visual Studio Community.

Once the application has been installed the screen displayed is as follows:



The previous screen is displayed once Visual Studio Community is installed. Clicking on LAUNCH, launches Visual Studio Community.

Creating a Microsoft Account

Before launching Visual Studio Community for the first team, every developer should have a Microsoft account. A Microsoft account is simply an email address from Microsoft (outlook.com, hotmail.com, live.com, etc.). Additionally it is possible to take a work/Gmail/Yahoo email address and convert it into a Microsoft account (meaning Microsoft will associated a password with the provided email). To take a non-Microsoft email can create a Microsoft account with it, visit https://login.live.com:


At the lower right there is a link that can be clicked in to sign up for an account Sign up now

Launching Visual Studio for the First Time

When Visual Studio Community is Launched for the first time, the following screen is displayed:



Visual Studio will save a developers settings "to the cloud". This means that when a user logs in the setting are the same for each version of Visual Studio. For example, a user can select within Visual Studio settings to use spaces instead of tabs and selects 2 spaces for each tab key pressed, When a user is logged into Visual Studio, these settings are the save regardless of the machine on which a user is on when they bring up Visual Studio. 

In licensed editions of Visual Studio (not Visual Studio Community), the sign in handles licensing.

On the previous screen it is possible to click on "Sign in" or "Not now, maybe later." Once a user is signed in or if they choose not to, the following is displayed:



Clicking on the "Development Settings" on the previous screen reveals the following:


Obviously, a C# developer should select "Visual C#" and then click on "Start Visual Studio" to launch Visual Studio Community edition.

Using Visual Studio

Microsoft Virtual Academy (see the following link: Microsoft Virtual Academy) provides numerous free, online classes that  that teach development skills. Of note is the class found at C# Fundamentals for Absolute Beginners. The second lecture, "02 | Installing Visual Studio Express 2013 for Windows Desktop" is analogous to this article in that it presents the steps how to install Visual Studio Express. Obviously Visual Studio Express is the free version of that was released before Visual Studio Community Edition. 

The creation and organization of a project in Visual Studio Express is nearly identical to that of Visual Studio Community. The second, third and fourth lectures of C# Fundamentals for Absolute Beginners cover present a comprehensive overview of development a first project that can be applied to Visual Studio Community "03 | Creating Your First C# Program," "04 | Dissecting the First C# Program You Created" and "05 | Quick Overview of the Visual C# Express Edition IDE."