Rider fails to publish using valid .pubxml from VS 2022

I have several valid .pubxml files that I have used for months to publish from Visual Studio 2022. I recently started working in Rider 2023.1 and have faced this error when attempting to publish:

 Microsoft.PackageDependencyResolution.targets(266, 5): [NETSDK1047] Assets file 'C:\Users\{redacted}\source\repos\{redacted}\{redacted}\obj\project.assets.json' doesn't have a target for 'net6.0/win-x64'. Ensure that restore has run and that you have included 'net6.0' in the TargetFrameworks for your project. You may also need to include 'win-x64' in your project's RuntimeIdentifiers.

The same occurs with .NET 7 projects. The suggested workaround of adding a runtime identifier to the .csproj fixes the issue:

However, it seems odd to me that VS has no problem publishing, while Rider fails. Is this an issue with Rider, or something else?
Hello, Thank you for contacting Rider support. We are sorry to hear that you have run into such a problem. Would you mind sharing the sample .pubxml file so that we could take a deeper look? Have a nice day!

Sure thing!

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
Hello Rnielsen, Thank you for the file shared. I was able to reproduce this behavior. This is a known issue: Cannot publish solution previously created in VS: https://youtrack.jetbrains.com/issue/RIDER-93216; I updated the issue with your scenario. We would appreciate it if you could upvote this issue to bring additional awareness to it. While it is not fixed, the only options are: 1) To have RunIdentifier property set in csproj; 2) To publish via VS. Apologies for the inconvenience. Should you have any other questions or difficulties, please let me know. Have a nice day!

Please sign in to leave a comment.