-
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
Filtering CopyLocalLockFileAssemblies #933
Comments
As noted in dsplaisted@13989f1, it is now necessary for The reason for this is that with #1618, conflict resolution now depends on TargetFrameworkDirectory property, and the GetReferenceAssemblyPaths target to set it. However, the custom FilterCopyLocal target in our projects was causing GetReferenceAssemblyPaths to run before GetFrameworkPaths, and when GetFrameworkPaths was subsequently run, it reset the TargetFrameworkDirectory property to v4.0.30319. |
This commit implements some of the unification of the `dotnet build` and `dotnet publish` experiences. For 3.0 targeted projects, `dotnet build` will now copy the package dependencies locally into the output directory instead of relying on the NuGet cache. It behaves the same as `dotnet publish`, only copying what is not provided by the shared frameworks. Additionally, `dotnet publish` will now copy the build outputs rather than regenerating a deps file or resolving package dependencies, provided there are no package references excluded from publishing or packages are coming from a runtime store. The `CopyLocalLockFileAssemblies` property can be set to `false` to revert to the previous behavior for `dotnet build`. Fixes dotnet/cli#10061. Fixes dotnet#933.
This commit implements some of the unification of the `dotnet build` and `dotnet publish` experiences. For 3.0 targeted projects, `dotnet build` will now copy the package dependencies locally into the output directory instead of relying on the NuGet cache. It behaves the same as `dotnet publish`, only copying what is not provided by the shared frameworks. Additionally, `dotnet publish` will now copy the build outputs rather than regenerating a deps file or resolving package dependencies, provided there are no package references excluded from publishing or packages are coming from a runtime store. The `CopyLocalLockFileAssemblies` property can be set to `false` to revert to the previous behavior for `dotnet build`. Fixes dotnet/cli#10061. Fixes dotnet#933.
This commit implements some of the unification of the `dotnet build` and `dotnet publish` experiences. For 3.0 targeted projects, `dotnet build` will now copy the package dependencies locally into the output directory instead of relying on the NuGet cache. It behaves the same as `dotnet publish`, only copying what is not provided by the shared frameworks. Additionally, `dotnet publish` will now copy the build outputs rather than regenerating a deps file or resolving package dependencies, provided there are no package references excluded from publishing or packages are coming from a runtime store. The `CopyLocalLockFileAssemblies` property can be set to `false` to revert to the previous behavior for `dotnet build`. Fixes dotnet/cli#10061. Fixes dotnet#933.
@peterhuene Is the milestone on this issue correct? When/how can I take advantage of this? |
With a 3.0 SDK (including preview7 that came out today), we're now copying the assets locally for build like we would for a publish. It should happen automatically (can be opted out of with setting |
there are a lot of word... are you saying when u use true But let say A had a B dependency now B had C but now you say
it still include C is this issue to correct this or at least provide away of saying if you ignore the parent ignore all the childern of that parent |
@Seabizkit I haven't worked on this in a long time and I've forgotten all the details. I think you might be better off filing a new issue describing what you want to achieve and what is stopping you so that the current team can help you. |
When you use CopyLocalLockFileAssemblies with a netcoreapp project, it copies shared framework assets too.
While you can use publish instead to copy without those assemblies, there are circumstances where its more practical and efficient to just have the single build step. In particular pack is driven by build output not publish output. Consider the case where I want to flatten dependencies in a nupkg (e.g. as currently required to package msbuild tasks).
One way to address this would be to just have a flag to apply the same filtering as publish to CopyLocalLockFileAssemblies.
Alternatively, I find myself wishing that I could just slap metadata on my package references to exclude their full closure from CopyLocal. ExcludeAssets=Runtime almost works, but if I have another sibling package that pulls in overlapping assets in its closure, they get re-included.
In the msbuild task scenario, I really want to say "copy everything that is not in the closure of Microsoft.NETCore.App, Microsoft.Build.Framework, or Microsoft.Build.Utilities.Core"
I managed to get close enough to that with this workaround:
The text was updated successfully, but these errors were encountered: