1

I'm trying to publish a specific project which is part of a solution. Many of the projects in the solution have settings which depend on the $(SolutionDir) value, but this is not available when the command line only points to the .csproj file instead of the .sln

Is there a way to inject a value to be used as $(SolutionDir) in this case?

Andy
  • 3,631
  • 2
  • 23
  • 32
  • the other projects are class lib or other projects? – Opus Corpus Jan 19 '22 at 00:55
  • @OpusCorpus class libs referenced by the project – Andy Jan 19 '22 at 01:46
  • If it is WinForms, then you would have a UI layer that should have reference to all other layers, and publishing it would do it. – Opus Corpus Jan 20 '22 at 08:33
  • I don't think it matters what kind of project it is, because it has pre- and post build events which depend on $(SolutionDir). Obviously you can have more than one solution which includes the same project, so when you publish the project individually there is no concept of "solution folder". It would be nice if we could set it manually to a specific location. – Andy Jan 20 '22 at 11:35
  • 1
    Check https://stackoverflow.com/a/9298864/5243037 – MHolzmayr Aug 18 '22 at 05:28

0 Answers0