Skip to content
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

Error referencing Sdk project from desktop project #1087

Closed
jaredpar opened this issue Apr 6, 2017 · 8 comments
Closed

Error referencing Sdk project from desktop project #1087

jaredpar opened this issue Apr 6, 2017 · 8 comments

Comments

@jaredpar
Copy link
Member

jaredpar commented Apr 6, 2017

Working on migrating dotnet/roslyn to the new SDK. One pattern that comes up frequently in the conversion is having a desktop 4.6 console application referencing a netstandard 1.3 class library. This seems pretty straight forward and restore for these projects works fine. But when we attempt to build we end up with the following error message:

c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(197,5): error : The project.json is referenci ng the project 'E:\code\roslyn\Binaries\Obj\Core\Portable\CodeAnalysis.csproj', but an output path was not specified on an item in the ProjectReferencesCreatingPackages property. [E:\code\roslyn\src\Compilers\CSharp\Csc\csc.csproj]

This error message is doubly odd because there are no project.json elements involved. The library projects are all netstandard 1.3 SDK projects and the desktop projects are converted to use PackageReference. Hence project.json should not be involved.

Repo steps:

  1. Clone https://github.com/jaredpar/roslyn
  2. Sync to branch repo/sdk1
  3. Run msbuild /t:Restore build\BaseToolset\BaseToolset.csproj
  4. Run msbuild /t:Restore Compilers.sln
  5. Run msbuild /v:m src\Compilers\CSharp\csc\csc.csproj
@jaredpar jaredpar changed the title Error referencing Sdk project for desktop project Error referencing Sdk project from desktop project Apr 6, 2017
@srivatsn
Copy link
Contributor

srivatsn commented Apr 6, 2017

@emgarten might know what's going on here. Are there any stale project.lock.json left from previous restores? May be try a git clean?

@jaredpar
Copy link
Member Author

jaredpar commented Apr 6, 2017

@srivatsn already tried a git clean -dxf .. Also verified I didn't accidentally check one any where (just in case). Still seeing this issue.

@emgarten
Copy link
Member

emgarten commented Apr 6, 2017

This is caused by NuGet/Home#4532 which should be fixed in 15.1 now.

The error message you are seeing is incorrect for referring to project.json in a PackageReference project. Updating this message is tracked here: NuGet/Home#4778

@jaredpar
Copy link
Member Author

jaredpar commented Apr 6, 2017

@emgarten can you clarify how this is a duplicate? The bug you linked to cites restore issues, this is a build issue. Restore works just fine.

@jaredpar
Copy link
Member Author

jaredpar commented Apr 6, 2017

@emgarten also we'd like to make progress on our work without having to wait for an official VS relesase. What are our options? Waiting for a new VS release for every bug fixs is a recipe for never being able to finish this conversion.

@emgarten
Copy link
Member

emgarten commented Apr 6, 2017

@jaredpar it is a build issue, the fix was to the build targets included with MSBuild that read project.assets.json.

15.1 is out, I don't think there is anything unreleased for this yet. The issue also contains workarounds from users and a package that can be included that fixes this.

@jaredpar
Copy link
Member Author

jaredpar commented Apr 7, 2017

@emgarten sure 15.1 is out. But what about the next bug we hit in 15.1? Will I have to wait until 15.2 is out to make further progress?

@emgarten
Copy link
Member

emgarten commented Apr 7, 2017

@jaredpar you would likely be able to override the targets in your project to fix if it is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants