Continuous Integration & Delivery with Microsoft Azure & GitHub – Best Practices

chsakell's Blog

Continuous Integration and Delivery(CI/CD) automation practices, is one way path when you want to continuously produce and deliver software in short iterations, software that is guaranteed that when deployed, it has passed successful reviews, builds and tests through an automated and strict process. Automating the software release process is not an easy task and usually requires a batch of tools, patterns and platforms to accomplish. All these parameters depend on the company’s culture (e.g. open source or not), employee’s know how and the nature or the variety of the software. This post will describe not only how to configure a CI/CD environment but also provide instructions for Git operations as well. We will use Microsoft Azure and GitHub as the base for setting our CI/CD environment. I will break the post in the following three sections:
  • Requirements from developer, tester perspective
  • Continuous Integration & Delivery Architecture
  • Setup the…

View original post 3,392 more words

Advertisements

Design Patterns: a possible way to memorize all

When we starts for new coding/development/architecture design task, it comes handy if one have patterns on your finger tips, following is a possible way to starts with 🙂

Creational Patterns: Abram became first president of states

  1. Abram: Abstract
  2. became: builder
  3. first: factory
  4. president: prototype
  5. states: Singletion

Structural Patterns: ABCD Faces a Flying Proxy .

  1. A: Adaptor
  2. B: Bridge
  3. C: Composite
  4. D: Decorator
  5. Faces: Facade
  6. Flying: Flyweight
  7. Proxy : Proxy

Behavioral Patterns: MMIICC ON TVS

  1. M: Mediator
  2. M: Memento
  3. I: Iterator
  4. I: interpreter
  5. C: Chain of responsibly
  6. C: Command
  7. O: Observer
  8. N: Null Object
  9. T: Template
  10. V: Visitor
  11. S: States, Strategy

How to use ?? Operator in C# to assign a nullable type to a non nullable type?

Code example

int? nullableInt = null;
 int nonNullableInt = nullInt ?? 0;
 //sets the nullableInt's value to the nonNullableInt 
 // only when it has a value, else it will set 0.
 //in our case it will assign 0
 Console.WriteLine(notNullInt);
 //prints 0

This ?? operator can be used to save code that will test for null and then we will set the value.

A primer on OWIN cookie authentication middleware for the ASP.NET developer

brockallen

There have been many changes to how authentication is performed for web applications in Visual Studio 2013. For one, there’s a new “Change Authentication” wizard to configure the various ways an application can authenticate users. The approach to authentication that’s undergone the most changes in this version is local cookie-based authentication and external login providers based upon OAuth2 and OpenID (social logins). This style of logins is now collectively known as the “Individual User Accounts” and it’s one option in the new authentication wizard. This purpose of this post (and followup posts) is to explain the new authentication plumbing for this option.

Individual

OWIN authentication middleware

With .NET 4.5.1, for ASP.NET applications, all the underlying code that handles “Individual User Accounts” (as well as the templates in Visual Studio 2013) is new. This means for cookie based authentication we no longer use Forms authentication and for external identity providers we no longer…

View original post 1,019 more words

A fresh look at JavaScript Mixins

Still hot topic with new developers

JavaScript, JavaScript...

(Russian, Japanese)

In this article I’ll explore JavaScript mixins in detail, and introduce a less conventional, but to my mind more natural mixin strategy that I hope you’ll find useful. I’ll finish up with a profiler matrix summarizing the performance impact of each technique. [A big Thank You to the brilliant @kitcambridge for reviewing and improving the code on which this blog is based!]

View original post 1,236 more words

You were previously added to the Hyper-V Administrators security group, but the permissions have not taken effect. Please sign out of your computer for the permissions to take effect. Android sdk with Visual Studio – xamarin – Part 2

Part 1

The popup about permission was the reason to write part-2, but later I realized there are many more.

After completing activities on Part 1, I now hit the run button to got a pop up saying.

You were previously added to the Hyper-V Administrators security group, but the permissions have not taken effect. Please sign out of your computer for the permissions to take effect.

Yes, this is something related to permission, I read the  “sign out of your computer” as “restart the computer“.

When I came again after restarting.

I hit the run button to see the output on 5” Kitkat (4.4) Virtual device.

Again popup episode started.

Popup-1 : Microsoft Visual Studio

The emulator requires an Internet connection to start. Do you want to configure the emulator to connect to the Internet?

Your computer might lose network connectivity while these changes are applied. This might affect existing network operations.
—————————
Yes No


I clicked on Yes

Popup-2 appeared : Visual Studio Emulator for Android

Click “Retry” to run the emulator in elevated mode.

You do not have permission to modify internal Hyper-V network adapter settings, which are required to run the emulator

