SonarQube fails to analyze dotnet core code with error Duplicate ProjectGuid: “00000000-0000-0000-0000-000000000000”

After making some changes to the build definition of one of the dotnet core repositories, we started observing this error with the SonarQube tasks inside the build definition in VSTS:

sonarqube code analysis task failed

When we checked the complete logs, we observed below issue:

Continue reading “SonarQube fails to analyze dotnet core code with error Duplicate ProjectGuid: “00000000-0000-0000-0000-000000000000””

Publishing Dotnet Core creates multiples nested directories

This is one of the errors that we encountered in the ASP.NET core build process. To this date, this issue can be easily reproduced by creating a ASP.NET core web api process and repeating ‘dotnet publish’ command with using an output directory and parameter –output. However, it does not happen with the simple console applications.

When we try to publish files, it creates nested multiple output directories like below:

Dotnet Core Publish creates multiple nested output directories
Continue reading “Publishing Dotnet Core creates multiples nested directories”

Dotnet Core 2.0 build fails with Error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly

We were recently observing this issue with one of the new source code repositories for a solution that was written in .NET Core 2.0. The source code was coded using Visual Studio and it was working fine on the developers machine. However, when building it using dotnet core publish task, it kept failing with below error:

T12:47:54.2728059Z C:\Windows\ServiceProfiles\NetworkService.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.4\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(45,5): error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly C:\Windows\ServiceProfiles\NetworkService.nuget\packages\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.4\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask
Continue reading “Dotnet Core 2.0 build fails with Error MSB4062: The “GetDotNetHost” task could not be loaded from the assembly”

Configuring SSH authentication between GitHub and Jenkins

In one of the previous blog post, we have discovered how to build GitHub project using Jenkins. In that post, since it was a public repository, we did not tried to authenticate to GitHub. Here, we’ll cover how to use SSH keys to authenticate to GitHub repos. This applies to both public and private source code repositories.

For this post’s purposes, we’ll use a sample source code repository at https://github.com/goyalmohit/DemoRepo01. You can use any repository on which you have required access. …Continue Reading

Install Maven on Windows Server

Maven is a tool that can be used for building and managing any Java-based project. You can think of it as build manager. It allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. In this blog post, we’ll discover steps required to install and configure Maven on windows server.

Install Java SDK on server and Configure environmental variables

This makes use of Chocolatey package manager. You need to have administrative privileges on the windows server in reference. First, make sure that execution policy to RemoteSigned. …Continue Reading