-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Post build variables empty when executing "Publish" #1987
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
Comments
This is likely a dup of #677. Can you try replacing your post build event with a Target? Also, below is a exert from dotnet/msbuild#2743
|
I don't know it its a dup of #677. The error here occurs when publishing a solution. So publishing in conjunction with post build events with variables is not possible.
This is a joke, right? Is this the official position of Microsoft? If yes why are sln files still included in project templates? |
you could also do <ItemGroup>
<Content Include="..\src\ABC\**"
CopyToOutputDirectory="PreserveNewest"
CopyToPublishDirectory="PreserveNewest" />
</ItemGroup> instead of the post build event. That way it even works cross-platform ( |
@dasMulli Thanks a lot! I didn't know about that. This solved it for me. |
ITNOA How to find solution dir with new msbuild? |
* Update dependencies from https://github.com/dotnet/runtime build 20231020.16 Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.Logging From Version 8.0.0-rtm.23517.16 -> To Version 8.0.0-rtm.23520.16 * Update dependencies from https://github.com/dotnet/runtime build 20231023.12 Microsoft.Bcl.AsyncInterfaces , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.Logging From Version 8.0.0-rtm.23517.16 -> To Version 8.0.0 * Stabilize package version * Remove package source mapping * Update Version.Details.xml * Update azure-pipelines-official.yml --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Jan Jones <[email protected]> Co-authored-by: Viktor Hofer <[email protected]>
Hi,
a working post build event is not working when publishing the project because$(SolutionDir) and $ (TargetDir) are empty.
Project file:
Error:
The command "xcopy /D /Y "src\ABC\*.*" " exited with code 4.
Exception:
The text was updated successfully, but these errors were encountered: