question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different RID behavior for multitargeted restore in VS and command line

See original GitHub issue

If 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:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
emgartencommented, Feb 16, 2017

@emgarten Can you review efbcaca, which is incorporated in to the larger #847

This change looks good to me. Restore will read this union and apply it for all TFMs.

1reaction
nguerreracommented, Feb 15, 2017

@emgarten Can you review efbcaca, which is incorporated in to the larger #847

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found