Nuget Packager Unsupported Framework Issue on VSTS

 

I was facing an Unsupported Framework issue with Nuget packager on Visual Studio Team Service Online (VSTS) when porting my HBD Framework to the .Net Standard.

I had been mad with this issue in a couple of days, and eventually, I found a solution to fix it. Let me explain about the problem and the solution. So it might help for those who are facing the same problem.

1. Build and Deployment Process.

First, I would like to share my Nuget Publishing Automation Process. I have using VSTS as primary source codes repository sin last few years. In there, I created a few auto build and auto release processes that help to publish my packages into Nuget.org continuously.

Internally, I’m using the Package Management for VSTS as my test environment. So all beta versions of my packages have been published into this tool for testing purposes. Once the package is stable, I just simply trigger the other release to put it to Nuget.org.

Below is the illustration of the publishing process that had been implemented on my VSTS.

I will show you the details of the continuous deployment in difference post as the purpose of this post is fixing the Nuget Packager issues.

Continuous Deployment

2. The Issue.

When ported my HBD framework to the .Net Standard, the Nuget Packager was showing the below warning message when packaging my binaries on VSTS.

After then The .Net Standard had displayed as the Unsupported framework on my package. Hence, my package was not able to publish to Nuget.org as it is not allowed an Unsupported framework to be deployed.

Furthermore, if open the nuspec file with Nuget explorer the frameworks is displaying properly.


Here is the configuration of my nuspec file.

3. The solution

After spending a lot of times on this issue, I realized that the problem is the version of default Nuget.exe file in Nuget Packager is old (3.x), and it is not supporting the .Net Standard.

So, to fix this issue, I downloaded the latest version of Nuget.exe here and replaced the default version of Nuget packager by the following configuration of the build definition on VSTS.

  1. Put the Nuget.exe file in the Shared location on VSTS.
  2. Map the Shared location to the Build Definition.
  3. Replace the Nuget.exe of Nuget Packager with the version in Shared location.

 

Then execute a new build and re-deploy the package to Nuget.org again, here is the result.

  • Hopefully the issue of the Nuget Packager will be fixed soon. However, ai this time if you are facing the same problem then just apply this as the work around solution for your build.
  • VSTS online is free tool. Register here if you want to learn about the auto build, auto deployment.

You can download the latest source code of HBD.Framework here.

Start and Stop Azure VMs Using Microsoft Flow

 

You have a few VMs on Azure and not ordered to be accessible at 24/7. However, you regularly forget to turn it off after use. As you know, keep the VMs running idly on Azure is wasted. So if you are looking for a tool that helps you to turn off your VM without login to the Azure portal? Then this post is for you. You might know about the Microsoft Flow application that allows automating the manual actions. So get used of the Flow, I would like to show you how to create a button on Flow to start and stop your Azure VMs.

1. Setup Automation Account and Runbook

Runbook is a helpful feature that allows automating the manual tasks in the Automation Account. So get used of this, the following steps will show you how to create and integrate the Runbooks with Flow. You shall found more information about the Runbooks here.

2. Implement Runbooks

To running a Runbook the Automation account need to be established. Here I will create a new Automation account named HbdAutoAccount.

Navigate to Runbook Gallery, look up and import  2 Runbooks Start Azure V2 VMs and Stop Azure V2 VMs with following names Start-Steven-PC and Stop-Steven-PC.

Now, I will have 2 Runbooks in the automation account as below screenshot.

3. Create Webhooks

Turn into each runbook, click Edit and Publish buttons before using it, because Azure is not allowing to run the unpublished Runbooks. If any change on the Runbook, remember to publish it again to get effective.

Next, go to the Webhooks position of Runbook and create a hook with the following information.

  • Name: Start Steven PC
  • Enabled: Yes
  • Expires: 1 year from today.
  • URL:
  • Parameters:
    • Resource Group Name: VMs, the resource group of  VM.
    • Name: Steven-PC, the VM name.

Create the same hook for Stop-Steven-PC. After 2 Webhooks had been set up, I have 2 URLs as below. These URLs will be used to create two buttons on Microsoft Flow.

  • Start Steven PC: https://s3events.azure-automation.net/webhooks?token=q5F3KX1nRol1vjgkIz61NRLj6T%2fxNCQOeC4jDunBQaA%3d
  • Stop Steven PC: https://s3events.azure-automation.net/webhooks?token=q5F3KX1nRol1vjgkIz61NRLj6T%2fxNCQOeC4jDunBQaA%3d

4. Create the start and stop buttons on Flow.

1. Create Start and Stop buttons on Microsoft Flow.

After logged into Microsoft Flow (if you don’t have Flow account just create one, it is free). Click on My Flow and Create From Blank then select Flow button for Mobile with action is HTTP:

  • Flow name: Start Steven-PC
  • Http method: POST
  • URL: the start Steven PC URL had been established previously.

Then click Create Flow button. After this step, I will have a Mobile Button on Flow to start the VM. Following the same for the stop button.

Download Microsoft Flow for iPhone, and now I can Start and Stop my VM on Azure by using my phone directly.

2. Enable the auto shutdown of Azure VM.

Moreover, the Azure VM has the other feature so-called Auto Shutdown. It will help to shut down the VM during certain time periods. In here, the shutdown time of my VM is 1:00 am. So in case I missed, It will shut down my VM at 1:00 am every day automatically.

  • With Flow button you can able to start and stop a set of VMs at the same time by adding the HTTP actions contexcturely.
  • As I have openned 2 webhooks for Flow buttons this is a Security gap so shiuld not disclose the hook URLs to anyone even your wife.
  • The expire date of the hooks should keep it as short as manageable and when it is expired, you should create a new one and update the URL back to the Flow buttons.
  • Recently, the Azure for mobile has been released that allow you to manage Azure Resources on the go. However, using that tool is required the Azure Subscription. In case you want to release the VM for someone that they don’t have subscription, Flow is still useful for you.

The Vietnamese version here.

Data Migration Script Generation Tool For SSDT Project

 

The DataMigrationScriptGeneration Tool will help to generate the MERGE scripts for your SSDT package based on existing data in SQL Tables. The merge scripts will be executed as the post scripts when SSDT package is publishing to target database.

Download here.

Main WIndow

Code Coverage Tool

 

As you know the code coverage analysis tool is available for Enterprise edition version only. If you are using Visual Studio Professional and you wish to review the code coverage of your test-cases. So allow me to introduce you CodeCoverageGenerationTool will help to export the code coverage report based on the unit test binaries files.

Download here.

Main WIndow