dotnet / dotnet/sdk

CopyLocalLockFileAssemblies causes MSB3030 when dependency contains culture-specific resources

Open
#50,462 2 comments 0 reactions 1 assignee Claimed by @nagilson View on GitHub
untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Issue Description

When `CopyLocalLockFileAssemblies` is used in a `netstandard2.0` or `net8.0` project with a dependency that contains culture-specific resources and a build target that references `@(ReferenceCopyLocalPaths)`, MSBuild attempts to copy files that do not exist and may not even be expected to exist.

### Steps to Reproduce

Create a project using this .csproj:

```xml


netstandard2.0
true







```

`Microsoft.CodeAnalysis.CSharp` isn't specifically important. It's merely an example of a dependency that contains culture-specific resources.

### Expected Behavior

Build succeeds.

### Actual Behavior

For each `bin/Debug/netstandard2.0/{culture}/`, MSBuild attempts to copy `obj/Debug/netstandard2.0/{culture}/{ProjectName}.resources.dll`, which does not exist.

### Analysis

It seems unexpected that MSBuild is attempting to copy `{ProjectName}.resources.dll` rather than `{DependencyName}.resources.dll`, but in any case, none of these files exist under `obj/`.

The error points to `Microsoft.Common.CurrentVersion.targets` line 4958. That's the line following the comment:

```xml


```

### Versions & Configurations

MSBuild version 17.11.38+901dc04e4 for .NET

Rider 2025.1 on Linux

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.