No artifacts found that match the file pattern in jenkins configuraion - c#

I have a .net class library and configuring that library to the Jenkins. I want to copy the new build dll to the bin directory of the my workplace (F:/Projects/Utility/bin/Release). I have mentioned the path of "Files to archive" to F:/Projects/Utility/bin/Release/*.dll. But as soon as I build through the Jenkins it shows the below error:
Archiving artifacts
ERROR: No artifacts found that match the file pattern "F:/Pankaj/Projects/MA/MA Code/Jenkins Code/MA/SEIManagedAccounts/SEI.ManagedAccounts.Utility/bin/Release/.dll". Configuration error?
ERROR: ‘F:/Projects/Utility/bin/Release/.dll’ doesn’t match anything: even ‘F:’ doesn’t exist
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE

Related

Running (dotnet test command) unit/integration tests dll on remote server through power shell requires csproj file

I have my dlls for the test project deployed to the server. Now I'm trying to run them using dotnet test "Path to tests.dll" but I get an error:
F:\path\tests.dll(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Basically it requires csproj file to be there in the same catalog as it was on my local machine. What's the point of having runnable DLLs for testing if I still need csproj to run the tests on the remote server. That doesn't make any sense.
How can I run the tests without having to have csproj file on the server?
I found the answer to my problem. In order to run the tests on a remote server through PowerShell, I had to use "dotnet vstest" instead of "dotnet test". vstest command allows running the tests by simply using dll file without the need for csproj file.

Publishing an Azure function returns "Publish has encountered an error" path \bin does not exist

I'm trying to publish my first test function to Azure functions. When I publish I get the error:
Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
A diagnostic log has been written to the following location:
"C:\Users\me\AppData\Local\Temp\tmp2C29.tmp"
The contest of that file say it was an unknown error, check the output log.
When I look at my output window I see this:
2>Unhandled Exception: System.IO.DirectoryNotFoundException: The path `D:\Dev\FunctionsTest-master\custom-binding\obj\Debug\netstandard2.0\PubTmp\Out\bin` does not exist. Unable to generate Azure Functions extensions metadata file.
2> at ExtensionsMetadataGenerator.ExtensionsMetadataGenerator.Generate(String sourcePath, String outputPath, Action`1 logger) in D:\src\gh.fabiocav\azure-functions-host\tools\ExtensionsMetadataGenerator\src\ExtensionsMetadataGenerator.Console\ExtensionsMetadataGenerator.cs:line 25
2> at ExtensionsMetadataGenerator.Console.Program.Main(String[] args) in D:\src\gh.fabiocav\azure-functions-host\tools\ExtensionsMetadataGenerator\src\ExtensionsMetadataGenerator.Console\Program.cs:line 28
2>Metadata generation failed.
I looked and the ...\PubTmp\Out\bin folder is not where it's being compiled. The actual folder is \PubTmp\Out\ (one folder higher).
I don't see any way of changing the folder location, I tried under properties of the function - build, but that path is the top level; not the final path.
I also don't see any way of selecting where the publish is looking for the compiled functions to publish.
How do I get these locations to be the same for the publish to work?
It appears that this was a bug in Visual Studio 2019. Patching to the current version took care of it.

Generation of the sonar-properties file failed. Unable to complete SonarQube analysis

Application Stack
Jenkins
.NET 4.7
SonarQube 7.4
Bitbucket (Source control)
VS 2015 Update 3
VsTest to execute UnitTest
Path of Msbuid in Global Tools Configuration is
C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe
Also tried with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Msbuild.exe
We have created sample project and configured all in one server.
We can see multiple kind of errors in log files like
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
WARNING: File 'C:\Program Files (x86)\Jenkins\workspace\CICD\UnitTestProject1\Properties\AssemblyInfo.cs' is not located under the root directory 'C:\Program Files (x86)\Jenkins\workspace\CICD.sonarqube\out' and will not be analyzed
No analysable projects were found. SonarQube analysis will not be performed
This only comes when i use msbuild from "Program files" An instance of analyzer SonarAnalyzer.Rules.CSharp.FieldsShouldNotBePublic cannot be created from C:\Users\manish.joisar\AppData\Local\Temp.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
I can see message with build succeeded.
I can also see successful test run message
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Sonar configuration is done in build configuration under "Execute Sonar scanner" step
I am not sure what is missing here, wrong configuration, wrong msbuild ??
I suppose you have gone through this documentation https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild for getting all the dependencies information and the command required to run the analysis.
I was getting some of the error mentioned above when i was trying to analyse c# files but i require more information to understand your case so please provide the o/p of each steps mentioned below:
SonarScanner.MSBuild.exe begin /k:"project-key"
MSBuild.exe <path to solution.sln> /t:Rebuild
SonarScanner.MSBuild.exe end
If you are running through jenkins MSBuild plugin, then please provide the verbose output of the same.
I solved all above issues with below configuration in Jenkins
SonarQube configuration
Jenkin Global tool configuration
Freestyle project configuration

ERROR: XXX.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files

We've upgraded our SonarQube instance to 6.7 version and since then we see a project failing with below error during SonarQube analysis from VSTS build.
ERROR: Error during SonarQube Scanner execution ERROR: File
src/Platform/DeviceProvisioning/Business.Contracts/Models/DeviceDetailsForReplication.cs
can't be indexed twice. Please check that inclusion/exclusion patterns
produce disjoint sets for main and test files ERROR: ERROR: Re-run
SonarQube Scanner using the -X switch to enable full debug logging.
The SonarQube Scanner did not complete successfully
However the same project gets analyzed without any issue in our SonarQube 6.1 instance. To check if the issue is with test file inclusion settings, i tried creating a new SonarQube project with no explicit setting for inclusion\exclusion but i still get the same error on a new project.
Can someone let me know how we can fix the issue.

Build step failing for TeamCity and Team Foundation Server 2012

Updated with images.
When setting up a project in TeamCity, I cannot get the build step to work. I get the same
error every time.
Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\Solution.sln
I am able to connect to the TFS. Where I put the root as following.
$/Projectname/
Testing the connection returns ok.
When creating the build step I use MSBuild and set the Build file path to where the solution exists in the tfs structure. So for example.
Build file path: Main\MySolution.sln
Because in the TFS this is where the solution is. $/Projectname/Main/MySolution.sln. When I run the build step I get the error above. What am I doing wrong? The 42c94c0380966ffa folder is created on disc but it is empty.
LOG
[14:55:24]Checking for changes
[14:55:25]Publishing internal artifacts
[14:55:25][Publishing internal artifacts] Sending build.start.properties.gz file
[14:55:25]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[14:55:25]Checkout directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Updating sources: server side checkout
[14:55:25][Updating sources] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[14:55:25][Updating sources] Transferring cached clean patch for VCS root: EEL TFS
[14:55:25][Updating sources] Repository sources transferred
[14:55:25][Updating sources] Removing C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25][Updating sources] Updating C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Step 1/1: Build Solution (MSBuild) (2s)
[14:55:25][Step 1/1] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\42c94c0380966ffa /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[14:55:25][Step 1/1] in directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:28][Step 1/1] Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\MySolution.sln
[14:55:28][Step 1/1] Process exited with code -42
[14:55:28][Step 1/1] Step Build Solution (MSBuild) failed
[14:55:28]Publishing internal artifacts
[14:55:28][Publishing internal artifacts] Sending build.finish.properties.gz file
[14:55:28]Build finished
My VCS root configuration, username and password removed.
And where the solution is located.
And the build step
Version control settings
General settings
It looks like you've configured your build to look for MySolution.sln but in TFS it's actually called EEL B2C.sln.

Categories

Resources