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
Find binaries in correct place.
It's looking for MVC binaries in the wrong places.
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
See related issue that was first opened for tooling: https://github.com/aspnet/Tooling-Internal/issues/530
@abpiskunov The related issue link seems broken.
It has, same info i added to new issue, i just copy pasted it.
Thanks,
Anton
On May 9, 2016, at 6:06 PM, Livar <[email protected]notifications@github.com> wrote:
@abpiskunovhttps://github.com/abpiskunov The related issue link seems broken.
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com/dotnet/cli/issues/2966#issuecomment-218004399
@abpiskunov Can you give more details about your files layouts? Where is your web app in relation to the mvc src? Also, where is your global.json? Is the root for your "solution" D:\src\aspnet?
Please follow repro steps with default vs options and you will get all layouts for files.
Thanks,
Anton
On May 9, 2016, at 6:22 PM, Livar <[email protected]notifications@github.com> wrote:
@abpiskunovhttps://github.com/abpiskunov Can you give more details about your files layouts? Where is your web app in relation to the mvc src? Also, where is your global.json? Is the root for your "solution" D:\src\aspnet?
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com/dotnet/cli/issues/2966#issuecomment-218007615
@abpiskunov can you make steps 2 & 3 more explicit? In what directory did you clone? what did you add to global.json and where [show full file]?
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" ]
}
@abpiskunov have you tried to escape your absolute path?
D:\\git\\ms\\aspnet\\Mvc\\src
I did not and it does not matter, all projects are found just fine and are being restored, built etc. However see at where "dotnet build" tries to find their binaries under RID subfolders bin\Debug\netstandard1.5, but they actually being built under artifacts.
So it does not matter how they are specified in global.json.
1 sec - when I pasted GitHub changed \ symbols , I did have escaped ones
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?
You can workaround the issue by modifying each of the sources projects .xproj by replace the line
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
with
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
@SeeWhat That didn't change anything for me. I've always had my .xproj
files updated for RC2 and still having the same problem.
@kspearrin Hi, Not your project files, but the project you want to debug against. So if you wanted to work debug/work with Microsoft.AspNetCore.Mvc.Abstractions
then you'd modify it's .xproj
file.
Not ideal, but a workaround.
:eyes:
I am having the same problem, can not build mvc from the sources. I have tried workaround mentioned by @SeeWhat, but didn't work for me.
@SeeWhat suggestion didn't work. The issue is the output paths which (for Identity) say
but my projects are
Changing the Identity XProj's to match my projects and rebuilding fixes the issue.
@DarrenV79 gave the right solution for me
Changing
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\</OutputPath>
to
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
fixes it for me.
In my case, I was working with Identity.
Apparently, this has to be done for all cascading dependencies.
For example, when trying to step into Microsoft.AspNetCore.Diagnostics, the OutputPath inside Microsoft.AspNetCore.Diagnostics.Abstractions.xproj had to be changed as well.
For all who have it, I had this issue trying to debug MVC as part of my app. I resolved it by running dotnet build -c Debug
in the src/Microsoft.AspNetCore.Mvc
folder. This causes a build, after that I was able to successfully build my own project.
My guess is that Visual Studio doesn't recognize the "added projects" via global.json as candidates for a project build.
We don't support this anymore. When using MSBuild, you need to be explicit about using a ProjectReference or a PackageReference. So, I am going to close this. If I misunderstood something, please, re-activate.
Most helpful comment
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" ]
}