-
Notifications
You must be signed in to change notification settings - Fork 253
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
Project references with ReferenceOutputAssembly=false should be ignored during VS restore #4992
Comments
From @hach-que on April 6, 2017 11:17 To clarify, we specify dependencies here because Both package restore and build for both these projects works fine in Visual Studio 2017, but doesn't work on the |
From @hach-que on April 6, 2017 11:31 For some reason, removing and re-adding the project dependencies in Visual Studio changed all the project type guids in the solution from |
From @hach-que on April 6, 2017 14:28 So I tried using ProjectReferences in the
(I also tried However, in .NET Core this doesn't due to the
Even though this kind of check isn't required because it isn't referencing the output assembly. The workaround is to make the library a .NET Core library instead of .NET Standard so that this check passes, but preferrably that should not be required. |
From @hach-que on April 6, 2017 15:4 So for anyone else running into this issue, this is what I ended up with. This allows you to have a .NET Core project whose source code files are generated from another .NET Core project in the same solution. <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" DependsOnTargets="ResolveProjectReferences">
<Exec Command="dotnet "$(SolutionDir)HiveMP.ClientGenerator/bin/$(Configuration)/netcoreapp1.1/HiveMP.ClientGenerator.dll" self-generate $(Configuration)" />
<ItemGroup>
<Compile Include="GeneratedClientApis\*" />
</ItemGroup>
</Target>
<ItemGroup>
<ProjectReferenceWithConfiguration Include="..\hivemp\HiveMP.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReferenceWithConfiguration>
<ProjectReferenceWithConfiguration Include="..\HiveMP.ClientGenerator\HiveMP.ClientGenerator.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReferenceWithConfiguration>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
</ItemGroup>
</Project> Important points are:
Hopefully this helps someone else in the same situation. |
Yeah, that's the one. Though that doesn't address the build-time issues I was having around framework checks (even if NuGet currently doesn't support |
What issues are you seeing with framework checks? |
When It means that you can't have a ProjectReference to a .NET Core console project from a .NET Standard project with |
@hach-que thanks for explaining it, I was able to repro this. From Visual Studio 2017 I verified when debugging this that I'm going to update the issue title to use this as tracking for the VS restore issue. Let me know if there is anything else that hasn't been covered yet by another issue. The build issue is covered here: dotnet/sdk#1096 //cc @alpaix |
dotnet restore
does not restore packages of projects with dependencies in .sln file…sual Studio restore Projects with ReferenceOutputAssembly=false should be ignored during restore in Visual Studio. Transitive dependencies should not flow from these projects to the parent project. Fixes NuGet/Home#4992
…sual Studio restore Projects with ReferenceOutputAssembly=false should be ignored during restore in Visual Studio. Transitive dependencies should not flow from these projects to the parent project. Fixes NuGet/Home#4992
We're still seeing this issue in a UWP project referencing a .NET Framework project with
|
From @hach-que on April 6, 2017 11:15
Steps to reproduce
dotnet restore
.Expected behavior
dotnet restore
should restore packages forHiveMP.Test.Framework
.obj
folder insideHiveMP.Test.Framework
withproject.assets.json
should exist.Actual behavior
dotnet restore
doesn't processHiveMP.Test.Framework
, packages aren't restored.Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#6258
The text was updated successfully, but these errors were encountered: