Mat*_*yer 2 .net c# .net-core visual-studio-code
我刚刚在VS Code(C#,.NET Core)中启动了一个新项目.无论如何,我希望能够将我的项目目录中的文件复制到输出目录,就像我在visual studio中一样.但我也想根据我是否构建32位或64位来复制特定文件.
我环顾四周,但到目前为止,我已经学会了如何复制文件,无论我的构建配置如何.
小智 7
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x86' Or '$(RuntimeIdentifier)' == 'win-x64'">
<None Update="foo.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
<None Update="foo.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
脚步:
dotnet new console.csproj 像上面一样编辑文件.dotnet build -c Release -r win-x86foo.xml仅为x-64构建foo.txt复制,而为两个RID复制| 归档时间: |
|
| 查看次数: |
2983 次 |
| 最近记录: |