[Retry] [Close]

I retried and see emulator phone screen, saying “OS starting..”

Output Window Progress…

1>—— Build started: Project: App1, Configuration: Debug Any CPU ——
1> App1 -> D:\Misc\android\App1\App1\bin\Debug\App1.dll
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
2>Starting deploy 5″ KitKat (4.4) XXHDPI Phone …
2>Starting emulator 5″ KitKat (4.4) XXHDPI Phone …
2>Validating emulator arguments…
2>Determining if emulator is already running…
2>Preparing virtual machine…
2>Launching emulator…
2>An error occured. See full exception on logs for more details.
2>Could not launch ‘VS Emulator 5″ KitKat (4.4) XXHDPI Phone’ device. Exit code 10.
2>An error occured. See full exception on logs for more details.
2>Could not launch ‘VS Emulator 5″ KitKat (4.4) XXHDPI Phone’ device. Exit code 10.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

OMG, It stuck again and displayed me another popup.

The emulator is unable to verify that the virtual machine is running:

Something happened while starting a virtual machine: ‘VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lima’ failed to start. (Virtual machine ID 618636A2-0A76-46A5-A5BA-0CD352B1BEE5)

‘VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lima’ could not initialize. (Virtual machine ID 618636A2-0A76-46A5-A5BA-0CD352B1BEE5)

Not enough memory in the system to start the virtual machine VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.lima with ram size 2048 megabytes. (Virtual machine ID 618636A2-0A76-46A5-A5BA-0CD352B1BEE5)

I ran dxdiag and ensured that my system has 4GB RAM (4096 MB), it was double then requirement of 2048 megabytes.

Now what, am I in a war zone between Google and Microsoft? should I gave up or keep trying, lets give it a last try. This time we will run the Visual Studio in elevated mode via “Run as Administrator” option.

I have failed today, following is the output of my work on post 1 and this post.vsandriod

Visual Studio is saying:

Visual Studio Emulator for Android
The emulator is unable to verify that the virtual machine is running:
Not enough memory is available in the system to start an emulator that uses 2048 MB of startup RAM. Please close other applications and try to launch the emulator again.
If closing other applications doesn’t help, please follow the instructions on this KB article: http://support.microsoft.com/kb/2911380/en-us

The suggested work around is to add a guaranteed MemoryReserve in Registry for Virtualization. Guaranteed means when You run emulator this amount of memory should be always free. I added 1024 as decimal .

Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

To work around this problem in a system that is running many programs that are using lots of memory, try to close those programs and then restart the emulator.

If the emulator still does not start, you can disable the Hyper-V runtime memory monitoring functionality by adding a MemoryReserve registry. To do this, follow these steps:

  1. Start Registry Editor.
  2. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization
  3. Right-click the Virtualization folder, point to New, and then click DWORD Value.
  4. Type MemoryReserve, and then press Enter.
  5. Double-click MemoryReserve, enter 2048 in the Value data box, select the Decimal option, and then click OK.
  6. Close Registry Editor.

In systems that experience this problem and that have fewer than 8 GB of RAM installed, a MemoryReserve value of 2048 (2 GB) is recommended. A value of zero (0) causes this registry setting to be ignored.

Note You must restart the computer for this registry setting to take effect.

To close the chapter, I added the desired DWORD MemoryReserve.

When I came again after restarting, the same out of memory story.

I modified the MemoryReserve in Registry for Virtualization to Zero, still , the same out of memory story.

It seems that we need 8 GB of RAM to run default emulator.

Then I decided to create an Galaxy AVD, this time it was a success.

1>Build succeeded.
1>Deploy successfully on AVD_for_Galaxy_Nexus_by_Google.

nexus avd.png

 

Error: CS1703 – Multiple assemblies with equivalent identity have been imported. Android sdk with Visual Studio – xamarin – Part 1

I was looking for Visual Studio extension for editing Perl, I ended up here http://stackoverflow.com/questions/3755892/is-there-a-perl-extension-for-visual-studio

I followed the solution provided.

Visual Studio Update 1 RTM now (2015) has Perl support, along with Go, Java, R, Ruby, and Swift.

I  noticed the Android project type and thought to give it a try.

When build the default project, stuck on following error.

xamarin android sdk not found

Installing Android sdk from URL resolved this issue.

The new road block, I faced.

Error CS1703 Multiple assemblies with equivalent identity have been imported: ‘C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll’ and ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll’. Remove one of the duplicate references.

For resolving this, I went ahead and removed C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll reference from Project References. As mentioned in error both mscorlib.dlls were getting referenced automatically.

Now it was build successfully.

Part 2