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

copy_local: false has no effect in paket.references (.NET SDK) #3186

Closed
nightroman opened this issue May 6, 2018 · 8 comments
Closed

copy_local: false has no effect in paket.references (.NET SDK) #3186

nightroman opened this issue May 6, 2018 · 8 comments

Comments

@nightroman
Copy link

The issue is related to the recently resolved #3154

Use the same steps for reproducing the problem with one change:

  • do not use copy_local: false in paket.dependencies
  • instead, in paket.references use Suave copy_local: false

Expected result

On building the project Suave.dll is not copied to the output directory.

Actual result

Suave.dll is copied to the output directory.

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

I also have this problem. I have tried fiddling with paket.restore.targets, but I cannot make it work. I also cannot find any good documentation on what exactly the options for ExcludeAssets and PrivateAssets mean, and which of those that replaces the old copy local/private flag.

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

Seems like the <ExcludeAssets>runtime</ExcludeAssets> tag is not inserted into the obj/{project.file}.paket.props file even though the obj/{project.file}.%(Identity).paket.resolved says exclude in for the NuGets marked with copy_local.

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

The problem I have is using VS2017. It breaks this when it opens the project and generates all the obj folder contents.

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

The difference between setting copy_local: false in paket.dependencies and paket.references you can see in the generated {projectfilename}.paket.net462.resolved file in the obj folder:

  • set copy_local: false in paket.dependencies:
    FSharp.Core,4.5.2,Transitive,Main,exclude
    Suave,2.4.3,Direct,Main,exclude

  • set copy_local: false in paket.references:
    FSharp.Core,4.5.2,Transitive,Main,false
    Suave,2.4.3,Direct,Main,false

I would think that both should end up with exclude as the last element.

@atlemann
Copy link
Contributor

atlemann commented Sep 7, 2018

Seems like it's hard-coded to be copy_local: true in the references files (the 4th argument):

this.AddNuGetReference(groupName, packageName, false, true, true, true, ExplicitRestriction FrameworkRestriction.NoRestriction, false, false, false, None, null)

Although it does parse the references file first with copy_local settings and all. So not sure when this is called yet. Have to read more of the code first.

@Uriel6575
Copy link

It seems that it's broken again for .NET Core 3 Preview.
Here's an example folders. If you change TargetFramework to netcoreapp2.0 in the paket folder then NLog.dll won't be copied to bin. For netcoreapp3.0 it's copied. For standard folder it's not copied either way.

copy_local.zip

@forki
Copy link
Member

forki commented Apr 19, 2019

You mean core 3 breaks it? /cc @cartermp

@Uriel6575
Copy link

It's hard for me to tell what's the reason for it no to work anymore, but with preview 4 installed targeting to netcoreapp3.0 ignores copy_local option. While targeting netcoreapp2.0 don't.

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