Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 macros show empty on build but not in macro selector

When I add a post build event to my project and try to use a macro in the Edit Post-Build ... section it shows the value of each macro

post build events

However when the build runs the value show blank

the following was generated using echo "The project path is:" $(ProjectPath) "end of path"

build output

any macro value I use seems to come up null

I am using the following csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard1.6</TargetFramework>
    <AssemblyName>Client</AssemblyName>
    <PackageId>Client</PackageId>
    <PackageTags>pkgname</PackageTags>
    <NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
    <PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
    <PostBuildEvent>
      echo on
      echo "The project path is:" $(ProjectPath) "end of path"
      dotnet pack $(ProjectPath)
    </PostBuildEvent>
  </PropertyGroup>


  <ItemGroup>
    <PackageReference Include="NoSQL" Version="1.0.4.3" />
  </ItemGroup>

</Project>

I have tried manually editing the csproj to no avail. a full path to the csproj in the post build event does work.

I have confirmed that this occurs on multiple machines running VS/15.0.0+26228.9

like image 765
Vinez Avatar asked Mar 14 '17 04:03

Vinez


1 Answers

This is an open issue for VS 2017 https://developercommunity.visualstudio.com/content/problem/25206/build-events-window-strips-out-macros-unce-saved.html

like image 63
Márton Balassa Avatar answered Sep 21 '22 17:09

Márton Balassa