使MSBuild输出文件可见

时间:2018-01-19 18:16:57

标签: visual-studio msbuild code-generation

有哪种方法可以让MSBuild的输出文件在项目树(Solution Explorer)中可见?

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="MyTarget" BeforeTargets="BeforeCompile">
    <MyTask
      InputFiles="@(None)">
      <Output ItemName="Generated" TaskParameter="GeneratedCodeFiles" />
    </MyTaskTask>
    <ItemGroup>
      <Compile Include="@(Generated)">
        <InProject>True</InProject>
        <Visible>True</Visible>
      </Compile>
      <FileWrites Include="@(Generated)" />
    </ItemGroup>
  </Target>
</Project>

0 个答案:

没有答案