Solved - Build error -> ##[error]Solution not found using search pattern 'D:\a\1\s\**\*.sln' - build

YAMAL config file:
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild#1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest#2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Error:
##[error]Solution not found using search pattern 'D:\a\1\s***.sln'.
RAW log:
2020-06-26T13:39:42.7115236Z ##[section]Starting: VSBuild
2020-06-26T13:39:42.7374773Z ==============================================================================
2020-06-26T13:39:42.7375115Z Task : Visual Studio build
2020-06-26T13:39:42.7375427Z Description : Build with MSBuild and set the Visual Studio version property
2020-06-26T13:39:42.7375688Z Version : 1.166.2
2020-06-26T13:39:42.7375904Z Author : Microsoft Corporation
2020-06-26T13:39:42.7376240Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2020-06-26T13:39:42.7376608Z ==============================================================================
2020-06-26T13:39:46.1317137Z ##[error]Solution not found using search pattern 'D:\a\1\s***.sln'.
2020-06-26T13:39:46.1880482Z ##[section]Finishing: VSBuild

Agree with Daniel, the error message Solution not found using search pattern 'D:\a\1\s***.sln' clearly states that the cause of this error is that the .sln file is not found in the s folder.
You need to check whether your .sln file is pushed to the version control. You can search this in source repo of azure devops.

I had the same error in my yaml pipelines,
##[error]Solution not found using search pattern 'D:\a\1\s\**\*.sln'
So I made it as my code & the yaml file are in same branch. Now it will work, I hope it will help you.

Related

Github actions job cancelled for no obvious reason

I'm trying to set up a github actions script for a project of mine. The project is private at the moment since I want it in an RC state before the first release. As it is close to ready, I intended to set up an automated build now, but I'm seeing some strange behavior. The project is a simple c# library, and so the .yml file is quite simple:
name: .NET Core Desktop
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest
env:
Solution_Name: Replacement.sln # Replace with your solution name, i.e. MyWpfApp.sln.
Test_Project_Path: UnitTest.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
steps:
- name: Checkout
uses: actions/checkout#v3
with:
fetch-depth: 0
# Run build
- name: Run build
run: ./build.cmd --target pack --configuration ${{ matrix.configuration }}
Sometimes, one of the builds (Debug or Release, or both) fail with an entry such as
Terminate batch job (Y/N)?
Error: The operation was canceled.
in the log. I certainly did not cancel the build in any way. This may happen after like 3 minutes.
Am I running into the github build time limit (how would I know)? Or is there something else wrong I'm missing?

Azure Devops Test Pipeline LNK1107 When Opening vulkan-1.lib on MSVC but Works fine on GCC

Currently have a linker error in an Azure Devops test pipeline:
##[error]lib\static\x64\vulkan-1.lib(0,0): Error LNK1107: invalid or corrupt file: cannot read at 0x82
lib\static\x64\vulkan-1.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x82 [d:\a\1\s\Rhea\Rhea.vcxproj]
Done Building Project "d:\a\1\s\Rhea\Rhea.vcxproj" (default targets) -- FAILED.
This only happens when attempting to build on MSVC on the build machine. GCC on the build machine works fine and local machines using MSVC are able to compile just fine.
This is the testpipeline.yml:
trigger:
- master
strategy:
matrix:
x64-Debug:
configuration: 'debug'
architecture: 'x64'
x64-Release:
configuration: 'release'
architecture: 'x64'
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
submodules: true
- bash: chmod -R 755 ./
displayName: "Elevate Bash"
#Windows
- bash: ./vendor/premake/win/premake5.exe vs2019 --standalone
displayName: "Premake Windows"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
#Compile with visual studio
- task: VSBuild#1
inputs:
solution: 'RheaDev.sln'
configuration: $(configuration)
msbuildArchitecture: $(architecture)
displayName: "Build Project"
Marked with GitLFS and the pipeline wasn't so the files were incorrect.

Issues when unit testing .net Core app in Azure Dev Ops

