-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime error after add reference from xproj web app (netcoreapp) to PCL csproj with project.json (netstandard) #6050
Comments
@balachir I can't restore this. Is the repro project missing a NuGet.config? I think this may be working for you because you have the packages in your local cache already. And by working, I mean restoring. |
Try this NuGet.Config
|
Yes you can probably try the NuGet.config that Sridhar provided. The templates in Visual Studio by default do not lay down a NuGet.config. I can also share the repro machine if you need. |
I worked offline with Livar on this and he can repro now on his machine with a new project. He's going to continue investigating. |
Ok, I managed to repro this and I know why this happens. When VS created the library project, instead of creating it under the src folder (even though I explicitly right-clicked the folder and choose add new project), it is creating it in the solution folder on the same level as the src folder. The global.json file has as sources only the src and test folders. When it gets converted to a net core project and we add a reference to it, we can't really find it because it is not under one of the folder where we look for dependencies. For this issue we have two alternatives:
I would say both things should happen depending on what the user does. Also, when we convert the library to core, it is using the wrong version in the netstandard.library dependency. It uses 1.0.0-rc2-23910, which fails restore. It worked for me with 1.5.0-rc2-24027. |
Also, I don't know why restore does not fail in VS for this. I was told that it is calling NuGet directly, so this may be another problem, but when I run dotnet restore with having the project under source and without having "." in the global.json, restore fails for me for the ConsoleApp. I don't think this is an issue with the CLI at this point. |
Latest offline investigation seems to indicate this is a CLI issue. |
Just tried it with 1.0.0-preview2-002804 , dll of the csproj is copied , but not a pdb file. Debugging will be broken. |
@pakrym can you take a look? |
@piotrpMSFT: |
well, related or not, scenario is still not working as expected, i.e. debug would be broken and users expect pdbs to be copied along with project dlls. |
Unassigning from @pakrym as it's not directly related to his original fix. Is there another engineer that can take this over? |
I fixed it at tooling side after discussing it with Mihai and David via email. |
Steps to reproduce
Dev14 U2 + DotNetCore RC2 Tooling Preview1 (includes DotNetCli 1.0.0-rc2-002673) + Dev14 micro-update + Nuget 3.5-beta
-- defaults to netstandard1.2
Actual behavior
Solution builds successfully. But following error at runtime. The PortableClassLibrary1.dll is not getting copied over to bin folder of ConsoleAppOnCore1.
Repro project :
P2PXprojToCsproj1.zip
Expected behavior
Ctrl-F5 to work successfully
The text was updated successfully, but these errors were encountered: