Wednesday, May 17, 2017

Adding ASP.NET 5 Templates to VS 2015

Good day!
One might notice that the ASP.NET 5 templates are not visible when creating a new Web Application Project in Visual Studio 2015 given that this is a fresh installation of the software. So to add the ASP.NET 5 Templates, download the ASP.NET 5 run-time tools Microsoft ASP.NET and Web Tools 2015 (RC) – Visual Studio 2015 and proceed with the setup. Restart your machine afterwards.
That's it.. :-)

This version of Visual Studio requires the April 2014 update to Windows 8.1 (VS 2015)

Hello,
Now that I've got the time to install Visual Studio 2015 Enterprise on my laptop with Windows 8.1 Operating System I decided to give it a go. That's when the moment I opened the installer file, an issue pops out of the screen with the description "This version of Visual Studio requires the April 2014 update to Windows 8.1 and Windows Server 2012 R2 known as KB2919355".
The solution to this issue can easily be found at stackoverflow. But missing the links of the packages needed to resolve the problem. A step by step example is presented below.
1. Download update package 2919442 and install update to your pc. This is the pre-requisite update of package 2919355
   x86
   x64
2. Download update package 2919355 and install update to your pc.
   x86
   x64
3. After those updates have been installed, restart the computer for the updates to take effect.
Cheers! :-)

Monday, May 1, 2017

How to Post JSON data with WebRequest in .NET

Hello,
There was a question on how to post a JSON data using the WebRequest class given that using Ajax, the post data would look like this.
data: '{ "age": "78", "weight": "51" }'
In .NET, you need to store the JSON data into a string object and escape those double quotes before passing it to the WebRequest object.
C#.NET
string postData = "{ \"age\": \"78\", \"weight\": \"51\" }";
VB.NET
Dim postData As String = "{ ""age"": ""78"", ""weight"": ""51"" }"

Cheers! :-)