.NET Core SDK 版本是 1.0.0-preview4-004079,运行 dotnet publish 时出现如下的错误:
/root/.nuget/packages/microsoft.net.sdk/1.0.0-alpha-20161104-2/build/Microsoft.NET.Publish.targets(98,5): error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 2 item(s). They must have the same number of items.
.csproj 文件是通过 dotnet migrate 命令从 project.json 文件转换过来的。
Microsoft.NET.Publish.targets 文件中98行内容如下:
<Copy SourceFiles = "@(_ResolvedFileToPublishPreserveNewest)" DestinationFiles="$(PublishDir)%(_ResolvedFileToPublishPreserveNewest.RelativePath)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)" UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">