1
我希望在构建完成后将MyDir(在我的$ ProjectDir中)复制到$ OutDir {ProductVersion}。是否可以在产品版本发布后生成事件?
在csproj文件中使用以下配置我能够获取文件版本。
<Target Name="AfterBuild">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
</GetAssemblyIdentity>
<Exec Command="robocopy $(ProjectDir)MyDir $(OutDir)/%(AssemblyVersion.Version) /E" IgnoreExitCode="true" />
</Target>
然而,这个检索FileVersion而不是ProductVersion。有什么方法可以在后期构建事件中获得ProductVersion?