Different RID behavior for multitargeted restore in VS and command line
See original GitHub issueIf RuntimeIdentifer(s)
differ between inner builds, then VS will gather the properties from each inner build and send them on to restore whereas the command line restore target only reads them from the outer evaluation context.
Repro project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1</TargetFrameworks>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'netcoreapp1.0'">win7-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(TargetFramework)' == 'netcoreapp1.1'">win7-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>
Behavior in VS (and expected behavior)
Builds successfully
Behavior on command line (dotnet restore; dotnet build)
C:\...\Microsoft.NET.Sdk.targets(92,5): error : Assets file 'C:\...\ConsoleApp144\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v1.0/win7-x86'. Ensure you have restored this project for TargetFramework='netcoreapp1.0' and RuntimeIdentifier='win7-x86'. [C:\...\ConsoleApp144.csproj]
(and other related errors)
@emgarten @srivatsn @natidea This is causing issues for #847 in multi-targeted app case. I think the right fix would be in nuget restore targets to gather all RIDs from inner builds, but I think I can do that in SDK with a BeforeTargets=“Restore”
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
NuGet restore differs between VS and command line #6984
It seems that VS and command line restore are selecting different instances of the duplicated item.
Read more >dotnet publish command - .NET CLI
The dotnet publish command publishes a .NET project or solution to a directory.
Read more >How to disable session restore message in vscode terminal
This feature can be disabled using the following two lines. Open "settings" -> Enter these commands to revert the VSCode behavior.
Read more >Command line restore examples
This topic lists some examples of restore commands to use for specific tasks. ... restores the latest backup version, whether it is active...
Read more >windows 10 - How do I change "Open with Powershell" to " ...
Open regedit.exe, go to HKEY_CLASSES_ROOT\Directory\shell\cmd , take ownership of the key, add your user account full permissions and change ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This change looks good to me. Restore will read this union and apply it for all TFMs.
@emgarten Can you review efbcaca, which is incorporated in to the larger #847