Standard build variables are not replaced in before/after build scripts.
@dsplaisted is already working on this.
Since May 15, 2017.
Assessment
This issue has not been assessed yet.
Description
Moving from https://github.com/dotnet/cli/issues/5095 on behalf of @mdekrey
Sorry if this isn't the right spot; I wasn't sure if the MSBuild repo was a better location for this report or not. Simplest steps are below, but I originally accessed this via Visual Studio, which gave menus for the "macro" variables that did not get replaced. Note that this occurs for both project variables, not just solution variables, as the example uses the dotnet cli.
Steps to reproduce
- Create a new project (
dotnet new) - Modify your
.csprojto have PreBuildEvent or PostBuildEvent that uses build variables as documented in previous C# projects. For example:
<PropertyGroup Label="Configuration">
<PreBuildEvent>echo $(OutDir)</PreBuildEvent>
<PostBuildEvent>echo $(OutDir)</PostBuildEvent>
</PropertyGroup>
- Restore packages. (
dotnet restore) - Build the project. (
dotnet build)
Expected behavior
Standard build variables should be replaced in before/after build scripts.
Microsoft (R) Build Engine version 15.1.458.808
Copyright (C) Microsoft Corporation. All rights reserved.
bin\Debug\netcoreapp1.0\
test -> C:\Users\Me\Source\test\bin\Debug\netcoreapp1.0\test.dll
bin\Debug\netcoreapp1.0\
Actual behavior
Standard build variables are not replaced in before/after build scripts.
Microsoft (R) Build Engine version 15.1.458.808
Copyright (C) Microsoft Corporation. All rights reserved.
ECHO is on.
test -> C:\Users\Me\Source\test\bin\Debug\netcoreapp1.0\test.dll
ECHO is on.
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.0-preview4-004233)
Product Information:
Version: 1.0.0-preview4-004233
Commit SHA-1 hash: 8cec61c6f7
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-preview4-004233
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 235
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/sdk
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Re-enable ItCanTestAMultiTFMProjectWithImplicitRestore after MSBuild revert (msbuild#14349) flows in Openuntriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Area-dotnetup untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100