Thursday, December 22, 2016

ASP.NET Core Application continuous integration with visual studio.com and git

Previously I have written couple posts for continuous integration series and this post is also part of it. Recently Microsoft has released ASP.NET Core 1.0. So in this post, we are going to see how we can do the continuous integration for ASP.NET Core application. I am going to use visualstudio.com as our source control repository and git as our version controlling system. So Let’s get started.

The first thing we need to is to create a Project into VisualStudio.com like following.

VisualStudioProject

Once you click on create the project it will create a project with GIT as version controlling system.

naviagte-to-project

Now our project is ready. Once you click on navigate to project it will load project dashboard like below.

project-dashboard

Now go-to “Build & Release” section of the project. It will load the page like below.

build-release-visual-studio-com

Now to enable continuous integration for this project we need to create a new build definition for that click on Plus green icon on left side. It will load a wizard to create a build definition. The first screen presented with default templates like below.

build-definition-wizard-template-selection

We are going to select ASP.NET Core build which there in preview mode and click next will load source control step like below.

build-defintion-git-settings-step

Her we are using visualstudio.com so we are not going to change anything but we are going select continuous integration check like below to enable continuous integration like below.

build-defintion-git-settings-continuous-integration

Click on create will create build definition like below.

build-definition-wizard-completion

Click on save button to save build definition. It will open up a dialog like below.

core-build-definition

Click on ok will save build definition.  Now we are done with the configuration of continuous integration and now its time to add code to check whether this configuration is working or not. To add code click on the code menu on visualstudio.com it will load the following screen.

git-code-page-visualstudio

Now to configure the repository in visual studio we need to click on the clone in visual studio. It will open Visual Studio IDE.

team-explorer-visual-studio

Clicking on clone will clone repository in local and then we need to create an asp.net core application for that repository.

create-net-core-application

Clicking on open will create an asp.net core web application. Once you are done with creating the application, we need to push our code to master branch so that we can see whether our continuous integration is working or not. To push the changes, Goto team explorer it will load screen like below.

team-explor-visual-studio-after-create

Click on changes will show the changes that are made for git repository like below. Put commit message and click on commit all.

changes-team-explorer-visual-studio

It will commit changes local like below.

commit-local-team-explorer-visual-studio

Now click on sync. It will load Synchronization screen like below.

sync-screen-team-explorer

Now click on push button to the push committed changes to the remote git repository.

pushed-changes-visual-studio

It will push changes to the master branch. Now to check continuous integration go to build definition section of visualstudio.com. A build should be queued up for the changes we have made like below.

build-queued-up

After some time if your commit changes are fine it will complete the build.

completed-build-visual-studio

So you can see that our continuous integration is working fine. It’s pretty easy to setup. Hope you like it. Stay tuned for more.
Share:
Tuesday, December 20, 2016

How to enable remote desktop on Azure Linux VM

In Windows Azure Linux VM there is no direct way to remote desktop Azure VM. So in this blog post, We are going to learn how we can enable the remote desktop on Azure Linux VM.  If you don’t know how to create a Linux VM then there is a ton of articles available that how you can create a Linux VM.  Following a Microsoft, Docs links for creating an Azure Linux VM.

https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-quick-create-portal

After creating a new Linux VM, the first thing you need to have SSH Client to connect the Azure VM. I have windows machine and Putty is one of most well known SSH client for the windows. So If you don’t have SSH Client download Putty from the following link.

http://www.putty.org/

Once you create a VM you will get any public IP like following.

azure-linux-vm-public-key

So copy that public IP and then open Putty and paste the public IP like following.

putty-client-for-linux-vm

Now once you are done with it click on open button. It will ask for your username/password. The key thing to remember here when you create Linux VM you have selected username and password. If you have a public key then you need to supply that key to Putty.

login-password-for-putty-azure-linux-vm

Once we got connected, We need to enable the gnome desktop in our Ubuntu Server first we need to get the latest update of it and for that, we need the following command.

sudo apt-get update
Once the update is done.  Now It’s time to run install ubuntu-desktop command.

sudo apt-get install ubuntu-desktop
It will enable the Remote Desktop and Desktop UI to Ubuntu Server VM.

Note: Here I have created a Ubuntu server in Azure Linux VM. But you can use any flavour of  Linux available in Azure VM. There will be different command for each flavour you can find the complete list at following location- https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-classic-remote-desktop
Once you run the command it will take some time for running and installing desktop for the server.

update-linux-vm-install-desktop

Now its time to install remote desktop in the server for that you need to run the following command.

sudo apt-get install xrdp
Once done with that try to remote login with Windows Remote Client.

image

