如何仅为win-x64设置运行时标识符



使用VS Community 2022,如何仅为win-64目标构建项目?

每次构建时,VS都会创建多个运行时目录(linux、osx等(。

我试图在vbproj文件中添加CCD_ 1,但我得到了一个错误:";";HasTrailingFlash";函数只接受标量值&";。

这是我的vbproj文件(第一行(:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>MyProjectName</RootNamespace>
<StartupObject>MyProjectName.frmStart</StartupObject>
<UseWindowsForms>true</UseWindowsForms>
<MyType>WindowsForms</MyType>
<Platforms>x64</Platforms>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resourcesimagesmy_icon.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath></OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

解决方案是添加这两行。

<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>

最新更新