Specify which project or solution file to use because the folder contains more than one project or solution file.

BlackGad's Avatar

BlackGad

31 Jul, 2017 09:25 PM

I have project that contains several solution files in randow places (1 in root other deeper).
And I have "generic" yaml configuration in another repository. That configuration set with "Custom configuration .yml file name" option.

That remote yaml configuration does not contain any build->project options. Does local build configuration override it?(nope)
How to specify it in this case? Is some kind of search path exist or can i setup it with env.property ?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 31 Jul, 2017 09:57 PM

    Ilya Finkelshteyn's Avatar

    As long as you set configuration to be fetched from remote YAML file, AppVeyor respects it, regardless what can be found in cloned repository.

    However, from what I understood, that project contains nested solutions. Is it true? Other words, does "main" project contains something like this in .csproj?

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <ItemGroup>
        <ProjectToBuild Include="First.sln" />
        <ProjectToBuild Include="Second.sln" />
      </ItemGroup>
      <Target Name="Build">
        <MSBuild Projects="@(ProjectToBuild)"/>
      </Target>
    </Project>
    
    And if yes:
    • do you need anything except build, like WAP or nuget packaging?
    • does it builds locally with msbuild?

    Ilya.

  2. 2 Posted by BlackGad on 31 Jul, 2017 10:11 PM

    BlackGad's Avatar

    As long as you set configuration to be fetched from remote YAML file, AppVeyor respects it, regardless what can be found in cloned repository. But remote yaml does not contains option

    build:
      project:
    
    however, from what I understood, that project contains nested solutions. Is it true? Yes

    Other words, does "main" project contains something like this No, my project is MSBuild task developing. So my unit test library contains some tests which have real VS project as data source.

    do you need anything except build, like WAP or nuget packaging? Yes but it is complex question :)

    does it builds locally with msbuild? Of course. Even furthermore this project successfully builded before i tried to use "generic" remote yaml.

    So main question: Is it possible to use "generic" remote yaml configs in different projects which have several solutions? (If project has single solution everything works as expected)

  3. 3 Posted by BlackGad on 31 Jul, 2017 10:13 PM

    BlackGad's Avatar

    oh i screw up message formatting, sry for that

  4. 4 Posted by BlackGad on 31 Jul, 2017 10:19 PM

    BlackGad's Avatar
  5. Support Staff 5 Posted by Ilya Finkelshte... on 01 Aug, 2017 02:25 AM

    Ilya Finkelshteyn's Avatar

    I see. AppVeyor fails because it does recursive search in the project folder and found more than one .sln file. Do you need to build solutions like this or they just used somehow during test execution? At least I do not see any references to those solutions in any .csproj.
    If answer is NO, so you do not want to build those solutions, then you can simple set the following:

    build:
      project: PS.Build.sln
    

    If you need to build those solutions, then you probably need to do it as before_build or after_build script.

    If this is not what you need, let me repeat my question: how you build this locally?

  6. 6 Posted by BlackGad on 01 Aug, 2017 07:00 AM

    BlackGad 's Avatar

    AppVeyor fails because it does recursive search in the project folder and found more than one .sln file

    Is there option to disable recursive scan? or setup search pattern at least? **\*.sln for example

    Do you need to build solutions like this or they just used somehow during test execution?

    Nope tests will manage to build them. I do not expect that appveyor build it by itself.

    Ok will try to explain my general setup:

    I have several (more than 2) solutions in different repositories. And i have 1 yaml configuration file. Thats why i do not want to specify option in generic yaml file

    build:
      project: some.sln
    
    Now lets return to start questions: Does appveyor override this option with local value ? (suppose no). What you can purpose for solution in current situation?

    Fast workarounds are two:
    1. Rename test solution extensions (not quite comfortable way)
    2. Rename main solution in all projects to solution.sln and specify remote option

    build:
      project: solution.sln
    

    But workarounds is not best practice :) So I am still hoping that you have more elegant solution :)

  7. 7 Posted by BlackGad on 01 Aug, 2017 10:58 AM

    BlackGad 's Avatar

    Used workaround 2. But hope you will improve this functionality somehow in future :) Search pattern for example)

  8. Support Staff 8 Posted by Ilya Finkelshte... on 01 Aug, 2017 04:08 PM

    Ilya Finkelshteyn's Avatar

    Maybe what you can do is to use some environment variable like:

    build:
      project: $(project_name)
    

    and set this environment variable value differently for different projects in UI (Settings > Environment). Environment variables are one of few things which are being merged with those in YAML. So you will still have one-YAML-fits-all, but different values of project_name variable for different projects in UI.

  9. 9 Posted by BlackGad on 01 Aug, 2017 06:12 PM

    BlackGad's Avatar

    exactly what I needed! It is elegant solution

  10. Support Staff 10 Posted by Ilya Finkelshte... on 01 Aug, 2017 06:21 PM

    Ilya Finkelshteyn's Avatar

    Good :)

  11. 11 Posted by BlackGad on 01 Aug, 2017 06:21 PM

    BlackGad's Avatar

    was confused by this http://help.appveyor.com/discussions/problems/1446-yml-file-isnt-fi...

    And missed last message)

    Sweet - Issue added.

  12. 12 Posted by Anthony Xu on 13 Apr, 2018 04:04 AM

    Anthony Xu's Avatar

    I have an problem about build repository. With no changed 2 files of appveyor.yml and HipHop.sln
    1Build started
    2git clone -q --branch=dev git@github.com:SE-REM/HipHop.git C:\projects\hiphop
    3git checkout -qf 4ce8014ca8214913e0f7832a81df6c5ef325819c
    4Specify which project or solution file to use because the folder contains more than one project or solution file.

           I have checked repository of “SE-REM/HipHop.git”, there was no more than one *.sln file.
           An I used the cmd of msbuild in the file of appveyor.yml in my local machine. That’s ok, no error.
           msbuild "%APPVEYOR_BUILD_FOLDER%\src\HipHop.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Configuration=Release;DebugType=full /p:DeployOnBuild=True /p:ExcludeGeneratedDebugSymbol=False /p:AutoParameterizationWebConfigConnectionStrings=False
           
           please please please help. What’s the problem of this.

  13. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:28 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac