dotnet / dotnet/msbuild

Copy task can't copy symlink to directory

Open
#6,821 5 comments 2 reactions 0 assignees View on GitHub
bug needs-design Partner request symlink triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Repro:

[symlinks-9c50e79.zip](https://github.com/dotnet/msbuild/files/7117692/symlinks-9c50e79.zip)

Download, extract and run "make sucess" or "make fail" depending on what you want to test.

I'm trying to copy a symlink that points to a directory. That fails with:

> /Users/rolf/test/msbuild-tests/symlinks/test.proj(8,9): error MSB3025: The source file "source/symlink2" is actually a directory. The "Copy" task does not support copying directories.

Now I remove the directory the symlink points to (so that the symlink points to nowhere).

This rather strangely works just fine.

The problem seems to be that the Copy task doesn't consider symlinks as files when they point to a directory.

Binlogs:
[binlogs.zip](https://github.com/dotnet/msbuild/files/7117696/binlogs.zip)

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.