Visual Studio licensing and pricing

There are two models. Subscription based and Volume licensing program; The subscription-based pricing is on Microsoft web site;

https://visualstudio.microsoft.com/vs/pricing/?tab=business

Professional = $45 per month

Enterprise = $250 per month

Microsoft has partners that might be able to help you in lowering subscription pricing by applying discounts that are not available to general public. In one instance I have been offered Enterprise edition @2,500/year for 5 developers.

Estimated pricing for volume licensing program (5 developers);

This program has one-time payment. This is a perpetual license and if software assurance is involved, you are eligible to get newer version. MSDN subscriptions are usually valid for two years. MSDN renewal is a recurring expense and cost about 20-30% of software cost.

Here is the breakdown;

Professional

The minimum limit here is 5 because there is no MSDN subscription.

Microsoft Visual Studio 2019 Professional – License – 1 User – Microsoft Open License – Single Language – PC

$496.57 x 5 = $2,482.85

Professional with MSDN

Microsoft Visual Studio Professional Edition with MSDN – License & Software Assurance – 1 User – Microsoft Qualified – Microsoft Open Business – All Languages – PC

$1,080.87 x 5 = $5,404.35

Enterprise with MSDN

Microsoft Visual Studio Enterprise With MSDN – License & Software Assurance – 1 User – Volume, Microsoft Qualified – All Languages – PC

$8,638.64 x 5 = 43,193.20

If budget is a constraint and wanted software assurance then I will suggest to go for Professional with MSDN. You can pick whatever suits you.

There are 3rd party vendors offer lower rates but not sure how that will work out. Here is one.

Resource

https://visualstudio.microsoft.com/vs/pricing-details/

https://docs.microsoft.com/en-us/visualstudio/subscriptions/volume-license

Install and configure Git for windows

Download Git from here;

https://git-scm.com/download/win

This is required if you want to use git from command prompt. A reboot is required after installation.

Visual Studio 2019 Settings

This is required to integrate with Azure Devops.

Tools -> Get Tools and Features -> Individual components

Search “git”. Select “Git for Windows” from menu;

Visual studio will take some time to reconfigure.

Visual Studio 2017 Settings

Open Visual Studio, Check the Git for Windows in the Tools – Get Tools and Features…), go to “Individual Item” tab,  check “Git for Windows”, and click “Modify”. Then it will ask you to update Visual Studio to the latest version, for example 15.9.36.

Click ok to install and close.

Project post-build event command to copy files to a local folder or network share in VS

I wanted to copy DLL files to a network share. I am dynamically loading assemblies in different applications and can not risk changing file paths.

I don’t want to mess up Visual Studio default binary locations. The work around is to do XCOPY in visual studio post build event;

XCOPY "$(TargetDir)*" "\\Netowrk Path\FolderName\" /S /Y

It’s that simple.

Resources

https://stackoverflow.com/questions/834270/visual-studio-post-build-event-copy-to-relative-directory-location

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7dc8f75f-596e-427a-9f6e-bd1a2408b9e6/post-build-command-to-copy-files?forum=visualstudiogeneral

Using Shared Projects in ASP.NET

Shared projects are used to facilitate cross platform development. This allows you to reference an entire project as opposed to just a single assembly.

Shared project is a shred bucket of code. At compile time, any project that reference the shared project will have all of the files (including folder structure) and then they will be compiled. You wouldn’t see any separate DLL as you might have seen in PCL (Portable class libraries).

A shared project is not going to be compiled on its own. The code in the shared project is incorporated into assembly that reference it and compiled within that assembly.

Let’s create a shared project;

Create a class Math with a static method Add.

namespace SharedProject1
{
    public class Math
    {
        public static int Add(int x, int y)
        {
#if NETCOREAPP1_1
            return (x + y) + 3;
#else
            return (x + y) + 13;
#endif
        }
    }
}

Add SharedProject reference to your project. If your project is targeting .NET Core 1.1, the relevant piece of code in #if/#endif will run.

//.NET Core 1.1
SharedProject1.Math.Add(3, 4);      //return 10

//.NET Core 1.0
SharedProject1.Math.Add(3, 4);      //return 20

Here is some recommendation of using Shared Projects and Portable Class Libraries;

How the code is reused

  1. Shared Projects: Source Code (All source code is available to your reference project)
  2. PCL: Reference is available at Assembly level (for example MyLibrary.dll)

Compile time behavior

  1. Shared Projects: All source code is copied into each referenced project and compiled there
  2. PCL: Nothing new. Its compiled as usuall.

Visual Studio support

  1. Shared Projects: Full Support
  2. PCL: Each plateform is compiled separately. This can be accomplished thru IOC.

#IFDEF Support

  1. Shared Projects: Full Support
  2. PCL: Unsupported

.NET Framework Support

  1. Shared Projects: Full Support
  2. PCL: Limited

The core problem with shared project is difficulty of code testing because of conditional compilation directives. This in turn introduce errors that you wouldn’t know until you have actually compiled your application.

Resources

https://dev.to/rionmonster/sharing-is-caring-using-shared-projects-in-aspnet-e17

https://stackoverflow.com/questions/30634753/what-is-the-difference-between-a-shared-project-and-a-class-library-in-visual-st

Visual Studio Debugger Failed to launch debug adapter

All of sudden I started getting this error;

If I change launchBrowser to false in launchSetting.json file,  I can successfully start the project, and then open the browser and navigate to the url manually.

launchBrowser: false

If I run project “without debugging” by pressing CTRL+F5, it runs fine but I loose debugging feature.

The quick fix is to never use JavaScript debugging in Visual Studio. The Chrome JavaScript debugger is a much better alternative for debugging.

To turn off debugging and fix the problem follow this;

You can confirm this change;

The pain is gone.

Resourceshttps://stackoverflow.com/questions/58767169/visual-studio-2017-failed-to-launch-debug-adapter-chrome