NETSDK1032: RuntimeIdentifier ve PlatformTarget uyumlu olmalıdır
hata NETSDK1032
, win-x64
veya linux-x64
gibi RuntimeIdentifier
(RID) ile x64
veya x86
gibi PlatformTarget
arasında bir uyuşmazlık olduğunda oluşur. Tam hata iletisi aşağıdaki örneğe benzer:
'{RID}'
RuntimeIdentifier
platformu ve '{Target}'PlatformTarget
uyumlu olmalıdır.
RID, proje dosyasında veya komut satırında belirtilir. Belirtilmezse, kullanılan varsayılan RID Windows için win-x64
, Linux için linux-x64
ve macOS için osx-x64
'dir.
PlatformTarget
proje dosyasında veya komut satırında belirtilir. Belirtilmezse, varsayılan AnyCPU
olur.
Uyumsuz RID ve PlatformTarget
ayarlarına sahip bir .csproj
dosyası örneği aşağıda verilmişti:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
PlatformTarget
veya RuntimeIdentifier
değiştirerek önceki .csproj
dosyasını düzeltin. Örneğin, PlatformTarget
RID ile eşleşecek şekilde değiştirin:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
Veya RID'yi PlatformTarget
ile eşleşecek şekilde değiştirin:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
</Project>