How does the 'Package NuGet projects' feature work?

steven.liekens's Avatar

steven.liekens

18 Apr, 2015 03:19 PM

Hello,

I'd like to know how AppVeyor knows which projects it should pack when the 'Package NuGet projects' feature is enabled. I can't get it to work when I use a custom build script instead of using the .sln file to coordinate the build.

Here's an oversimplified example of my custom build script:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <Project Include="src\*.csproj" />
    </ItemGroup>
    <Target Name="Build">
        <MSBuild Targets="Build"
                 Projects="@(Project)"
                 Properties="Configuration=$(Configuration);Platform=$(Platform)" />
    </Target>
</Project>

The thing that you should take away from this is that I'm referencing projects dynamically using wildcards. Could that be the reason why AppVeyor won't execute nuget pack for my projects?

  1. Support Staff 1 Posted by Feodor Fitsner on 18 Apr, 2015 08:31 PM

    Feodor Fitsner's Avatar

    Yeah, there are some assumptions/limitations with automatic NuGet packaging:

    1. It works with .sln builds only when AppVeyor is able to list projects and their project folders.
    2. .nuspec file must have the same name as .*proj file and should be placed next to project file.
  2. 2 Posted by steven.liekens on 19 Apr, 2015 09:25 AM

    steven.liekens's Avatar

    So automatic packaging does actually require a solution file (sln)?

  3. Support Staff 3 Posted by Feodor Fitsner on 19 Apr, 2015 01:24 PM

    Feodor Fitsner's Avatar

    Correct.

    - Feodor

  4. 4 Posted by Steffen Wenz on 12 Nov, 2016 01:05 PM

    Steffen Wenz's Avatar

    Hi Fidor,

    currently I have the problem that no nuget package is packed in my open source project: https://ci.appveyor.com/project/SteffenWenz/n26

    Regards,
    Steffen

  5. 5 Posted by Ilya Finkelshte... on 13 Nov, 2016 10:36 AM

    Ilya Finkelshteyn's Avatar

    Hi Steffen,

    Please send us your appveyor.yml (use Settings > Export YAML if you use UI configuration).

    Thanks!
    --ilya.

  6. 6 Posted by Steffen Wenz on 13 Nov, 2016 11:54 AM

    Steffen Wenz's Avatar


    Ilya Finkelshteyn <[email blocked]> hat am 13. November 2016 um 11:36 geschrieben:

    // Please reply above this line
    ==================================================

    From: Ilya Finkelshteyn (Support staff)

    Hi Steffen,

    Please send us your appveyor.yml (use Settings > Export YAML if you use UI configuration).

    Thanks!
    --ilya.

    On Sat, Nov 12 at 05:05 AM PST, Steffen Wenz wrote:

    Hi Fidor,

    currently I have the problem that no nuget package is packed in my open source project: https://ci.appveyor.com/project/SteffenWenz/n26

    Regards,
    Steffen

    Having trouble reading this? View this discussion online: How does the 'Package NuGet projects' feature work?.

    Reply with #ignore to stop receiving notifications for this discussion.

  7. 7 Posted by Ilya Finkelshte... on 15 Nov, 2016 07:10 AM

    Ilya Finkelshteyn's Avatar

    Hi Steffen,

    Sorry for confusion. Currently built-in nuget packaging works only with classic solutions. For .NET Core please set the following:

    build:
      verbosity: minimal
    after_build:
    - ps: dotnet pack src\N26 -o .\Artifacts
    artifacts:
    - path: .\Artifacts\*
    

    Also if you want to deal conditionally with pre-release versions you may change after_build part to something like this:

    - ps: if ($env:APPVEYOR_REPO_TAG -eq $true) {dotnet pack src\N26 -o .\Artifacts} else {dotnet pack src\N26 -o .\Artifacts --version-suffix=$env:APPVEYOR_BUILD_NUMBER}
    

    Thank you,
    Ilya.

  8. 8 Posted by Steffen Wenz on 19 Nov, 2016 09:59 PM

    Steffen Wenz's Avatar

    Hi Ilya,

    thanks for the help, the packing is now working. Could you also help me with using the AssemblyInfo patching Feature with a .NET Core Projects?

    Thanks,

    Steffen

  9. 9 Posted by Ilya Finkelshte... on 20 Nov, 2016 04:13 AM

    Ilya Finkelshteyn's Avatar

    Sure :) Common problem is AssemblyInformationalVersion tag does not exist AssemblyInfo.cs file, therefore AppVeyor has nothing to patch, and then version in nuspec file has no value to substitute with. Please check this potential problem first.

    --ilya.

  10. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:09 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