Skip to content

SolutionDir variable not resolved during post build event #1777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
twenzel opened this issue Nov 30, 2017 · 3 comments
Closed

SolutionDir variable not resolved during post build event #1777

twenzel opened this issue Nov 30, 2017 · 3 comments
Assignees
Milestone

Comments

@twenzel
Copy link

twenzel commented Nov 30, 2017

This issue is similar to #677.

The $(SolutionDir) variable will not be resolved when using post build event and dotnet cli.
It works using VS2017.

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="xcopy &quot;$(SolutionDir)License\xy.xml&quot; $(TargetDir)" />
  </Target>

The $(TargetDir) variable will be resolved correctly.

@livarcocc
Copy link
Contributor

In the particular case of SolutionDir, I don't think this is set in the SDK, but rather by MSBuild.

@rainersigwald can you comment on this?

@livarcocc livarcocc added this to the Discussion milestone Jan 25, 2018
@livarcocc livarcocc self-assigned this Jan 25, 2018
@rainersigwald
Copy link
Member

How are you invoking the build using dotnet? MSBuild can only set $(SolutionDir) when you start the build at the solution level.

@livarcocc
Copy link
Contributor

Closing since we haven't had activity here in nearly a month. If you can answer the question above, we can re-activate this issue.

JL03-Yue pushed a commit that referenced this issue Mar 19, 2024
…1-6d8e36f6db99

[main] Update dependencies from dotnet/roslyn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants