0

I have a multi-project solution (with multiple web projects, azure function project, etc.). I want to be able to build each project separately, and deploy it to separate app services. I read this question: Azure DevOps: 1 Solution Multiple Projects CI/CD, and it asks to use path filters, but its not specific how to - there are multiple places/ways to do this, and I'm not sure which is correct.

I tried this:

variables:
  solution: '**/MyProject1.csproj'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

The build works, but then during the publish artifact step it tells me:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(776,5): Warning : The OutputPath property is not set for project 'MyProject1.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='Any CPU'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
Project "D:\a\1\s\MyProject1\MyProject1.csproj" on node 1 (default targets).

It says the configuration and release doesn't exist for the project, but it does.

I also tried:

trigger:
  branches:
    include:
    - master    
  paths:
    include:
    - MyProject1/*

The build also worked, no warnings, however, the build artifact publish copied the entire solution. So - I don't think it actually built the one project only.

Any details on what needs to be done is appreciated.

M.R.
  • 4,737
  • 3
  • 37
  • 81
  • If you want to build a single project. You only need to specify the path to this csproj in the solution property. And point publish artifact task to the folder where the .dll files are output(or you can specify a output path for your build task). For better investigation, could you share your pipeline(especially build task and publish build artifacts task)? – Levi Lu-MSFT Feb 28 '20 at 10:50
  • So - figured out my problem - the default platform value from the Yaml template is `Any CPU`, however the visual studio configuration manager puts the default value as `AnyCPU` - changing this fixed the issue. – M.R. Feb 28 '20 at 20:00
  • That's great you figured it out. Could please post your fix to as answer? – Levi Lu-MSFT Mar 01 '20 at 14:33

1 Answers1

0

So - if you have projects that were created in an older version of Visual Studio (2015 or older), the platform value is set to AnyCPU (even though the drop down says Any CPU)- in the newer versions, it is set to Any CPU. Open your .csproj file, and check what is in there.

M.R.
  • 4,737
  • 3
  • 37
  • 81