I'm trying to add SonarQube into a CI pipeline on Azure DevOps.
My project is .Net Core 2.2 application. The error is related to Agent JDK. I don't know how can I specify the JDK of Microsoft Hosted Agent.
All the tutorials of SonarQube and .NET core pipelines are the same, but none mentioned anything about this issue.
Here's a snapshot about how my pipeline looks like:
Here's the error that's always happening with me. Shouldn't Microsoft Hosted Agent know what capabilities to use by its own?
Anyone have an idea about how we can solve this error?
The problem was in the JDK used in Micorosft Hosted Machine, for some reason the JDK used was not the supposed one.
The solution was following these steps:
Uploading a JDK zipfile to Azure blob storage
Running Java Tool Installer in my Pipeline, giving it the Uploaded zip file as resource
Run Code Analysis successfully finished then and results was published to my SonarQube server
Here's how my pipeline looks like right now:
Related
We have for a while been building various web projects with AzureDevops and self hosted build agents.
Today I had to add a new build, consisting of a windows service written in .net core 3.1. This service has to be installed by our customers, so we have to provide it in a friendly installable way. As some of our developers were already used to handle MSI/*.vdproj projects, they added a vdproj into the *.sln to manage that. On a developper machine, this is not a problem even with VS2019: you just have to use the relevant VS studio extension...
But when it comes to building that in a CI/CD context, this becomes a real challenge. I quickly understood that we can't use MSBuild at all for that and found some alternative using directly Visual Studio (devenv)... Inspired by this thread (still opened), I came up with the following command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv" [...]\MySolution.sln /build "Release" /Project MyInstallationProject
This worked fine both on my developer machine and even on the build agent machine. But when I add it into a build pipeline as a command line task, it seems to hang, and after a while I get the following result for the job:
##[error]The job running on agent <MyAgent> ran longer than the maximum time of 60 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=2077134
What can I do to make it work?
What are the best practices for generating a self installable in a CI/CD context? (Is MSI still relevant? )
As a workaround, you can try to install the extension Build VS Installer and use the task DutchWorkz - Build VS Installer(s) to build Visual Studio Installer Project in Azure Pipelines.
Here are some tickets(ticket1, ticket2) with similar issue you can refer to.
When i deploy the application from Visual Studio to Azure app service using Framework/Runtime dependent mode, then app service run properly.
But when application is deployed using CICD (using VSTS), then app service fails with above mentioned error in title and following error is logged in stdout log files :
Error:
An assembly specified in the application dependencies manifest (App.deps.json) was not found:
package: 'System.Diagnostics.PerformanceCounter', version: '4.5.0'
path: 'runtimes/win/lib/netcoreapp2.0/System.Diagnostics.PerformanceCounter.dll'
But the dll is present in mentioned path under .netcoreapp2.0.
I am publishing the application using VSTS agent.
If i restart the app service then it works fine.
This is one of those errors that can come up for a thousand unrelated reasons. -Everytime- I get this error it's because I've upgraded Nuget packages in my project and one of those packages uses a version of the .Net Core SDK I haven't installed locally. I suspect since you're using the Framework dependent mode it could be an issue if it sandboxes you away from other SDK's (not sure if it does, just thinking out loud).
Make sure your .Net Core SDK's are up to date.
Try publishing it and sending the whole framework with it if you're using .Net Core as the backend (and not the old framework).
Check your NuGet's and make sure they're all supported on the framework you're specifying. I've seen cases where a 4.5 framework assembly 'might' work locally but then error out on the server. If one of them targets an SDK that isn't on the server you'll get this.
https://www.blakepell.com/asp-net-core-http-error-502-5-ancm-out-of-process-startup-failure
Since it works fine when you restart the app service, you could add a Azure App Service manage task to restart Azure App Service in your pipeline:
steps:
- task: AzureAppServiceManage#0
displayName: 'Restart Azure App Service'
inputs:
azureSubscription: azureSubscriptionName
Action: 'Restart Azure App Service'
WebAppName: AppServiceName
It seems that the first time you try to run, your application can not find this .dll that is required on the server. What you can do is to add this in your .csproj file:
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
Adding the above snippet will export all DLLs needed to run the application (assuming SDK is not available, and runtime is quite lightweight to contain non essential libraries).
I am new to .Net and Unable to understand some weird behaviour with Azure.
I am trying to publish a .Net Project to Azure Web App. And It is throwing very silly errors. I assume thats becoz of new C# version.
Here is the log file.
Use Case 1: When trying to build from Visual Studio Team Services and then deploy using Continuous delivery Works.
Use Case 2: When trying to publish directly using Visual Studio using App Service profile and it works.
Use Case 3: When trying to deploy through repository that is hosted at Visual Studio Team Services. And it fails and thats the error.
Any lead will be helpful.
Do let me know, if the information provided is not enough.
To compile C# 7.0 code, we need msbuild 15 installed. Currently, msbuild15 is not enabled on Azure Web App.
For Use Case 1 and 2, the C#(7.0) code is build on your development side on which
Visual Studio 2017(msbuild 15) is installed.
For Use Case 3, the code will be complied on Azure Web App, so it will throw errors.
Microsoft engineers are in the process of building these tools for Azure, they should be out soon. you could stay updated on github
I am creating the >car file using Developer studio and deploying using Wso2 Carbon server4.0.
When i am deploying always getting the older versions. Some times the server not properly deploying the car. And also how to build the project to get the latest changes.
Please suggest me a better procedure creating and deploying the car file.
I am using Wso2 esb 4.7.0 version,
Developer studio 3.2 version.
Refer to the following documentation.
http://docs.wso2.org/display/DVS310/Deploying+and+Debugging
I have a web site project that has been existing for a while - it has been ASP.NET MVC2 based up until right now. .Net 4, Visual Studio 2010 Sp1, deployed to IIS 7.5 running on Win2008 R2.
I have four separate deployment profiles - "alpha", "test", "staging" and "live". Yes, I could probably have come up with better names, but they should hopefully convey what they are for.
It was recently decided to upgrade to MVC3 to take advantage of new awesomeness like Razor, global filter attributes, and start using NuGet etc. So I went on an upgrade binge with the Web Platform Installer. One of the things I updated was the Web Deployment Tool - both my developer machine (where the MVC3 upgrade happens) and the web server got this new version of the tool installed.
Since then, I have not been able to do deployments. I have gone back to earlier versions of my project (thanks to git for allowing me to painlessly go back to any previous version) and tried to deploy them, and they don't work either.
Whenever I try to do a deployment from Visual Studio I get the following error:
Web deployment task failed.((23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.)
(23.05.2011 11:18:24) An error occurred when the request was processed on the remote computer.
Unable to cast object of type 'Microsoft.Web.Deployment.DeploymentSyncOptions' to type 'Microsoft.Web.Deployment.DeploymentSyncOptions'.
I can see why that cast would be hard. ;)
But seriously - how can we get deployment from Visual Studio to work again? In the future we will do this using our CI server, and install a deployment package using MsBuild automatically on the correct web server depending on the git branch that was updated, but that is some time in the future.
I have full access to both machines so any other information need can hopefully be gathered.
You might be having beta version of web deploy on your box if you have ever installed web platform installer v2 beta. YOu can check that by
gacutil -l Microsoft.web.deployment.
If you see any 7.5.0.0 version then you have a beta version. Uninstall this version. You need to check and change this on both the client as well as the server.
Owais is right - this is very likely because you have a pre-release version installed. Rune can you please check and let me know?