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.

[dotnet build] Can't replace MVC packages with sources

See original GitHub issue

Steps to reproduce

Part of this verification task: aspnet/Release#10

Steps:

  1. Create web app project
  2. Clone https://github.com/aspnet/Mvc
  3. Add path to Mvc\src to global.json
  4. Restore (right-click project in Solution Explorer and click “Restore packages”) so VS sees new source refs (related: dotnet/sdk#4596)
  5. Build

Expected: my app should compile fine and I should be able to run it.

Actual: Severity Code Description Project File Line Suppression State Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.ViewFeatures\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.ViewFeatures.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.TagHelpers\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.TagHelpers.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Razor.Host\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Razor.Host.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Razor\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Razor.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Localization\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Localization.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Formatters.Json\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Formatters.Json.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.DataAnnotations\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.DataAnnotations.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Cors\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Cors.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Core\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.Core.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.ApiExplorer\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.ApiExplorer.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc.Abstractions\bin\Debug\netstandard1.3\Microsoft.AspNetCore.Mvc.Abstractions.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241 Error c:\users\cesars\documents\visual studio 2015\Projects\VerifyReplacePackagesWithSources\src\VerifyReplacePackagesWithSources\error CS0006: Metadata file ‘D:\src\aspnet\Mvc\src\Microsoft.AspNetCore.Mvc\bin\Debug\netstandard1.5\Microsoft.AspNetCore.Mvc.dll’ could not be found VerifyReplacePackagesWithSources C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets 241

Expected behavior

Find binaries in correct place.

Actual behavior

It’s looking for MVC binaries in the wrong places.

Environment data

dotnet --info output:

C:\Windows\system32>dotnet --info .NET Command Line Tools (1.0.0-rc2-002678)

Product Information: Version: 1.0.0-rc2-002678 Commit Sha: 3b2ea9d14b

Runtime Environment: OS Name: Windows OS Version: 10.0.10586 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
abpiskunovcommented, May 10, 2016

I am a bit surprised why that matters and why you don’t “just try to do it”… I tried this repro steps as they were assigned to a bug for my team and was able to repro it within 5 mins, but extra questions in this issue postponed investigation for 1 extra day already. I am not trying to be a “smart ass”, but really it is just a pattern I noticed for some cli issues… Below is my global.json and as you would see that you could just do same thing without me yesterday, there not many choices how to specify folder and it does not matter for actual problem in this issue …

Here is my global.json:

{ “projects”: [ “src”, “test”, “D:\git\ms\aspnet\Mvc\src” ] }

4reactions
kspearrincommented, May 26, 2016

I’m having this same problem now. I used to do this app the time with my rc1 aspnet app. Getting same errors as @abpiskunov now with RC2.

Anyone have a workaround?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to find package . No packages exist with this id in ...
My Solution was From Visual Studio Main menu: Tools=>Options=>Nuget Package Manager=>Click On Package Sources. Now add following Package ...
Read more >
Troubleshooting NuGet Package Restore in Visual Studio
This article focuses on common errors when restoring packages and steps to resolve them. Package Restore tries to install all package ...
Read more >
Package manager cannot find package in offline resources
Open Visual Studio, go to "Debug" --> "Options.." · Search for "Nuget Package Manager" --> General · Click on "Clear All Nuget Cache(s)"...
Read more >
dotnet restore command - .NET CLI
NET CLI to build and run the application. ... Specifies the URI of the NuGet package source to use during the restore operation....
Read more >
Install and manage NuGet packages with the dotnet CLI
See how to use the dotnet CLI to install, list, remove, and update NuGet packages. ... Use the following command to install a...
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