Hello,
Welcome to Microsoft Q&A!
Where I need to set RuntimeIdentifier platform 'win10-x64'
The problem should be that you select x86 platform target to replace default Any Cpu
. And this will cause RuntimeIdentifier x64 mismatch. The following is NETSdkError condition, you could navigate there by double clicking on the error message.
<NETSdkError Condition="'$(PlatformTarget)' != 'AnyCPU' and !$(RuntimeIdentifier.ToUpperInvariant().Contains($(PlatformTarget.ToUpperInvariant())))"
ResourceName="CannotHaveRuntimeIdentifierPlatformMismatchPlatformTarget"
FormatArguments="$(RuntimeIdentifier);$(PlatformTarget)" />
Please roll it back to AnyCPU
by selecting from solution platforms list.
Update
You could add a extra PlatformTarget condition, when you set PlatformTarget as x64 it will jump into the first logic, otherwise jump into sceond one.
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) and '$(Configuration)' == 'Debug' and $(PlatformTarget)=='x64'">
<Platforms>x64</Platforms>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) and '$(Configuration)' == 'Debug' and $(PlatformTarget)=='x86'">
<Platforms>x86</Platforms>
<RuntimeIdentifier>win10-x86</RuntimeIdentifier>
</PropertyGroup>
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.