Exclude specific project from build

Fred's Avatar

Fred

15 Oct, 2015 11:09 AM

Hi!

Is there a way to exclude one or more projects in a VS solution from the build process via the appveyor.yml

I have a project for integration tests that I wish to exclude but I can't find a way how.

Regards
Fred

  1. Support Staff 1 Posted by Feodor Fitsner on 15 Oct, 2015 05:17 PM

    Feodor Fitsner's Avatar

    Hi Fred,

    Open solution configuration in Visual Studio IDE and just disable selected projects from configurations.

  2. 2 Posted by Christopher Sch... on 13 Jul, 2017 07:27 PM

    Christopher Schoeder's Avatar

    I've tried this for a project with a Website project and Appveyor doesn't seem to honor that Configuration. Despite turning off build for all configurations it still will try and build the project.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 13 Jul, 2017 08:09 PM

    Ilya Finkelshteyn's Avatar

    Please send us the following:

    • .sln file
    • build configuration in YAML format (use Export YAML if you use UI)
    • link to the build which supposed to not build specific project, but did that.
    • name of specific project which was built, but should not

    Please feel free to delete all secrets when needed.

    Ilya.

  4. 4 Posted by Christopher Sch... on 17 Jul, 2017 04:19 PM

    Christopher Schoeder's Avatar

    Hi Llya,

    to whom should I send this to?

  5. Support Staff 5 Posted by Ilya Finkelshte... on 17 Jul, 2017 05:19 PM

    Ilya Finkelshteyn's Avatar

    You can post them right here in the forum, and make thread private if you are not comfortable for it to be public. Or mail to team at appveyor dot com.

  6. 6 Posted by Christopher Sch... on 17 Jul, 2017 05:47 PM

    Christopher Schoeder's Avatar

    Hi Llya,

    I've resolved this through discovering that I was targeting 'Mixed Platforms' when handling the build configuration. Instead I need to look at the 'Any CPU' build configuration and turned it off there. Once I did this issue was resolved.

  7. Support Staff 7 Posted by Ilya Finkelshte... on 17 Jul, 2017 05:58 PM

    Ilya Finkelshteyn's Avatar

    Thank you for update!

  8. 8 Posted by Linda on 07 Aug, 2018 12:46 PM

    Linda 's Avatar

    Hi there, thanks for an interresting conversation.
    Still, I think this is a question that deserves an answer. (If there is a simple one, like some script where I just put the file or something...)

    Right now, I am trying to figure out how to exclude file "ConnectionStrings.config", that is obviously not uploaded on Github, but I have references in my Web.config file to it:

    <connectionStrings configSource="ConnectionStrings.config"></connectionStrings>

     so the build is being killed by error Could not copy the file "blablabla\ConnectionStrings.config" because it was not found.

    Any idea?

  9. Support Staff 9 Posted by Owen McDonnell on 07 Aug, 2018 06:06 PM

    Owen McDonnell's Avatar

    Trivially speaking, you could add

     <ItemGroup>
        <Content Update="ConnectionStrings.config">
          <CopyToOutputDirectory>Never</CopyToOutputDirectory>
        </Content>
      </ItemGroup>
    
    to your project file.

    But without knowing anything about your specific build/deployment, I'd suggest that you may want to read through the section in our docs about web deploy parameterization

  10. 10 Posted by Linda on 08 Aug, 2018 02:05 PM

    Linda 's Avatar

    Thanks for your answer.

    I was reading about parametrization, but that's not my case.
    I am injecting connection string right via Azure, everything is working (my deployment problem was solved by deleting azure service and creating it again -.- :D) but I am hacking a bit the build in appVeyor - I am creating an empty file "ConnectionStrings.config" jut to tell AppVeyor that it's all right, the file exists:
    (line in my appveyor.yml)

    before_build:
      - ps: New-Item C:\blablabla\ConnectionStrings.config -type file

    It's not a big problem, but I was looking for more elegant solution :)

  11. Support Staff 11 Posted by Owen McDonnell on 08 Aug, 2018 11:28 PM

    Owen McDonnell's Avatar

    I could be wrong but I think you might not really need this connectionStrings.config file at all.
    I believe if you just add something like

    <connectionStrings>
      <add name="<my_connection_string>" connectionString="Dummy value to be overridden"/>
    </connectionStrings>
    
    to your web.config file and make the name match the key-value pair you set up in Azure, then you can inject the connection string that way.
  12. Ilya Finkelshteyn closed this discussion on 09 Oct, 2018 09:00 PM.

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