Solution not found using search pattern 'D:\a\1\s\**\*.sln' Azure Devops

1.8k Views Asked by At

I am getting this error of Solution not found using search pattern 'D:\a\1\s***.sln' while building and deploying dacpac via yaml file. My yaml file is below.

trigger:
- master

pool:
  name: Azure Pipelines
  vmImage: 'vs2017-win2016'
  
jobs:
- deployment: BuildAndDeploy
  displayName: Build And Deploy Dacpac
  environment: 'DEV'
  strategy:
    runOnce:
      deploy:
        steps:
        - task: VSBuild@1
          displayName: 'Build solution **\*.sln'

        - task: CopyFiles@2
          displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
          inputs:
            SourceFolder: '$(agent.builddirectory)'
            TargetFolder: '$(build.artifactstagingdirectory)'

        - task: AzureKeyVault@1
          displayName: 'Azure Key Vault: kv-agaurav-poc'
          inputs:
            azureSubscription: 'Visual Studio Enterprise-abonnement (b5970491-02a8-4fd0-b9b4-73a6e63a273a)'
            KeyVaultName: 'kv-agaurav-poc'
            RunAsPreJob: true

        - task: SqlAzureDacpacDeployment@1
          displayName: 'Azure SQL DacpacTask'
          inputs:
            azureSubscription: 'Visual Studio Enterprise-abonnement (b5970491-02a8-4fd0-b9b4-73a6e63a273a)'
            ServerName: 'fastbin-server.database.windows.net'
            DatabaseName: 'fastbin-db'
            SqlUsername: agaurav
            SqlPassword: '$(sqlpassword)'
            DacpacFile: 'D:\a\1\a\s\bin\Debug\fastbin-db.dacpac'

One thing to note is that if I have the steps and tasks outside the environment, it works.

So, my question is how can I make yaml file find the solution inside any environment tags (In this case environment: 'DEV').

1

There are 1 best solutions below

1
On BEST ANSWER

deployment job doesn't checkout you code by default. You need to add - checkout: self to download code first before you try to build you solution.