What's correct way to setup NuGet analyzer package build
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?
There is a question on SO with upvotes, so it's probably worth to have public answer
https://stackoverflow.com/questions/43610749/appveyor-nuget-analyser
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

1 Posted by Leonid Tsarev on 22 May, 2017 08:56 AM
Hi, should I expect any answer?
Will it help if I paid for some time of premium account?
2 Posted by Ilya Finkelshte... on 22 May, 2017 05:33 PM
No need to pay :) We were not able to find quick solution for you. Will try one more time in day or two and will update you.
Ilya.
3 Posted by Leonid Tsarev on 25 May, 2017 11:06 AM
Ilya, any updates on this?
4 Posted by Ilya Finkelshte... on 25 May, 2017 05:00 PM
Hi Leonid,
I forked your repo and tried to make it work with
nuget pack <name>.nuspec, but without a luck. I believe that yes, you have to replace version on the fly with custom script inside.nuspecfile. Simple string replace can be done easily with PowerShell.Then you have to use custom
after_buildscript to runnuget pack <name>.nuspec, and also add your.nuspecfiles to artifacts.I still believe that it may exist a better way, but I just do not know it. Maybe you can reach nuget people on GitHub and ask them, how to make nuget to respect
$version$and substitute it with data from AssemblyInfo when you are callingnuget pack <name>.nuspecand not.csprojIlya.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:17 AM.