Search code examples
c#nugetroslyn-code-analysisappveyor

Appveyor nuget analyser


I'm trying to invent good way to pack my Roslyn analyzer projects into NuGet. It requires specific NuGet package structure with .dll put into \analyzer\, not \lib\.

For this to work, I have to call nuget pack <name>.nuspec, not nuget pack <name>.csproj. But if I use nuspec, than $version$ tag gets ignored.

Seems that my only option is to manually update version in .nuspec on every rebuild. What is correct and right way to accomplish this?


Solution

  • Correct way is:

    1. Call nuget pack .nuspec from .csproj
    2. Pass Version extracted from Assembly as parameters.
    3. Make Appveyor update version on rebuild
    4. Configure Appveyor to capture .nupkg`s to artifacts and push it.

    See https://github.com/leotsarev/hardcode-analyzer as example