I have a .net core 2.2 project, with some unit tests that test a class library project using Visual Studio Testing
Visual Studio Test - YAML
steps:
- task: VSTest#2
displayName: 'VsTest - testAssemblies'
inputs:
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
**\$(BuildConfiguration)\*\*unittests.dll
**\$(BuildConfiguration)\*\*test*.dll
!**\*Microsoft.VisualStudio.TestPlatform*
vstestLocationMethod: location
vstestLocation: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\'
codeCoverageEnabled: true
otherConsoleOptions: '/Framework:.NETCoreApp,Version=v2.2 /logger:console;verbosity="normal"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
timeoutInMinutes: 1
And the error message
[warning]No test assemblies found matching the pattern:
*test*.dll,!*TestAdapter.dll,!\obj**,\Release**unittests.dll,\Release**test*.dll,!*Microsoft.VisualStudio.TestPlatform*.
Can anyone identify what needs to be done to make it work?
I have tried various different options for the above
I believe you need to be pointing to the projects themselves; not the output DLL's.
So your pattern needs to look more like this: **/*[Tt]ests/*.csproj
Which will cause DEV Ops to load all projects that have Tests in its Project Name

Yesod Quick Start Fails at Stack Build

I attempted to do the yesod quick start guide last night and on step 4 running stack build yields the errror
Error parsing targets: The specified targets matched no packages.
Perhaps you need to run 'stack init'?
running stack init yields a big large error as well
Is there any resolution for this?
Edit: Adding error from the stack init command
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- ./
Selecting the best among 15 snapshots...
* Partially matches lts-13.21
aeson version 1.4.2.0 found
- edb-yesod requires >=0.6 && <1.4
classy-prelude version 1.5.0 found
- edb-yesod requires ==1.4.*
classy-prelude-conduit version 1.5.0 found
- edb-yesod requires ==1.4.*
classy-prelude-yesod version 1.5.0 found
- edb-yesod requires ==1.4.*
persistent version 2.9.2 found
- edb-yesod requires ==2.8.*
persistent-sqlite version 2.9.3 found
- edb-yesod requires ==2.8.*
yaml version 0.11.0.0 found
- edb-yesod requires ==0.8.*
Using package flags:
- edb-yesod: dev = False, library-only = False
Downloaded nightly-2019-05-18 build plan.
Unable to load cabal files for snapshot
----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----
Unable to parse cabal file for co-log-0.3.0.0#sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508
- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.
Edit 2
Adding output from stack new yesod-sqlite template
ยป stack new my-project-du yesod-sqlite
Downloading template "yesod-sqlite" to create project "my-project-du" in my-project-du/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- my-project-du/
Selecting the best among 15 snapshots...
* Partially matches lts-13.21
aeson version 1.4.2.0 found
- my-project-du requires >=0.6 && <1.4
classy-prelude version 1.5.0 found
- my-project-du requires ==1.4.*
classy-prelude-conduit version 1.5.0 found
- my-project-du requires ==1.4.*
classy-prelude-yesod version 1.5.0 found
- my-project-du requires ==1.4.*
persistent version 2.9.2 found
- my-project-du requires ==2.8.*
persistent-sqlite version 2.9.3 found
- my-project-du requires ==2.8.*
yaml version 0.11.0.0 found
- my-project-du requires ==0.8.*
Using package flags:
- my-project-du: dev = False, library-only = False
Unable to load cabal files for snapshot
----
Deleting cached snapshot file: /home/decapo/.stack/build-plan/nightly-2019-05-18.yaml
Recommendation: try running again. If this fails again, open an upstream issue at:
https://github.com/fpco/stackage-nightly/issues/new
----
Unable to parse cabal file for co-log-0.3.0.0#sha256:0eb5cf2598c3673f39a8e967a6a4f5043f4d1f1fcb50a844653c34fcf0cb068a,4508
- 0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.
Looks like something similar to the stack init command. For details on my system I'm running ubuntu mate 18.04 64-bit.

Appveyor runs tests but OpenCover doesn't show coverage

I am building the project and running test cases in appveyor. After successfully executing test cases the coverage data must be uploaded to coveralls.
But in my case no error is thrown but coverage is being recorded.
The details of my project are
.Net Core 1.1.0
Visual Studio 2017
xunit - 2.2.0
OpenCover - 4.6.519
coveralls.net - 0.7.0
My appveyor.yml is as below :
version: 1.0.{build}
os: Visual Studio 2017
skip_tags: true
configuration: Release
environment:
nodejs_version: "0.12"
COVERALLS_REPO_TOKEN:
secure: rstgrtert
cache:
- "%LOCALAPPDATA%\\Yarn"
install:
- npm i -g yarn#0.16.1
- npm i -g typescript typings
- yarn global add typescript typings
- cd ".\Promact.Oauth.Server\src\Promact.Oauth.Server\"
- yarn
- cd..
- cd..
build_script:
- ps: dotnet restore
build:
project: .\Promact.Oauth.Server\Promact.Oauth.Server.sln
verbosity: minimal
test_script:
- cd ".\src\"
- ps: >-
C:\Users\appveyor\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe-target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test -f netcoreapp1.1 -c Release .\Promact.Oauth.Server.Tests\Promact.Oauth.Server.Tests.csproj" -mergeoutput -hideskipped:File -output:opencover.xml -oldStyle -filter:"+[Promact.Oauth.Server]*Repository -[Promact.Oauth.Server.Tests*]*" -register:user
if(![string]::IsNullOrEmpty($env:COVERALLS_REPO_TOKEN)){
$coveralls = (Resolve-Path "C:\Users\appveyor\.nuget\packages\coveralls.net\0.7.0\tools\csmacnz.coveralls. exe").ToString()
& $coveralls --opencover -i opencover.xml --repoToken
$env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
}
In appveyor it runs the test and simply shows
Committing...
No results, this could be for a number of reasons. The most common reasons are:
1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.
Coverage data uploaded to coveralls.
link to the appveyor build