1

This Stack Overflow question has many answer for automatically increase the assembly version number in Visual Studio project.

But when comes to .NET Standard class library project it doesn't has a AssemblyInfo.cs file.

enter image description here

So how can I increase the assembly version number in .NET Standard Project?

Community
  • 1
  • 1
Rahul
  • 2,431
  • 3
  • 35
  • 77
  • The `[assembly: AssemblyVersion("1.0.*")]` can go into any file - what happens if you just put it at the top of one of your normal .cs files? – Wai Ha Lee Apr 29 '17 at 13:14
  • @WaiHaLee I tried your suggestion. Getting syntext error: "Duplicate AssemblyVersion attribute". I did a text search, but no files has AssemblyVersion decorated. – Rahul Apr 29 '17 at 13:43
  • @Rahul the assembly attribute is generated in the obj folder, build the project and click the error will take you to that file. I think the current version of compiler does not recognise the technique of wild card yet. – kennyzx Apr 29 '17 at 13:54
  • VS2017 solves a problem that, I think, nobody ever once realized they had. Some odds that they'll remove it again as long as enough programmers complain about it. Still, [AssemblyVersion] is a very big deal and auto-incrementing it is a very bad idea. Just use Help > Send Feedback > Provide a Suggestion, post the link here and when enough SO users agree then you'll be happier. – Hans Passant Apr 29 '17 at 13:56
  • @HansPassant I have created a community request as you suggested:https://developercommunity.visualstudio.com/content/problem/50409/increase-assembly-version-number-in-net-standard-c.html – Rahul Apr 29 '17 at 14:54

1 Answers1

0

In VS2017, the version of the assembly can be set in project properties -> Package tab, but there is no way to automatically increment the version number at each build, have to set it manually.

kennyzx
  • 12,845
  • 6
  • 39
  • 83