Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用MSBuild从powershell脚本生成代码_Msbuild - Fatal编程技术网

如何使用MSBuild从powershell脚本生成代码

如何使用MSBuild从powershell脚本生成代码,msbuild,Msbuild,我有一个PowerShell脚本,它根据我在cs项目中的资源文件生成一个分部类 我想在编译期间包括这个新文件 这是路吗?如果是这样的话,您可以通过修改.csproj文件以自动包含特定模式的文件来实现这一点,例如 <ItemGroup> <Compile Include="GeneratedPartialClasses\*.cs" /> </ItemGroup> 请注意,VisualStudio还将加载这些文件作为项目的一部分,因此您可能需要小心,以免

我有一个PowerShell脚本,它根据我在cs项目中的资源文件生成一个分部类

我想在编译期间包括这个新文件


这是路吗?如果是这样的话,您可以通过修改.csproj文件以自动包含特定模式的文件来实现这一点,例如

<ItemGroup>
  <Compile Include="GeneratedPartialClasses\*.cs" />
</ItemGroup>

请注意,VisualStudio还将加载这些文件作为项目的一部分,因此您可能需要小心,以免意外地将这些生成的文件签入到源代码管理中