dotnet / NuGet.BuildTasks

The build tasks used to pick up package content from project.lock.json.
MIT License
45 stars 61 forks source link

Populate ReferenceSatellitePaths with Resources #39

Closed natidea closed 4 years ago

natidea commented 6 years ago

This is a proposed fix to missing satellite assemblies in the SatelliteDllsProjectOutputGroupDependencies when using PackageReference mode for NuGet dependencies (Bug 465204)

Since I'm not familiar with how this was intended to work, here are some concerns I can think of:

/cc @rohit21agrawal @emgarten @jasonmalinowski @nguerrera

emgarten commented 6 years ago

I'm not familiar with this area either, is there someone who is that can sign off on this?

rohit21agrawal commented 6 years ago

from what i can understand, it might be better if you set "Culture" metadata on the items being created here: https://github.com/NuGet/NuGet.BuildTasks/blob/18aedb7eb0fc26012246af61e4df7cda4ab10026/src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs#L782

and then check for the existence of culture metadata in the "ReferenceCopyLocalPaths" instead of destination sub directory.

nguerrera commented 6 years ago

@cdmihai @AndyGerlicher Can you help review this?

@natidea We need to check what happens in SDK-based projects as well. I think you said that the same problem was happening there, right? Is there a bug tracking that?

cdmihai commented 6 years ago

The question here is why isn't RAR finding these? Sounds like that should be the better fix.

Here's how RAR searches for the satellites: https://github.com/Microsoft/msbuild/blob/master/src/Tasks/AssemblyDependency/ReferenceTable.cs#L930-L947

cdmihai commented 6 years ago

Also, does this happen during a real build, or during a special design time build / restore build? I see that finding satellites is based on BuildingProject, and BuildingProject appears to be set only during real builds.

natidea commented 6 years ago

@cdmihai This scenario is for a real build from the command line.

One note is that all these satellites are apparently in the lock/asset file. So RAR searching for them may be redundant (which is why we speculated that RAR was avoiding this action on purpose). But if RAR is always supposed to find satellites, then we need to figure out why the file locations are different for packages.config and PackageReference-based projects

Pilchie commented 6 years ago

Pin @cdmihai and @AndyGerlicher - do we want to take this fix, or move the issue to msbuild?

nguerrera commented 6 years ago

I don't think that RAR can be the one to find satellites in the nuget case because of the ref/, lib/ split. Satellites to deploy aren't necessarily next to the assemblies passed to the compiler.

cdmihai commented 6 years ago

@nguerrera

I see. Is that why RAR isn't finding the satellites for the case this PR addresses? Is it because RAR sees the ref dlls, but the satellites are in lib?

If so, then we need to decide whether:

Pros for RAR:

Cons for RAR:

dmonroym commented 4 years ago

We've moved things around this repo. Please reopen this PR against master if you want us to take a look at this again.