Note: Sometime you  now allow the remote connection that is because with Azure VM default port is not allowed for remote desktop. So for that goto the following page and do as said to allow remote tcp ip port- https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-troubleshoot-rdp-connection
And I am able to login to my Azure Linux VM.

image
Share:
Saturday, October 22, 2016

Some of the important shortcuts for Visual Studio Code

Visual studio code is a Great editor for the web development. I have started using it and I’m loving it more and more. For any editor shortcut keys are important you can do lots more without moving to mouse with a shortcut. In this blog post, we are going to learn about shortcuts for Visual Studio Code.

Ctrl + P:  Goto File, You can move to any file of open solution/folder in Visual Studio code.
Ctrl + Shift + O : Goto Symbol, You can move to any function, variable or symbol of the current file.
F12 : Goto Definition – You can move to the definition of symbol or function with this command
Ctrl + G : Goto line, You can move to particular line number
Alt + Left: Navigate  between files goes to the left side of files
Alt+ Right: Navigate between files goes to the right side of files
Alt + F12: Peek definition, You can see preview of code for a function
Ctrl + Shift + D: Debug folder or file.
Ctrl + Shift + F: Search in all files.
Ctrl + Shift + H: Replace in all the files
Ctrl + T: Go to symbol in all files
Ctrl + B : Toggle Slider Bar
Ctrl + 1: Focus Left Editor
Ctrl+ 2: Focus Right Editor
F2: Rename symbol and function
Ctrl + Shift + X : Goto Extension Window
Ctrl + J: Toggle Panels
Ctrl + ` : Open terminal in VSCode
Ctrl + Shift + U: Show output Window
Ctrl + Shift + M : Show problems, Where you can see all the problems related to code and warnings.

You can find all the shortcuts of Visual Studio code from the following link.
https://code.visualstudio.com/docs/customization/keybindings

That’s it. Hope you like it. Stay tuned for more!!
Share:

Opening ASP.NET Core Visual studio solution in Visual Studio code

In this blog post, We are going to see how we can open an ASP.NET Core solution in visual studio code.  So what we are waiting for. First, we are going to create an ASP.NET Core web application like below.

ASPNETCoreApplication

Then select web application like below.

ASPNETCoreWebApplication

Now once you created Ok it will create an ASP.NET Core Web Application like below.

SolutionExplorer

Now let’s run that application to make sure that its work fine.

edgeASPNETCoreApplication

Open ASP.NET Core Solution in Visual Studio Code:

For those who don’t know What is Visual Studio code is here is the definition from the Wikipedia.

Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring
It is a cross-platform open source editor for writing code from Microsoft. You can find more information about that from the following links.

https://en.wikipedia.org/wiki/Visual_Studio_Code
https://code.visualstudio.com/

Now we are going to see how we can open the same application with Visual Studio code. But before doing that we need to make sure that the computer have .NET Core installed on your machine and Also make sure that Visual Studio Code C# support is there in Visual Studio code. You can find more about that from the following link.

https://code.visualstudio.com/Docs/languages/csharp
https://code.visualstudio.com/docs/runtimes/dotnet

Since Visual Studio Code is not a full fledge IDE(Integrated Development Environment) like Visual Studio. We need to open the folder which contains the solution and source code. You can do that from Visual Studio Code.

OpenFolderInVisualStudioCode

Then select the src folder of your application like below.

SRCFolderApplicationinVisualStudioCode

Once you click on “Select Folder” it will open source code like below.

SourceCodeInVisualStudioCode


Now when you open any CSharp file on the right bottom you will see a text like installing OmniSharp.  OmniSharp is a set of tooling and editor integrations and Libraries that together creates great IntelliSense and  other tooling support for popular editors like Code, Sublime Text, Brackets, Atom,Emacs and Vim etc. You can find more information about that on the following link.

http://www.omnisharp.net/

Once you click on that text you can also see the progress of installation of Omnisharp libraries in output windows like below.

OmniSharpOutputWindowVisualStudioCode

Once it installed it will automatically select the project which you have in solution. If you have multiple projects then you can click on that and it will ask you to select the project for which you need all IntelliSense .

SelectApplicationInVisualStudioCode

That’s it. Now you have most of the experience that you got in Full Visual Studio and full fledge IntelliSense to all the .NET Features.

VisualStudioCodeExperience

Disclaimer: I have tested it on the windows machine and its works perfectly fine. For macOS and Linux I would expect the same. For further information, you can follow a GitHub Issue which is already created by the community. You can find that GitHub issue at the following link.

https://github.com/OmniSharp/omnisharp-vscode/issues/283

That’s it. It’s very easy to use light weight Visual Studio Code for same development experience like Full Fledge Visual Studio.
Share:
Sunday, September 25, 2016

3 millions page views for my blog–DotNetJalps.com

I am not super crazy about milestones. But its a big one so I have to share. My blog just completed 3 Million page views it’s an amazing journey so far. Thank you all readers from bottom of my heart. I host my blog on blogger.com. So here is the statistics from blogger.com.


StatisticsBlogger

Here are top most of blogger post for all time.

blog-post-dotnetjalps

Till 2010, I was not tracking my page views but at this time I am getting more than 60k page views per month.  Special thanks to my dear wife, who scarifies her time when I write the blog.
Once again, Thank you dear visitors and reader of my blog, without you, this would not have been possible!.
Share:

Session about Microsoft Azure at SK Patel Institute of Computer Studies

This post was pending for a month!. Sorry for being late. I had got a chance to give a session about Microsoft Azure at SK Patel Institute of Computer Studies, Gandhinagar with Kalpesh Satasiya. It was a great experience interacting with Student after so much time. Had a great time with them.  Thank you Kalpesh for being co-speaker at the event. There are more than 60 students there in the session.

Here are the topics we have covered:

  1. What is the cloud?
  2. What is Cloud Computing?
  3. Life before Cloud
  4. Virtualization and how virtualization works and lay foundation of any cloud technology.
  5. Data centers and Server container
  6. IAAS, PAAS and SAAS
  7. Different Cloud services provided by Azure.
  8. Overview of Azure portal.

Here are some the pics of the session.

DSC_0002

DSC_0005

DSC_0006

DSC_0021

DSC_0028

DSC_0031

  DSC_0036

DSC_0032

And to my surprise, We got highlighted in Local News Paper Gandhinagar Samachar.



Thank you, my friend, Dr. Nidhi Divecha – The professor and Dr. Sanajy M. Shah – Director of SK Patel Institute of computer studies for being amazing host at college. Thank you, students, for listening and asking questions related to it. Overall it was a great experience!.
Share:
Thursday, July 14, 2016

Angular 2 packages for sublime text 3

Recently, I have written a blog post about Angular 1.5 Packages for the sublime text 3. It was a great hit and lots of people were asking for packages for the Angular 2. So I thought it would be a good idea to write a blog post about it. So let’s get started. We have already learned that how we are going to install packages on the sublime text 3. So Followings are packages that are good for angular 2.

As we all know that Angular2 is built with TypeScript and So first thing we need is a Typescript package.

Typescript:

This plugin is developed by Microsoft it self. You can find more information at their Github Repository.

https://github.com/Microsoft/TypeScript-Sublime-Plugin

There are code editing services provided by this package. You can do lots many things with the package like Rename, Format document i.e where different shortcuts are already defined in the GitHub repository. This package is a must for Angular 2 development.

typescript-package-for-sublime-text

Angular 2 snippets:

This package provides code completion and snippets for the angular 2. It has been imported from John Papa’s code completion for visual studio code.

https://github.com/pjlamb12/st3-ng2-snippets

It provides various snippets and code completion for Angular 2.

angular2-component-sublime-text

Once you type ng2 it will have snippets for various things in Angular 2.

angular-2-snippets-demo-for-sublime-text

That’s it. Hope you like it. Stay tuned for more!.
Share:
Thursday, July 7, 2016

BugConf- Building secure software by Kaushal Bhavsar–Director of Pratikar Technologies

Nowadays, Security is a major concern as hackers are so smart that they can break anything.  So this Saturday we have one of the great conferences by Kaushal Bhavsar, Director of Pratikar Technologies. He is going to cover lots interesting topics mentioned below and it is the conference should not be missed. I have heard Kaushal many time and many times we have been co-speaker for the events. When Kaushal speaks about security he is just awesome. Please do register and go there I’m sure it will worth investing your time. Following are the topic sKaushal is going to cover in his conference.

  • Why security for developers?
  • Common threats for software.
  • Integrating security in SDLC.
  • Interactive Panel Discussion.
  • Networking and high tea.



So, I request all my reader who is based at Ahmedabad to register for this event and attend this Conference. Here are the details for venue and time. Just register for the conference via clicking on Add to Calendar list.

When:

Saturday, July 9, 2016, from 4:30 PM to 6:30 PM (IST) – Add to Calendar

Where:

Gujarat Law Society Auditorium - GLS Campus Opp. Law Garden, Ahmedabad, Gujarat 380006 – View Map

You can find more information about Kaushal Bhavsar at his blog: http://kaushalbhavsar.com/

and Here is more information Pratikar Technologies : http://pratikar.com/

That’s it. Stay tuned for more!!.
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews