diff --git a/Common.props b/Common.props index 105f94b33cbc..c81a8fe3c5d1 100644 --- a/Common.props +++ b/Common.props @@ -10,6 +10,10 @@ true + + true + 1.6.0 $(MSBuildThisFileDirectory) Debug diff --git a/DotnetCLIVersion.txt b/DotnetCLIVersion.txt index 8871aa662e80..d60d794a694b 100644 --- a/DotnetCLIVersion.txt +++ b/DotnetCLIVersion.txt @@ -1 +1 @@ -2.0.0-preview2-006189 +2.0.0-preview2-006457 diff --git a/TestAssets/TestProjects/CrossTargeting/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj b/TestAssets/TestProjects/CrossTargeting/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj index 35bfae790493..b3570c618409 100644 --- a/TestAssets/TestProjects/CrossTargeting/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj +++ b/TestAssets/TestProjects/CrossTargeting/NetStandardAndNetCoreApp/NetStandardAndNetCoreApp.csproj @@ -5,7 +5,7 @@ exe NETCOREAPP;$(DefineConstants) - dnxcore50 + dnxcore50 diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/Program.cs b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/Program.cs new file mode 100644 index 000000000000..b403a433796d --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Diagnostics; + +namespace TestApp +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine(TestLibrary.Helper.GetMessage()); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/TestApp.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/TestApp.csproj new file mode 100644 index 000000000000..6d4240b03c92 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestApp/TestApp.csproj @@ -0,0 +1,55 @@ + + + + + Debug + AnyCPU + 9a8d9cf9-379b-45c1-a95a-482ecb76a56c + Exe + Properties + $(MSBuildProjectName) + $(MSBuildProjectName) + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/Helper.cs b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/Helper.cs new file mode 100644 index 000000000000..8c643796b4b6 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/Helper.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace TestLibrary +{ + public static class Helper + { + /// + /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. + /// + /// A message + public static string GetMessage() + { + return "This string came from the test library!"; + } + + public static void SayHi() + { + Console.WriteLine("Hello there!"); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/TestLibrary.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/TestLibrary.csproj new file mode 100644 index 000000000000..1c5674373273 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-NonSDK/TestLibrary/TestLibrary.csproj @@ -0,0 +1,6 @@ + + + Library + netstandard2.0 + + \ No newline at end of file diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/Program.cs b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/Program.cs new file mode 100644 index 000000000000..b403a433796d --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Diagnostics; + +namespace TestApp +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine(TestLibrary.Helper.GetMessage()); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/TestApp.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/TestApp.csproj new file mode 100644 index 000000000000..62e1841dc8d7 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/TestApp.csproj @@ -0,0 +1,109 @@ + + + + + Debug + AnyCPU + 9a8d9cf9-379b-45c1-a95a-482ecb76a56c + Exe + Properties + $(MSBuildProjectName) + $(MSBuildProjectName) + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + $(NUGET_PACKAGES)\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + + + + $(NUGET_PACKAGES)\System.AppContext.4.3.0\lib\net46\System.AppContext.dll + + + + $(NUGET_PACKAGES)\System.Console.4.3.0\lib\net46\System.Console.dll + + + + $(NUGET_PACKAGES)\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + $(NUGET_PACKAGES)\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + + + $(NUGET_PACKAGES)\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + + + + $(NUGET_PACKAGES)\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + + + $(NUGET_PACKAGES)\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + + + $(NUGET_PACKAGES)\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + + + $(NUGET_PACKAGES)\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + + + $(NUGET_PACKAGES)\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + + + + $(NUGET_PACKAGES)\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + + + $(NUGET_PACKAGES)\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + + + $(NUGET_PACKAGES)\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + $(NUGET_PACKAGES)\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + $(NUGET_PACKAGES)\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + + + + + + + + $(NUGET_PACKAGES)\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + + + + + + + + + + diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/packages.config b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/packages.config new file mode 100644 index 000000000000..87075615d7c3 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestApp/packages.config @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/Helper.cs b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/Helper.cs new file mode 100644 index 000000000000..8c643796b4b6 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/Helper.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace TestLibrary +{ + public static class Helper + { + /// + /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. + /// + /// A message + public static string GetMessage() + { + return "This string came from the test library!"; + } + + public static void SayHi() + { + Console.WriteLine("Hello there!"); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/TestLibrary.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/TestLibrary.csproj new file mode 100644 index 000000000000..1c5674373273 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary-PackagesConfig/TestLibrary/TestLibrary.csproj @@ -0,0 +1,6 @@ + + + Library + netstandard2.0 + + \ No newline at end of file diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/Program.cs b/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/Program.cs new file mode 100644 index 000000000000..b403a433796d --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Diagnostics; + +namespace TestApp +{ + public class Program + { + public static void Main(string[] args) + { + Console.WriteLine(TestLibrary.Helper.GetMessage()); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/TestApp.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/TestApp.csproj new file mode 100644 index 000000000000..e79b0f3c8c45 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary/TestApp/TestApp.csproj @@ -0,0 +1,6 @@ + + + Exe + net461 + + \ No newline at end of file diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/Helper.cs b/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/Helper.cs new file mode 100644 index 000000000000..8c643796b4b6 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/Helper.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace TestLibrary +{ + public static class Helper + { + /// + /// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it. + /// + /// A message + public static string GetMessage() + { + return "This string came from the test library!"; + } + + public static void SayHi() + { + Console.WriteLine("Hello there!"); + } + } +} diff --git a/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/TestLibrary.csproj b/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/TestLibrary.csproj new file mode 100644 index 000000000000..1c5674373273 --- /dev/null +++ b/TestAssets/TestProjects/DesktopAppWithLibrary/TestLibrary/TestLibrary.csproj @@ -0,0 +1,6 @@ + + + Library + netstandard2.0 + + \ No newline at end of file diff --git a/TestAssets/TestProjects/KitchenSink/TestApp/TestApp.csproj b/TestAssets/TestProjects/KitchenSink/TestApp/TestApp.csproj index b481b7158b94..53b4d61022e4 100644 --- a/TestAssets/TestProjects/KitchenSink/TestApp/TestApp.csproj +++ b/TestAssets/TestProjects/KitchenSink/TestApp/TestApp.csproj @@ -3,7 +3,6 @@ Exe netcoreapp2.0 {C91F7F4C-47ED-4D1C-8990-B2E886B0FAD9} - portable-net45+wp8+win8+wpa false @@ -64,6 +63,6 @@ - + \ No newline at end of file diff --git a/TestAssets/TestProjects/LinkTest/LinkTest/LinkTest.csproj b/TestAssets/TestProjects/LinkTest/LinkTest/LinkTest.csproj index 800c6281bb47..cf8f6fcbae24 100644 --- a/TestAssets/TestProjects/LinkTest/LinkTest/LinkTest.csproj +++ b/TestAssets/TestProjects/LinkTest/LinkTest/LinkTest.csproj @@ -1,63 +1,61 @@ - - - - netstandard2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + netstandard2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TestAssets/TestProjects/NetCoreApp11WithP2P/App/App.csproj b/TestAssets/TestProjects/NetCoreApp11WithP2P/App/App.csproj index 52d29c8bf02b..72cdfe28603c 100644 --- a/TestAssets/TestProjects/NetCoreApp11WithP2P/App/App.csproj +++ b/TestAssets/TestProjects/NetCoreApp11WithP2P/App/App.csproj @@ -3,7 +3,7 @@ Exe netcoreapp1.1 - 1.1.0 + 1.1.2 diff --git a/TestAssets/TestProjects/TargetManifests/FluentAssertions.xml b/TestAssets/TestProjects/TargetManifests/FluentAssertion.xml similarity index 100% rename from TestAssets/TestProjects/TargetManifests/FluentAssertions.xml rename to TestAssets/TestProjects/TargetManifests/FluentAssertion.xml diff --git a/TestAssets/TestProjects/UwpUsingSdkExtras/Class1.cs b/TestAssets/TestProjects/UwpUsingSdkExtras/Class1.cs new file mode 100644 index 000000000000..747fffbdca56 --- /dev/null +++ b/TestAssets/TestProjects/UwpUsingSdkExtras/Class1.cs @@ -0,0 +1,11 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace UwpUsingSdkExtras +{ + public class Class1 + { + } +} diff --git a/TestAssets/TestProjects/UwpUsingSdkExtras/UwpUsingSdkExtras.csproj b/TestAssets/TestProjects/UwpUsingSdkExtras/UwpUsingSdkExtras.csproj new file mode 100644 index 000000000000..cb00e3bf5053 --- /dev/null +++ b/TestAssets/TestProjects/UwpUsingSdkExtras/UwpUsingSdkExtras.csproj @@ -0,0 +1,24 @@ + + + + netstandard2.0;uap10.0 + + + + + + + + + + + + + + + + <_ExtrasMissingLangTargets>false + true + + + diff --git a/build.ps1 b/build.ps1 index 3ee92b6730fa..9b5e5fdb91cd 100644 --- a/build.ps1 +++ b/build.ps1 @@ -58,6 +58,14 @@ Invoke-WebRequest $DOTNET_INSTALL_SCRIPT_URL -OutFile "$env:DOTNET_INSTALL_DIR\d & "$env:DOTNET_INSTALL_DIR\dotnet-install.ps1" -Version $DotnetCLIVersion $dotnetInstallVerbosity if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } +# This is a hack to prevent this target from being imported twice. We want to import the one that is build in the repo. If anyone knows +# of a better way to do this, let licavalc known and I will immediatelly fix it. +$NETBuildExtensionsTargets = "$env:DOTNET_INSTALL_DIR\sdk\$DotnetCLIVersion\15.0\Microsoft.Common.targets\ImportAfter\Microsoft.NET.Build.Extensions.targets" +if (Test-Path $NETBuildExtensionsTargets) +{ + Remove-Item $NETBuildExtensionsTargets +} + # Install 1.0.4 shared framework if (!(Test-Path "$env:DOTNET_INSTALL_DIR\shared\Microsoft.NETCore.App\1.0.5")) { @@ -72,6 +80,14 @@ if (!(Test-Path "$env:DOTNET_INSTALL_DIR\shared\Microsoft.NETCore.App\1.1.2")) if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } } +# Download nuget.exe +if (!(Test-Path "$RepoRoot\.nuget")) +{ + mkdir "$RepoRoot\.nuget" | Out-Null + $NUGET_EXE_URL="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" + Invoke-WebRequest $NUGET_EXE_URL -OutFile "$RepoRoot\.nuget\nuget.exe" +} + # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 861ab87b8ce0..b5b4ff37aff8 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -10,9 +10,11 @@ 15.2.0-preview-000093-02 2.0.0-preview1-001960 2.0.0-preview1-001960 - 4.3.0-preview1-2500 + 4.3.0-preview3-4168 9.0.1 1.4.2 + 2.0.0-preview2-25405-01 + 0.2.0-beta-000042 diff --git a/build/Signing/SignToolConfig.json b/build/Signing/SignToolConfig.json index 4bd6f2ca465f..f1fe340db431 100644 --- a/build/Signing/SignToolConfig.json +++ b/build/Signing/SignToolConfig.json @@ -8,6 +8,10 @@ "Sdks/Microsoft.NET.Sdk/tools/netcoreapp1.0/*/Microsoft.NET.Build.Tasks.resources.dll", "Sdks/Microsoft.NET.Sdk/tools/net46/Microsoft.NET.Build.Tasks.dll", "Sdks/Microsoft.NET.Sdk/tools/net46/*/Microsoft.NET.Build.Tasks.resources.dll", + "Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/tools/netcoreapp1.0/Microsoft.NET.Build.Extensions.Tasks.dll", + "Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/tools/netcoreapp1.0/*/Microsoft.NET.Build.Extensions.Tasks.resources.dll", + "Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/tools/net46/Microsoft.NET.Build.Extensions.Tasks.dll", + "Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/tools/net46/*/Microsoft.NET.Build.Extensions.Tasks.resources.dll" ] } ] diff --git a/build/build.proj b/build/build.proj index 494395b62b7d..7794fe0bc835 100644 --- a/build/build.proj +++ b/build/build.proj @@ -16,9 +16,11 @@ + - + + diff --git a/netci.groovy b/netci.groovy index 7c0a85c61e47..9d296f0fb421 100644 --- a/netci.groovy +++ b/netci.groovy @@ -29,11 +29,11 @@ osList.each { os -> // Calculate the build command if (os == 'Windows_NT') { buildCommand = ".\\build.cmd -Configuration $config" - machineAffinity = 'latest-or-auto-dev15-rc' + machineAffinity = 'latest-dev15-3-preview1' } else if (os == 'Windows_NT_FullFramework') { buildCommand = ".\\build.cmd -Configuration $config -FullMSBuild" osBase = 'Windows_NT' - machineAffinity = 'latest-or-auto-dev15-rc' + machineAffinity = 'latest-dev15-3-preview1' } else { // Jenkins non-Ubuntu CI machines don't have docker buildCommand = "./build.sh --configuration $config" @@ -44,7 +44,7 @@ osList.each { os -> steps { if (osBase == 'Windows_NT') { // Batch - batchFile("""SET VS150COMNTOOLS=%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\ + batchFile("""SET VS150COMNTOOLS=%ProgramFiles(x86)%\\Microsoft Visual Studio\\Preview\\Enterprise\\Common7\\Tools\\ ${buildCommand}""") } else { diff --git a/sdk.sln b/sdk.sln index 653ce3062105..95f26eac60ad 100644 --- a/sdk.sln +++ b/sdk.sln @@ -1,7 +1,7 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26510.0 +VisualStudioVersion = 15.0.26531.4 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tasks", "Tasks", "{1FEED16D-E07D-47C1-BB4C-56CD9F42B53B}" EndProject @@ -59,6 +59,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Build.Tests", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Pack.Tests", "test\Microsoft.NET.Pack.Tests\Microsoft.NET.Pack.Tests.csproj", "{588516D7-96AD-4447-A1EB-244D737A3C87}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Build.Extensions.Tasks", "src\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj", "{88723307-6BFA-4CB5-A518-2FFD5F91B891}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Build.Extensions.Tasks.UnitTests", "src\Tasks\Microsoft.NET.Build.Extensions.Tasks.UnitTests\Microsoft.NET.Build.Extensions.Tasks.UnitTests.csproj", "{0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Restore.Tests", "test\Microsoft.NET.Restore.Tests\Microsoft.NET.Restore.Tests.csproj", "{73F52EAA-A435-4D7B-8E1E-F82E9A25BA98}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -93,6 +99,18 @@ Global {588516D7-96AD-4447-A1EB-244D737A3C87}.Debug|Any CPU.Build.0 = Debug|Any CPU {588516D7-96AD-4447-A1EB-244D737A3C87}.Release|Any CPU.ActiveCfg = Release|Any CPU {588516D7-96AD-4447-A1EB-244D737A3C87}.Release|Any CPU.Build.0 = Release|Any CPU + {88723307-6BFA-4CB5-A518-2FFD5F91B891}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88723307-6BFA-4CB5-A518-2FFD5F91B891}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88723307-6BFA-4CB5-A518-2FFD5F91B891}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88723307-6BFA-4CB5-A518-2FFD5F91B891}.Release|Any CPU.Build.0 = Release|Any CPU + {0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8}.Release|Any CPU.Build.0 = Release|Any CPU + {73F52EAA-A435-4D7B-8E1E-F82E9A25BA98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73F52EAA-A435-4D7B-8E1E-F82E9A25BA98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73F52EAA-A435-4D7B-8E1E-F82E9A25BA98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73F52EAA-A435-4D7B-8E1E-F82E9A25BA98}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -108,5 +126,8 @@ Global {0C1312C0-0A29-4EB2-8294-6D1C54D78F61} = {50A89C27-BA35-44B2-AC57-E54551791C64} {EC640B7E-332E-40A2-BB6E-5B7EC788F315} = {580D1AE7-AA8F-4912-8B76-105594E00B3B} {588516D7-96AD-4447-A1EB-244D737A3C87} = {580D1AE7-AA8F-4912-8B76-105594E00B3B} + {88723307-6BFA-4CB5-A518-2FFD5F91B891} = {1FEED16D-E07D-47C1-BB4C-56CD9F42B53B} + {0E11CA1E-D64F-48E9-BE86-B040D9E8EBF8} = {1FEED16D-E07D-47C1-BB4C-56CD9F42B53B} + {73F52EAA-A435-4D7B-8E1E-F82E9A25BA98} = {580D1AE7-AA8F-4912-8B76-105594E00B3B} EndGlobalSection EndGlobal diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.Designer.cs b/src/Tasks/Common/Resources/Strings.Designer.cs similarity index 90% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.Designer.cs rename to src/Tasks/Common/Resources/Strings.Designer.cs index 4505fe20ea87..8377cb9805d9 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.Designer.cs +++ b/src/Tasks/Common/Resources/Strings.Designer.cs @@ -80,7 +80,16 @@ internal static string AssetPreprocessorMustBeConfigured { } /// - /// Looks up a localized string similar to Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'.. + /// Looks up a localized string similar to Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers.. + /// + internal static string AssetsFileMissingRuntimeIdentifier { + get { + return ResourceManager.GetString("AssetsFileMissingRuntimeIdentifier", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project.. /// internal static string AssetsFileMissingTarget { get { @@ -134,7 +143,7 @@ internal static string CannotHaveSelfContainedWithoutRuntimeIdentifier { } /// - /// Looks up a localized string similar to Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly.. + /// Looks up a localized string similar to The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.. /// internal static string CannotInferTargetFrameworkIdentiferAndVersion { get { @@ -367,6 +376,15 @@ internal static string FolderAlreadyExists { } } + /// + /// Looks up a localized string similar to Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0}. + /// + internal static string GetDependsOnNETStandardFailedWithException { + get { + return ResourceManager.GetString("GetDependsOnNETStandardFailedWithException", resourceCulture); + } + } + /// /// Looks up a localized string similar to Package Root {0} was incorrectly given for Resolved library {1}. /// @@ -556,6 +574,24 @@ internal static string RuntimeIdentifierWasNotSpecified { } } + /// + /// Looks up a localized string similar to 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty.. + /// + internal static string SkippingAdditionalProbingPaths { + get { + return ResourceManager.GetString("SkippingAdditionalProbingPaths", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead.. + /// + internal static string TargetFrameworkWithSemicolon { + get { + return ResourceManager.GetString("TargetFrameworkWithSemicolon", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unable to find resolved path for '{0}'.. /// @@ -592,6 +628,15 @@ internal static string UnrecognizedPreprocessorToken { } } + /// + /// Looks up a localized string similar to The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK.. + /// + internal static string UnsupportedSDKVersionForNetStandard20 { + get { + return ResourceManager.GetString("UnsupportedSDKVersionForNetStandard20", resourceCulture); + } + } + /// /// Looks up a localized string similar to The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}.. /// diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx similarity index 91% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.resx rename to src/Tasks/Common/Resources/Strings.resx index b25f732d35c5..0ab8e8e6537f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -130,7 +130,7 @@ Assets file '{0}' not found. Run a NuGet package restore to generate this file. - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. Assets file path '{0}' is not rooted. Only full paths are supported. @@ -157,7 +157,7 @@ Unexpected file type for '{0}'. Type is both '{1}' and '{2}'. - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. Content item for '{0}' sets '{1}', but does not provide '{2}' or '{3}'. @@ -297,4 +297,19 @@ The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.cs.xlf rename to src/Tasks/Common/Resources/xlf/Strings.cs.xlf index dc1c5afc5332..d534522bd10f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Je potřeba zadat alespoň jednu možnou cílovou platformu @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Soubor prostředků {0} nemá cíl pro {1}. Ověřte, že jste projekt obnovili pro hodnoty TargetFramework={2} a RuntimeIdentifier={3}. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Soubor prostředků {0} nemá cíl pro {1}. Ověřte, že jste projekt obnovili pro hodnoty TargetFramework={2} a RuntimeIdentifier={3}. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Z údaje TargetFramework={0} nejde odvodit hodnota TargetFrameworkIdentifier ani hodnota TargetFrameworkVersion. Musí být výslovně zadané. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Z údaje TargetFramework={0} nejde odvodit hodnota TargetFrameworkIdentifier ani hodnota TargetFrameworkVersion. Musí být výslovně zadané. @@ -298,6 +297,36 @@ Při parsování manifestu platformy ze souboru {0} na řádku {1} došlo k chybě. {2} {3} bylo neplatné. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.de.xlf rename to src/Tasks/Common/Resources/xlf/Strings.de.xlf index 90872d02e175..df8d76c669ca 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Geben Sie mindestens ein mögliches Zielframework an. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Die Ressourcendatei "{0}" hat kein Ziel für "{1}". Vergewissern Sie sich, dass Sie dieses Projekt für das Zielframework "{2}" und die Laufzeit-ID "{3}" wiederhergestellt haben. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Die Ressourcendatei "{0}" hat kein Ziel für "{1}". Vergewissern Sie sich, dass Sie dieses Projekt für das Zielframework "{2}" und die Laufzeit-ID "{3}" wiederhergestellt haben. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - "TargetFrameworkIdentifier" und/oder "TargetFrameworkVersion" kann nicht von "TargetFramework='{0}'" abgeleitet werden. Sie müssen explizit angegeben werden. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + "TargetFrameworkIdentifier" und/oder "TargetFrameworkVersion" kann nicht von "TargetFramework='{0}'" abgeleitet werden. Sie müssen explizit angegeben werden. @@ -298,6 +297,36 @@ Fehler beim Analysieren von PlatformManifest von "{0}" Zeile {1}. {2} "{3}" war ungültig. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.es.xlf rename to src/Tasks/Common/Resources/xlf/Strings.es.xlf index 36d8760363b5..dc493f419980 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Debe especificarse al menos una plataforma de destino posible. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - El archivo de recursos '{0}' no tiene un destino para '{1}'. Asegúrese de que ha restaurado el proyecto para TargetFramework='{2}' y RuntimeIdentifier='{3}'. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + El archivo de recursos '{0}' no tiene un destino para '{1}'. Asegúrese de que ha restaurado el proyecto para TargetFramework='{2}' y RuntimeIdentifier='{3}'. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - No se puede inferir TargetFrameworkIdentifier y/o TargetFrameworkVersion de TargetFramework='{0}'. Deben especificarse de forma explícita. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + No se puede inferir TargetFrameworkIdentifier y/o TargetFrameworkVersion de TargetFramework='{0}'. Deben especificarse de forma explícita. @@ -298,6 +297,36 @@ Error al analizar PlatformManifest desde la línea "{0}" {1}. {2} "{3}" no era válido. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.fr.xlf rename to src/Tasks/Common/Resources/xlf/Strings.fr.xlf index d6c3e2199bdc..b9c2df98534f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Au moins un framework cible doit être spécifié. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Le fichier de composant '{0}' n'a pas de cible pour '{1}'. Vérifiez que vous avez restauré ce projet pour TargetFramework='{2}' et RuntimeIdentifier='{3}'. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Le fichier de composant '{0}' n'a pas de cible pour '{1}'. Vérifiez que vous avez restauré ce projet pour TargetFramework='{2}' et RuntimeIdentifier='{3}'. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Impossible de déduire TargetFrameworkIdentifier et/ou TargetFrameworkVersion à partir de TargetFramework='{0}'. Ils doivent être spécifiés explicitement. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Impossible de déduire TargetFrameworkIdentifier et/ou TargetFrameworkVersion à partir de TargetFramework='{0}'. Ils doivent être spécifiés explicitement. @@ -298,6 +297,36 @@ Erreur durant l'analyse de PlatformManifest à partir de la ligne '{0}' {1}. {2} '{3}' est non valide. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.it.xlf rename to src/Tasks/Common/Resources/xlf/Strings.it.xlf index 7ae79d86e247..8b26a76ff72f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. È necessario specificare almeno un framework di destinazione possibile. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Il file di risorse '{0}' non contiene una destinazione per '{1}'. Assicurarsi di aver ripristinato questo progetto per TargetFramework='{2}' e RuntimeIdentifier='{3}'. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Il file di risorse '{0}' non contiene una destinazione per '{1}'. Assicurarsi di aver ripristinato questo progetto per TargetFramework='{2}' e RuntimeIdentifier='{3}'. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Non è possibile dedurre TargetFrameworkIdentifier e/o TargetFrameworkVersion da TargetFramework='{0}'. Devono essere specificati in modo esplicito. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Non è possibile dedurre TargetFrameworkIdentifier e/o TargetFrameworkVersion da TargetFramework='{0}'. Devono essere specificati in modo esplicito. @@ -298,6 +297,36 @@ Si è verificato un errore durante l'analisi di PlatformManifest da '{0}' a riga {1}. Il valore {2} '{3}' non è valido. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ja.xlf rename to src/Tasks/Common/Resources/xlf/Strings.ja.xlf index a205a7b79859..abb116d63d12 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. 可能性のあるターゲット フレームワークを少なくとも 1 つ指定する必要があります。 @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - 資産ファイル '{0}' に '{1}' のターゲットがありません。TargetFramework='{2}' および RuntimeIdentifier='{3}' のこのプロジェクトを復元したことを確認してください。 + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + 資産ファイル '{0}' に '{1}' のターゲットがありません。TargetFramework='{2}' および RuntimeIdentifier='{3}' のこのプロジェクトを復元したことを確認してください。 @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - TargetFrameworkIdentifier または TargetFrameworkVersion あるいはその両方を TargetFramework='{0}' から推論できません。それらは明示的に指定する必要があります。 + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + TargetFrameworkIdentifier または TargetFrameworkVersion あるいはその両方を TargetFramework='{0}' から推論できません。それらは明示的に指定する必要があります。 @@ -298,6 +297,36 @@ '{0}' 行目の {1} から PlatformManifest を解析できませんでした。{2} '{3}' は無効でした。 + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ko.xlf rename to src/Tasks/Common/Resources/xlf/Strings.ko.xlf index 6d81be26c10d..e1a10f6a350b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. 가능한 대상 프레임워크를 하나 이상 지정해야 합니다. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - 자산 파일 '{0}'에 '{1}'의 대상이 없습니다. TargetFramework='{2}' 및 RuntimeIdentifier='{3}'에 대해 이 프로젝트를 복원했는지 확인하세요. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + 자산 파일 '{0}'에 '{1}'의 대상이 없습니다. TargetFramework='{2}' 및 RuntimeIdentifier='{3}'에 대해 이 프로젝트를 복원했는지 확인하세요. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - TargetFramework='{0}'에서 TargetFrameworkIdentifier 및/또는 TargetFrameworkVersion을 유추할 수 없습니다. 명시적으로 지정해야 합니다. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + TargetFramework='{0}'에서 TargetFrameworkIdentifier 및/또는 TargetFrameworkVersion을 유추할 수 없습니다. 명시적으로 지정해야 합니다. @@ -298,6 +297,36 @@ '{0}' 줄 {1}에서 PlatformManifest를 구문 분석하는 중 오류가 발생했습니다. {2} '{3}'이(가) 잘못되었습니다. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pl.xlf rename to src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 22a42d6606eb..64d2b36fd761 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Należy określić co najmniej jedną możliwą platformę docelową. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Plik zasobów „{0}” nie ma obiektu docelowego dla „{1}”. Upewnij się, że projekt został przywrócony dla elementu TargetFramework=„{2}” i RuntimeIdentifier=„{3}”. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Plik zasobów „{0}” nie ma obiektu docelowego dla „{1}”. Upewnij się, że projekt został przywrócony dla elementu TargetFramework=„{2}” i RuntimeIdentifier=„{3}”. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Nie można wywnioskować elementu TargetFrameworkIdentifier i/lub TargetFrameworkVersion z elementu TargetFramework=„{0}”. Należy jawnie je określić. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Nie można wywnioskować elementu TargetFrameworkIdentifier i/lub TargetFrameworkVersion z elementu TargetFramework=„{0}”. Należy jawnie je określić. @@ -298,6 +297,36 @@ Wystąpił błąd podczas analizowania elementu PlatformManifest w wierszu „{0}” {1}. Element {2} „{3}” jest nieprawidłowy. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pt-BR.xlf rename to src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index b23e7d9ba919..34d6e26b4221 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. É necessário especificar pelo menos uma estrutura de destino possível. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - O arquivo de ativos '{0}' não tem um destino para '{1}'. Certifique-se de ter restaurado esse projeto para TargetFramework='{2}' e RuntimeIdentifier='{3}'. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + O arquivo de ativos '{0}' não tem um destino para '{1}'. Certifique-se de ter restaurado esse projeto para TargetFramework='{2}' e RuntimeIdentifier='{3}'. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Não é possível inferir TargetFrameworkIdentifier e/ou TargetFrameworkVersion de TargetFramework='{0}'. Eles devem ser especificados explicitamente. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Não é possível inferir TargetFrameworkIdentifier e/ou TargetFrameworkVersion de TargetFramework='{0}'. Eles devem ser especificados explicitamente. @@ -298,6 +297,36 @@ Erro ao analisar PlatformManifest de '{0}', linha {1}. {2} '{3}' era inválido. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf similarity index 85% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ru.xlf rename to src/Tasks/Common/Resources/xlf/Strings.ru.xlf index 8fd98ac9f235..c310e75adade 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. Необходимо указать хотя бы одну целевую платформу. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - Файл ресурсов "{0}" не имеет целевого объекта для "{1}". Убедитесь, что выполнено восстановление этого проекта для TargetFramework="{2}" и RuntimeIdentifier="{3}". + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Файл ресурсов "{0}" не имеет целевого объекта для "{1}". Убедитесь, что выполнено восстановление этого проекта для TargetFramework="{2}" и RuntimeIdentifier="{3}". @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - Невозможно определить TargetFrameworkIdentifier и (или) TargetFrameworkVersion на основе TargetFramework="{0}". Они должны быть указаны явно. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + Невозможно определить TargetFrameworkIdentifier и (или) TargetFrameworkVersion на основе TargetFramework="{0}". Они должны быть указаны явно. @@ -298,6 +297,36 @@ Ошибка анализа PlatformManifest со строки "{0}" {1}. Недопустимый {2} "{3}". + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.tr.xlf rename to src/Tasks/Common/Resources/xlf/Strings.tr.xlf index fa8ba63c2afd..d5e6e2a251bb 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. En az bir olası hedef çerçeve belirtilmelidir. @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - '{0}' varlık dosyasında '{1}' için hedef yok. TargetFramework='{2}' ve RuntimeIdentifier='{3}' için bu projeyi geri yüklediğinizden emin olun. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + '{0}' varlık dosyasında '{1}' için hedef yok. TargetFramework='{2}' ve RuntimeIdentifier='{3}' için bu projeyi geri yüklediğinizden emin olun. @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - TargetFrameworkIdentifier ve/veya TargetFrameworkVersion, TargetFramework='{0}' içinden çıkarsanamıyor. Bunlar açıkça belirtilmelidir. + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + TargetFrameworkIdentifier ve/veya TargetFrameworkVersion, TargetFramework='{0}' içinden çıkarsanamıyor. Bunlar açıkça belirtilmelidir. @@ -298,6 +297,36 @@ '{0}' konumundaki {1} satırından PlatformManifest ayrıştırılırken hata oluştu. {2} '{3}' geçersizdi. + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf similarity index 83% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hans.xlf rename to src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index 4ffa1f07e00d..2ac747cdb397 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. 必须指定至少一个可能的目标框架。 @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - 资产文件“{0}”没有“{1}”的目标。确保已针对 TargetFramework=“{2}”和 RuntimeIdentifier=“{3}”还原此项目。 + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + 资产文件“{0}”没有“{1}”的目标。确保已针对 TargetFramework=“{2}”和 RuntimeIdentifier=“{3}”还原此项目。 @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - 无法从 TargetFramework=“{0}”推断 TargetFrameworkIdentifier 和/或 TargetFrameworkVersion。必须显式指定这两项。 + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + 无法从 TargetFramework=“{0}”推断 TargetFrameworkIdentifier 和/或 TargetFrameworkVersion。必须显式指定这两项。 @@ -298,6 +297,36 @@ 从“{0}”第 {1} 行处分析 PlatformManifest 时出错。{2} “{3}”无效。 + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf similarity index 83% rename from src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hant.xlf rename to src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index 86668abdef9c..a1706c4a4687 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -1,8 +1,7 @@  - + - At least one possible target framework must be specified. 必須指定至少一個可能的目標 Framework。 @@ -24,8 +23,8 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - 資產檔案 '{0}' 沒有 '{1}' 的目標。請確定您已還原此專案 (TargetFramework='{2}' 且 RuntimeIdentifier='{3}')。 + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + 資產檔案 '{0}' 沒有 '{1}' 的目標。請確定您已還原此專案 (TargetFramework='{2}' 且 RuntimeIdentifier='{3}')。 @@ -69,8 +68,8 @@ - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - 無法從 TargetFramework='{0}' 推斷 TargetFrameworkIdentifier 及/或 TargetFrameworkVersion。您必須明確加以指定。 + The TargetFramework value '{0}' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. + 無法從 TargetFramework='{0}' 推斷 TargetFrameworkIdentifier 及/或 TargetFrameworkVersion。您必須明確加以指定。 @@ -298,6 +297,36 @@ 從 '{0}' 行 {1} 剖析 PlatformManifest 時發生錯誤。{2} '{3}' 無效。 + + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + The current .NET SDK does not support targeting {0} {1}. Either target {0} {2} or lower, or use a version of the .NET SDK that supports {0} {1}. + + + + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. + + + + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + The TargetFramework value '{0}' is not valid. To multi-target, use the 'TargetFrameworks' property instead. + + + + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty. + + + + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0} + + + + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + The version of Microsoft.NET.Sdk used by this project is insufficient to support .NET Standard 2.0 which is required by this project's references. Please install version 2.0 or higher of the .NET Core SDK. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/BuildErrorException.cs b/src/Tasks/Common/src/BuildErrorException.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/BuildErrorException.cs rename to src/Tasks/Common/src/BuildErrorException.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ConflictItem.cs b/src/Tasks/Common/src/ConflictResolution/ConflictItem.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ConflictItem.cs rename to src/Tasks/Common/src/ConflictResolution/ConflictItem.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ConflictResolver.cs b/src/Tasks/Common/src/ConflictResolution/ConflictResolver.cs similarity index 99% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ConflictResolver.cs rename to src/Tasks/Common/src/ConflictResolution/ConflictResolver.cs index 0fedc03c3079..ad239f26ec2a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ConflictResolver.cs +++ b/src/Tasks/Common/src/ConflictResolution/ConflictResolver.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using Microsoft.NET.Build.Tasks; using Microsoft.Build.Utilities; using System; using System.Collections.Generic; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.cs b/src/Tasks/Common/src/ConflictResolution/FileUtilities.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.cs rename to src/Tasks/Common/src/ConflictResolution/FileUtilities.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.net45.cs b/src/Tasks/Common/src/ConflictResolution/FileUtilities.net45.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.net45.cs rename to src/Tasks/Common/src/ConflictResolution/FileUtilities.net45.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.netstandard.cs b/src/Tasks/Common/src/ConflictResolution/FileUtilities.netstandard.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/FileUtilities.netstandard.cs rename to src/Tasks/Common/src/ConflictResolution/FileUtilities.netstandard.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MSBuildUtilities.cs b/src/Tasks/Common/src/ConflictResolution/MSBuildUtilities.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MSBuildUtilities.cs rename to src/Tasks/Common/src/ConflictResolution/MSBuildUtilities.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MetadataNames.cs b/src/Tasks/Common/src/ConflictResolution/MetadataNames.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MetadataNames.cs rename to src/Tasks/Common/src/ConflictResolution/MetadataNames.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/PackageRank.cs b/src/Tasks/Common/src/ConflictResolution/PackageRank.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/PackageRank.cs rename to src/Tasks/Common/src/ConflictResolution/PackageRank.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/PlatformManifestReader.cs b/src/Tasks/Common/src/ConflictResolution/PlatformManifestReader.cs similarity index 99% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/PlatformManifestReader.cs rename to src/Tasks/Common/src/ConflictResolution/PlatformManifestReader.cs index 2412fc09dcd6..2ad0cc128dca 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/PlatformManifestReader.cs +++ b/src/Tasks/Common/src/ConflictResolution/PlatformManifestReader.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using Microsoft.NET.Build.Tasks; using Microsoft.Build.Utilities; using System; using System.Collections.Generic; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ResolvePackageFileConflicts.cs b/src/Tasks/Common/src/ConflictResolution/ResolvePackageFileConflicts.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ResolvePackageFileConflicts.cs rename to src/Tasks/Common/src/ConflictResolution/ResolvePackageFileConflicts.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/DiagnosticMessageSeverity.cs b/src/Tasks/Common/src/DiagnosticMessageSeverity.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/DiagnosticMessageSeverity.cs rename to src/Tasks/Common/src/DiagnosticMessageSeverity.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/DiagnosticsHelper.cs b/src/Tasks/Common/src/DiagnosticsHelper.cs similarity index 98% rename from src/Tasks/Microsoft.NET.Build.Tasks/DiagnosticsHelper.cs rename to src/Tasks/Common/src/DiagnosticsHelper.cs index c2c2ccd3ead1..51681ea51b7b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/DiagnosticsHelper.cs +++ b/src/Tasks/Common/src/DiagnosticsHelper.cs @@ -14,9 +14,9 @@ namespace Microsoft.NET.Build.Tasks internal sealed class DiagnosticsHelper { private readonly List _diagnosticMessages = new List(); - private readonly TaskLoggingHelper _log; + private readonly ILog _log; - public DiagnosticsHelper(TaskLoggingHelper log) + public DiagnosticsHelper(ILog log) { _log = log; } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ILog.cs b/src/Tasks/Common/src/ILog.cs similarity index 62% rename from src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ILog.cs rename to src/Tasks/Common/src/ILog.cs index 2fc6b390e071..57c3b7301169 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/ILog.cs +++ b/src/Tasks/Common/src/ILog.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Framework; -namespace Microsoft.NET.Build.Tasks.ConflictResolution +namespace Microsoft.NET.Build.Tasks { public enum LogImportance { @@ -81,5 +81,52 @@ public interface ILog // T:System.ArgumentNullException: // message is null. void LogWarning(string message, params object[] messageArgs); + + /// + /// Logs an error using the specified string and other error details. + /// + void LogError( + string subcategory, + string errorCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs); + + /// + /// Logs a warning using the specified string and other warning details. + /// + void LogWarning( + string subcategory, + string warningCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs); + + /// + /// Logs a message using the specified string and other message details. + /// + void LogMessage( + string subcategory, + string code, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + MessageImportance importance, + string message, + params object[] messageArgs); + } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.cs b/src/Tasks/Common/src/ItemUtilities.cs similarity index 88% rename from src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.cs rename to src/Tasks/Common/src/ItemUtilities.cs index 4b8a369a2b63..551a22f9b812 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.cs +++ b/src/Tasks/Common/src/ItemUtilities.cs @@ -3,14 +3,12 @@ using Microsoft.Build.Framework; using Microsoft.NET.Build.Tasks.ConflictResolution; -using NuGet.Packaging.Core; -using NuGet.Versioning; using System; using System.IO; namespace Microsoft.NET.Build.Tasks { - internal static class ItemUtilities + internal static partial class ItemUtilities { public static bool? GetBooleanMetadata(this ITaskItem item, string metadataName) { @@ -134,20 +132,5 @@ public static string GetTargetPath(ITaskItem item) return Path.GetFileName(sourcePath); } - - public static PackageIdentity GetPackageIdentity(ITaskItem item) - { - string packageName = item.GetMetadata(MetadataKeys.PackageName); - string packageVersion = item.GetMetadata(MetadataKeys.PackageVersion); - - if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(packageVersion)) - { - return null; - } - - return new PackageIdentity( - packageName, - NuGetVersion.Parse(packageVersion)); - } } } diff --git a/src/Tasks/Common/src/MSBuildLog.cs b/src/Tasks/Common/src/MSBuildLog.cs new file mode 100644 index 000000000000..4eb53a7481e6 --- /dev/null +++ b/src/Tasks/Common/src/MSBuildLog.cs @@ -0,0 +1,116 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.NET.Build.Tasks +{ + internal class MSBuildLog : ILog + { + private readonly TaskLoggingHelper _logger; + + public MSBuildLog(TaskLoggingHelper logger) + { + _logger = logger; + } + + public void LogError(string message, params object[] messageArgs) + { + _logger.LogError(message, messageArgs); + } + + public void LogMessage(string message, params object[] messageArgs) + { + _logger.LogMessage(message, messageArgs); + } + + public void LogMessage(LogImportance importance, string message, params object[] messageArgs) + { + _logger.LogMessage((MessageImportance)importance, message, messageArgs); + } + + public void LogWarning(string message, params object[] messageArgs) + { + _logger.LogWarning(message, messageArgs); + } + + public void LogError( + string subcategory, + string errorCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + _logger.LogError( + subcategory, + errorCode, + helpKeyword, + file, + lineNumber, + columnNumber, + endLineNumber, + endColumnNumber, + message, + messageArgs); + } + + public void LogWarning( + string subcategory, + string warningCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + _logger.LogWarning( + subcategory, + warningCode, + helpKeyword, + file, + lineNumber, + columnNumber, + endLineNumber, + endColumnNumber, + message, + messageArgs); + } + + public void LogMessage( + string subcategory, + string code, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + MessageImportance importance, + string message, + params object[] messageArgs) + { + _logger.LogMessage( + subcategory, + code, + helpKeyword, + file, + lineNumber, + columnNumber, + endLineNumber, + endColumnNumber, + importance, + message, + messageArgs); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/MetadataKeys.cs b/src/Tasks/Common/src/MetadataKeys.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Tasks/MetadataKeys.cs rename to src/Tasks/Common/src/MetadataKeys.cs diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/NETSdkError.cs b/src/Tasks/Common/src/NETSdkError.cs similarity index 84% rename from src/Tasks/Microsoft.NET.Build.Tasks/NETSdkError.cs rename to src/Tasks/Common/src/NETSdkError.cs index e838f172a969..188d0a1cbb6c 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/NETSdkError.cs +++ b/src/Tasks/Common/src/NETSdkError.cs @@ -2,8 +2,6 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.Build.Framework; -using Newtonsoft.Json; -using System; using System.Globalization; namespace Microsoft.NET.Build.Tasks @@ -11,7 +9,16 @@ namespace Microsoft.NET.Build.Tasks /// /// Provides a localizable mechanism for logging an error from the SDK targets. /// - public class NETSdkError : TaskBase + public class +#if EXTENSIONS + // This task source is shared with multiple task Dlls. Since both tasks + // may be loaded into the same project and each task accesses only resources + // in its own assembly they must have a unique name so-as not to clash. + NETBuildExtensionsError +#else + NETSdkError +#endif + : TaskBase { /// /// The name of the resource in Strings.resx that contains the desired error message. diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.cs b/src/Tasks/Common/src/NuGetUtils.cs similarity index 66% rename from src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.cs rename to src/Tasks/Common/src/NuGetUtils.cs index e96e7bd91bff..b8e42a35d3a4 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.cs +++ b/src/Tasks/Common/src/NuGetUtils.cs @@ -5,39 +5,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using NuGet.Frameworks; -using NuGet.Packaging.Core; -using NuGet.ProjectModel; namespace Microsoft.NET.Build.Tasks { - internal static class NuGetUtils + internal static partial class NuGetUtils { - public static bool IsPlaceholderFile(string path) - { - return string.Equals(Path.GetFileName(path), PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal); - } - - public static IEnumerable FilterPlaceHolderFiles(this IEnumerable files) - { - return files.Where(f => !IsPlaceholderFile(f.Path)); - } - - public static string GetLockFileLanguageName(string projectLanguage) - { - switch (projectLanguage) - { - case "C#": return "cs"; - case "F#": return "fs"; - default: return projectLanguage?.ToLowerInvariant(); - } - } - - public static NuGetFramework ParseFrameworkName(string frameworkName) - { - return frameworkName == null ? null : NuGetFramework.Parse(frameworkName); - } - /// /// Gets PackageId from sourcePath. /// diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/TaskBase.cs b/src/Tasks/Common/src/TaskBase.cs similarity index 81% rename from src/Tasks/Microsoft.NET.Build.Tasks/TaskBase.cs rename to src/Tasks/Common/src/TaskBase.cs index 3d270bbcaf36..65402765f349 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/TaskBase.cs +++ b/src/Tasks/Common/src/TaskBase.cs @@ -26,9 +26,18 @@ public ITaskItem[] DiagnosticMessages // no reason for outside classes to derive from this class. internal TaskBase() { - _diagnostics = new DiagnosticsHelper(Log); + _diagnostics = new DiagnosticsHelper(new MSBuildLog(Log)); } + #region Test Support + + internal TaskBase(ILog logger) + { + _diagnostics = new DiagnosticsHelper(logger ?? new MSBuildLog(Log)); + } + + #endregion + public override bool Execute() { try diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs new file mode 100644 index 000000000000..893c0634cce8 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs @@ -0,0 +1,152 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using FluentAssertions; +using Microsoft.Build.Framework; +using Microsoft.Extensions.DependencyModel; +using Xunit; +using Microsoft.NET.Build.Tasks.ConflictResolution; +using System.Linq; +using System.IO; + +namespace Microsoft.NET.Build.Tasks.UnitTests +{ + public class GivenAGetDependsOnNETStandardTask + { + [Fact] + public void CanCheckThisAssembly() + { + var thisAssemblyPath = typeof(GivenAGetDependsOnNETStandardTask).GetTypeInfo().Assembly.Location; + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] { new MockTaskItem() { ItemSpec = thisAssemblyPath } } + }; + task.Execute().Should().BeTrue(); + + // this test happens to compile against System.Runtime, update if the test TFM changes to netstandard2.x + task.DependsOnNETStandard.Should().BeFalse(); + } + + [Fact] + public void CanCheckThisAssemblyByHintPath() + { + var thisAssemblyPath = typeof(GivenAGetDependsOnNETStandardTask).GetTypeInfo().Assembly.Location; + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] + { + new MockTaskItem( + Path.GetFileNameWithoutExtension(thisAssemblyPath), + new Dictionary + { + {"HintPath", thisAssemblyPath } + }) + } + }; + task.Execute().Should().BeTrue(); + + // this test happens to compile against System.Runtime, update if the test TFM changes to netstandard2.x + task.DependsOnNETStandard.Should().BeFalse(); + } + + + [Fact] + public void ReturnsFalseForNonPE() + { + string testFile = $"testFile.{nameof(GivenAGetDependsOnNETStandardTask)}.{nameof(ReturnsFalseForNonPE)}.txt"; + try + { + File.WriteAllText(testFile, "test file"); + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] { new MockTaskItem() { ItemSpec = testFile } } + }; + // ensure that false is returned and no exception is thrown + task.Execute().Should().BeTrue(); + task.DependsOnNETStandard.Should().BeFalse(); + // warn for a non-PE file + ((MockBuildEngine)task.BuildEngine).Warnings.Count.Should().BeGreaterThan(0); + } + finally + { + File.Delete(testFile); + } + } + + [Fact] + public void ReturnsFalseForNativeLibrary() + { + var corelibLocation = typeof(object).GetTypeInfo().Assembly.Location; + var corelibFolder = Path.GetDirectoryName(corelibLocation); + + // do our best to try and find it, intentionally only use the windows name since linux will not be a PE. + var coreclrLocation = Directory.EnumerateFiles(corelibFolder, "coreclr.dll").FirstOrDefault(); + + // if we can't find it, skip the test + if (coreclrLocation != null) + { + // ensure that false is returned and no warning is logged for native library + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] { new MockTaskItem() { ItemSpec = coreclrLocation } } + }; + + task.Execute().Should().BeTrue(); + task.DependsOnNETStandard.Should().BeFalse(); + // don't warn for PE with no metadata + ((MockBuildEngine)task.BuildEngine).Warnings.Count.Should().Be(0); + } + } + + [Fact] + public void SucceedsOnMissingFileReturnsFalse() + { + var missingFile = $"{nameof(SucceedsOnMissingFileReturnsFalse)}.shouldNotExist.dll"; + File.Exists(missingFile).Should().BeFalse(); + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] { new MockTaskItem() { ItemSpec = missingFile } } + }; + + task.Execute().Should().BeTrue(); + task.DependsOnNETStandard.Should().BeFalse(); + ((MockBuildEngine)task.BuildEngine).Warnings.Count.Should().Be(0); + } + + [Fact] + public void SuccedsWithWarningOnLockedFile() + { + var lockedFile = $"{nameof(SuccedsWithWarningOnLockedFile)}.dll"; + + try + { + var task = new GetDependsOnNETStandard() + { + BuildEngine = new MockBuildEngine(), + References = new[] { new MockTaskItem() { ItemSpec = lockedFile } } + }; + + // create file with no sharing + using (var fileHandle = new FileStream(lockedFile, FileMode.Create, FileAccess.ReadWrite, FileShare.None)) + { + task.Execute().Should().BeTrue(); + task.DependsOnNETStandard.Should().BeFalse(); + ((MockBuildEngine)task.BuildEngine).Warnings.Count.Should().BeGreaterThan(0); + } + } + finally + { + File.Delete(lockedFile); + } + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Microsoft.NET.Build.Extensions.Tasks.UnitTests.csproj b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Microsoft.NET.Build.Extensions.Tasks.UnitTests.csproj new file mode 100644 index 000000000000..cb1f3181e587 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Microsoft.NET.Build.Extensions.Tasks.UnitTests.csproj @@ -0,0 +1,43 @@ + + + + + + + Exe + netcoreapp2.0 + false + true + + + + $(NuGetVersion) + + + $(DependencyModelVersion) + + + $(MsBuildPackagesVersion) + + + $(MsBuildPackagesVersion) + + + $(FluentAssertionsJsonVersion) + + + + + + + + + + + {88723307-6bfa-4cb5-a518-2ffd5f91b891} + Microsoft.NET.Build.Extensions.Tasks + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/AssemblyInfo.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..27bfb7922e5a --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Resources; + +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/launchSettings.json b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/launchSettings.json new file mode 100644 index 000000000000..a3d68badc336 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "TestTest": { + "commandName": "Project", + "commandLineArgs": "-wait" + } + } +} \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs new file mode 100644 index 000000000000..8d45c63c8b84 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs @@ -0,0 +1,80 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using System; +using System.IO; +using System.Security; + +namespace Microsoft.NET.Build.Tasks +{ + /// + /// Determines if any Reference depends on netstandard.dll. + /// + public partial class GetDependsOnNETStandard : TaskBase + { + private const string NetStandardAssemblyName = "netstandard"; + /// + /// Set of reference items to analyze. + /// + [Required] + public ITaskItem[] References { get; set; } + + /// + /// True if any of the references depend on netstandard.dll + /// + [Output] + public bool DependsOnNETStandard { get; set; } + + protected override void ExecuteCore() + { + DependsOnNETStandard = AnyReferenceDependsOnNETStandard(); + } + + private bool AnyReferenceDependsOnNETStandard() + { + foreach (var reference in References) + { + var referenceSourcePath = ItemUtilities.GetSourcePath(reference); + + if (referenceSourcePath != null && File.Exists(referenceSourcePath)) + { + try + { + if (GetFileDependsOnNETStandard(referenceSourcePath)) + { + return true; + } + } + catch (Exception e) when (IsReferenceException(e)) + { + // ResolveAssemblyReference treats all of these exceptions as warnings so we'll do the same + Log.LogWarning(Strings.GetDependsOnNETStandardFailedWithException, e.Message); + } + } + } + + return false; + } + + // ported from MSBuild's ReferenceTable.SetPrimaryAssemblyReferenceItem + private static bool IsReferenceException(Exception e) + { + // These all derive from IOException + // DirectoryNotFoundException + // DriveNotFoundException + // EndOfStreamException + // FileLoadException + // FileNotFoundException + // PathTooLongException + // PipeException + return e is BadImageFormatException + || e is UnauthorizedAccessException + || e is NotSupportedException + || (e is ArgumentException && !(e is ArgumentNullException)) + || e is SecurityException + || e is IOException; + } + + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs new file mode 100644 index 000000000000..513988b9f0a2 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs @@ -0,0 +1,169 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if NET46 +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; + +namespace Microsoft.NET.Build.Tasks +{ + public partial class GetDependsOnNETStandard + { + private static readonly Guid s_importerGuid = new Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44"); + + // This method cross-compiles for desktop to avoid using System.Reflection.Metadata (SRM). + // We do this because we don't want the following: + // - additional size of SRM and its closure + // - load / JIT cost of SRM and its closure + // - deal with bindingRedirects/unification needed to load SRM's closure. + + internal static bool GetFileDependsOnNETStandard(string filePath) + { + // Ported from Microsoft.Build.Tasks.AssemblyInformation + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + // on Unix/Mac (mono) use ReflectionOnlyLoadFrom to examine dependencies + // known issue: since this doesn't create an isolated app domain this will fail if more than one + // assembly with the same name is analyzed by this task. The same issue exists in ResolveAssemblyReferences + // so we are not attempting to fix it here. + var assembly = Assembly.ReflectionOnlyLoadFrom(filePath); + + foreach(var referencedAssembly in assembly.GetReferencedAssemblies()) + { + if (referencedAssembly.Name.Equals(NetStandardAssemblyName, StringComparison.Ordinal)) + { + return true; + } + } + } + else + { + // on Windows use CLR's unmanaged metadata API. + // Create the metadata dispenser and open scope on the source file. + var metadataDispenser = (IMetaDataDispenser)new CorMetaDataDispenser(); + var assemblyImport = (IMetaDataAssemblyImport)metadataDispenser.OpenScope(filePath, 0, s_importerGuid); + + var asmRefEnum = IntPtr.Zero; + var asmRefTokens = new UInt32[16]; + UInt32 fetched; + // Ensure the enum handle is closed. + try + { + // Enum chunks of refs in 16-ref blocks until we run out. + do + { + assemblyImport.EnumAssemblyRefs( + ref asmRefEnum, + asmRefTokens, + (uint)asmRefTokens.Length, + out fetched); + + for (uint i = 0; i < fetched; i++) + { + // Determine the length of the string to contain the name first. + IntPtr hashDataPtr, pubKeyPtr; + UInt32 hashDataLength, pubKeyBytes, asmNameLength, flags; + assemblyImport.GetAssemblyRefProps( + asmRefTokens[i], + out pubKeyPtr, + out pubKeyBytes, + null, + 0, + out asmNameLength, + IntPtr.Zero, + out hashDataPtr, + out hashDataLength, + out flags); + + // Allocate assembly name buffer. + StringBuilder assemblyNameBuffer = new StringBuilder((int)asmNameLength + 1); + + // Retrieve the assembly reference properties. + assemblyImport.GetAssemblyRefProps( + asmRefTokens[i], + out pubKeyPtr, + out pubKeyBytes, + assemblyNameBuffer, + (uint)assemblyNameBuffer.Capacity, + out asmNameLength, + IntPtr.Zero, + out hashDataPtr, + out hashDataLength, + out flags); + + var assemblyName = assemblyNameBuffer.ToString(); + + if (assemblyName.Equals(NetStandardAssemblyName, StringComparison.Ordinal)) + { + return true; + } + } + } while (fetched > 0); + } + finally + { + if (asmRefEnum != IntPtr.Zero) + { + assemblyImport.CloseEnum(asmRefEnum); + } + } + } + return false; + } + + #region Interop + + [ComImport] + [Guid("E5CB7A31-7512-11d2-89CE-0080C792E5D8")] + [TypeLibType(TypeLibTypeFlags.FCanCreate)] + [ClassInterface(ClassInterfaceType.None)] + internal class CorMetaDataDispenser + { + } + + [ComImport] + [Guid("809c652e-7396-11d2-9771-00a0c9b4d50c")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown /*0x0001*/)] + [TypeLibType(TypeLibTypeFlags.FRestricted /*0x0200*/)] + internal interface IMetaDataDispenser + { + [return: MarshalAs(UnmanagedType.Interface)] + object DefineScope([In] ref Guid rclsid, [In] UInt32 dwCreateFlags, [In] ref Guid riid); + + [return: MarshalAs(UnmanagedType.Interface)] + object OpenScope([In][MarshalAs(UnmanagedType.LPWStr)] string szScope, [In] UInt32 dwOpenFlags, [In] ref Guid riid); + + [return: MarshalAs(UnmanagedType.Interface)] + object OpenScopeOnMemory([In] IntPtr pData, [In] UInt32 cbData, [In] UInt32 dwOpenFlags, [In] ref Guid riid); + } + + [ComImport] + [Guid("EE62470B-E94B-424e-9B7C-2F00C9249F93")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + internal interface IMetaDataAssemblyImport + { + void GetAssemblyProps(UInt32 mdAsm, out IntPtr pPublicKeyPtr, out UInt32 ucbPublicKeyPtr, out UInt32 uHashAlg, StringBuilder strName, UInt32 cchNameIn, out UInt32 cchNameRequired, IntPtr amdInfo, out UInt32 dwFlags); + void GetAssemblyRefProps(UInt32 mdAsmRef, out IntPtr ppbPublicKeyOrToken, out UInt32 pcbPublicKeyOrToken, StringBuilder strName, UInt32 cchNameIn, out UInt32 pchNameOut, IntPtr amdInfo, out IntPtr ppbHashValue, out UInt32 pcbHashValue, out UInt32 pdwAssemblyRefFlags); + void GetFileProps([In] UInt32 mdFile, StringBuilder strName, UInt32 cchName, out UInt32 cchNameRequired, out IntPtr bHashData, out UInt32 cchHashBytes, out UInt32 dwFileFlags); + void GetExportedTypeProps(); + void GetManifestResourceProps(); + void EnumAssemblyRefs([In, Out] ref IntPtr phEnum, [MarshalAs(UnmanagedType.LPArray), Out] UInt32[] asmRefs, System.UInt32 asmRefCount, out System.UInt32 iFetched); + void EnumFiles([In, Out] ref IntPtr phEnum, [MarshalAs(UnmanagedType.LPArray), Out] UInt32[] fileRefs, System.UInt32 fileRefCount, out System.UInt32 iFetched); + void EnumExportedTypes(); + void EnumManifestResources(); + void GetAssemblyFromScope(out UInt32 mdAsm); + void FindExportedTypeByName(); + void FindManifestResourceByName(); + // PreserveSig because this method is an exception that + // actually returns void, not HRESULT. + [PreserveSig] + void CloseEnum([In] IntPtr phEnum); + void FindAssembliesByName(); + } + #endregion + } +} + +#endif \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs new file mode 100644 index 000000000000..871f6da70732 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if NETCOREAPP1_0 +using System; +using System.IO; +using System.Reflection.Metadata; +using System.Reflection.PortableExecutable; + +namespace Microsoft.NET.Build.Tasks +{ + public partial class GetDependsOnNETStandard + { + internal static bool GetFileDependsOnNETStandard(string filePath) + { + using (var assemblyStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.Read)) + using (PEReader peReader = new PEReader(assemblyStream, PEStreamOptions.LeaveOpen)) + { + if (peReader.HasMetadata) + { + MetadataReader reader = peReader.GetMetadataReader(); + if (reader.IsAssembly) + { + foreach (var referenceHandle in reader.AssemblyReferences) + { + AssemblyReference reference = reader.GetAssemblyReference(referenceHandle); + + if (reader.StringComparer.Equals(reference.Name, NetStandardAssemblyName)) + { + return true; + } + } + } + } + } + + return false; + } + } +} +#endif diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/Microsoft.NET.Build.Extensions.Tasks.csproj b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/Microsoft.NET.Build.Extensions.Tasks.csproj new file mode 100644 index 000000000000..829b05771742 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/Microsoft.NET.Build.Extensions.Tasks.csproj @@ -0,0 +1,104 @@ + + + + + Library + Microsoft.NET.Build.Extensions + The MSBuild targets and tasks which extend MSBuild's common targets. + Microsoft.NET.Build.Tasks + netcoreapp1.0;net46 + netcoreapp1.0 + false + $(OutputPath)Packages\ + $(OutputPath)Sdks\$(PackageId)\ + $(PackageLayoutOutputPath)msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\tools + false + true + false + true + $(DefineConstants);EXTENSIONS + + + + + All + true + + + + + + + + + + + + + + + + + + + + + + Common\%(RecursiveDir)\%(FileName)%(Extension) + + + Resources\xlf\%(FileName)%(Extension) + + + Resources\%(FileName)%(Extension) + ResXFileCodeGenerator + Strings.Designer.cs + Microsoft.NET.Build.Tasks + + + Resources\%(FileName)%(Extension) + True + True + Strings.resx + + + + + + <_netstandardLibraryNetFrameworkPath>$(NUGET_PACKAGES)\NETStandard.Library.NETFramework\$(NETStandardLibraryNETFrameworkVersion)\build + + + + %(None.PackagePath)\%(None.RecursiveDir)%(None.Filename)%(None.Extension) + + + + msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\%(NetStandardNetFxFile.RecursiveDir)%(NetStandardNetFxFile.FileName)%(NetStandardNetFxFile.Extension) + + + + + + + + + + + + + + + + + + + + + <_CopyLocalButNotPublished Include="@(AllCopyLocalItems)" Exclude="@(ResolvedAssembliesToPublish)" /> + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions-ver/Microsoft.Common.targets/ImportAfter/Microsoft.NET.Build.Extensions.targets b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions-ver/Microsoft.Common.targets/ImportAfter/Microsoft.NET.Build.Extensions.targets new file mode 100644 index 000000000000..130309ea3681 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions-ver/Microsoft.Common.targets/ImportAfter/Microsoft.NET.Build.Extensions.targets @@ -0,0 +1,20 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + $(MSBuildExtensionsPath)\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.ConflictResolution.targets b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.ConflictResolution.targets new file mode 100644 index 000000000000..bab28261e416 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.ConflictResolution.targets @@ -0,0 +1,50 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + <_HandlePackageFileConflictsAfter>ResolveNuGetPackageAssets + + + <_HandlePackageFileConflictsBefore>ResolveAssemblyReferences + + + + + + + + + + + + + + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.NETFramework.targets b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.NETFramework.targets new file mode 100644 index 000000000000..f5f0ebfe4d21 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.NETFramework.targets @@ -0,0 +1,87 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + true + + + + + + + + <_CandidateNETStandardReferences Include="@(Reference);@(_ResolvedProjectReferencePaths)" /> + <_InboxNETStandardFolders Include="$(TargetFrameworkDirectory)" /> + + + + + true + + + + + + + + + + <_UsingOldSDK Condition="'$(UsingMicrosoftNETSdk)' != 'true' AND ('$(TargetFramework)' != '' OR '$(TargetFrameworks)' != '')">true + + + + + + <_NETStandardLibraryNETFrameworkReference Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.7'" + Include="$(MSBuildThisFileDirectory)\net47\ref\*.dll" /> + <_NETStandardLibraryNETFrameworkReference Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.6.2'" + Include="$(MSBuildThisFileDirectory)\net462\ref\*.dll" + Exclude="@(_NETStandardLibraryNETFrameworkReference->'$(MSBuildThisFileDirectory)\net462\ref\%(FileName).dll')" /> + <_NETStandardLibraryNETFrameworkReference Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.6.1'" + Include="$(MSBuildThisFileDirectory)\net461\ref\*.dll" + Exclude="@(_NETStandardLibraryNETFrameworkReference->'$(MSBuildThisFileDirectory)\net461\ref\%(FileName).dll')" /> + + <_NETStandardLibraryNETFrameworkLib Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.7'" + Include="$(MSBuildThisFileDirectory)\net47\lib\*.dll" /> + <_NETStandardLibraryNETFrameworkLib Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.6.2'" + Include="$(MSBuildThisFileDirectory)\net462\lib\*.dll" + Exclude="@(_NETStandardLibraryNETFrameworkLib->'$(MSBuildThisFileDirectory)\net462\lib\%(FileName).dll')" /> + <_NETStandardLibraryNETFrameworkLib Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.6.1'" + Include="$(MSBuildThisFileDirectory)\net461\lib\*.dll" + Exclude="@(_NETStandardLibraryNETFrameworkLib->'$(MSBuildThisFileDirectory)\net461\lib\%(FileName).dll')" /> + + + + + + false + + + + false + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets new file mode 100644 index 000000000000..e318660890f3 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets @@ -0,0 +1,31 @@ + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + <_TargetFrameworkVersionWithoutV>$(TargetFrameworkVersion) + <_TargetFrameworkVersionWithoutV Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1)) + + $(MSBuildThisFileDirectory)\tools\netcoreapp1.0\Microsoft.NET.Build.Extensions.Tasks.dll + $(MSBuildThisFileDirectory)\tools\net46\Microsoft.NET.Build.Extensions.Tasks.dll + + + true + + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAConflictResolver.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAConflictResolver.cs index 364c05e37655..8ce0ba48d7be 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAConflictResolver.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAConflictResolver.cs @@ -411,7 +411,49 @@ public void LogMessage(LogImportance importance, string message, params object[] public void LogWarning(string message, params object[] messageArgs) { } - } + public void LogError( + string subcategory, + string errorCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + } + + public void LogWarning( + string subcategory, + string warningCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + } + + public void LogMessage( + string subcategory, + string code, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + MessageImportance importance, + string message, + params object[] messageArgs) + { + } + } } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenADependencyContextBuilder.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenADependencyContextBuilder.cs index fd8571bf427a..0d4005b87be1 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenADependencyContextBuilder.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenADependencyContextBuilder.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Collections.Generic; -using System.IO; using FluentAssertions; using FluentAssertions.Json; using Microsoft.Build.Framework; @@ -11,6 +9,9 @@ using Newtonsoft.Json.Linq; using NuGet.Frameworks; using NuGet.ProjectModel; +using System.Collections.Generic; +using System.IO; +using System.Linq; using Xunit; namespace Microsoft.NET.Build.Tasks.UnitTests @@ -43,7 +44,7 @@ public void ItBuildsDependencyContextsFromProjectLockFiles( IEnumerable directReferences = ReferenceInfo.CreateDirectReferenceInfos( - referencePaths ?? new ITaskItem[] { }, + referencePaths ?? new ITaskItem[] { }, referenceSatellitePaths ?? new ITaskItem[] { }); ProjectContext projectContext = lockFile.CreateProjectContext( @@ -85,19 +86,7 @@ public static IEnumerable ProjectData { get { - CompilationOptions compilationOptions = new CompilationOptions( - defines: new[] { "DEBUG", "TRACE" }, - languageVersion: "6", - platform: "x64", - allowUnsafe: true, - warningsAsErrors: false, - optimize: null, - keyFile: "../keyfile.snk", - delaySign: null, - publicSign: null, - debugType: "portable", - emitEntryPoint: true, - generateXmlDocumentation: true); + CompilationOptions compilationOptions = CreateCompilationOptions(); ITaskItem[] dotnetNewSatelliteAssemblies = new ITaskItem[] { @@ -183,5 +172,120 @@ private JObject Save(DependencyContext dependencyContext) } } } + + [Fact] + public void ItDoesntCreateReferenceAssembliesWhenNoCompilationOptions() + { + DependencyContext dependencyContext = BuildDependencyContextWithReferenceAssemblies(useCompilationOptions: false); + + dependencyContext.CompileLibraries.Should().BeEmpty(); + dependencyContext + .RuntimeLibraries + .Should() + .NotContain(l => l.Type == "referenceassembly"); + dependencyContext + .RuntimeLibraries + .SelectMany(l => l.Dependencies) + .Should() + .NotBeEmpty() + .And + .NotContain(d => d.Name == "System.NotConflicting") + .And + .NotContain(d => d.Name == "System.Collections.NonGeneric.Reference"); + } + + [Fact] + public void ItHandlesReferenceAndPackageReferenceNameCollisions() + { + DependencyContext dependencyContext = BuildDependencyContextWithReferenceAssemblies(useCompilationOptions: true); + + dependencyContext.CompileLibraries.Should() + .Contain(c => c.Name == "System.NotConflicting" && c.Type == "referenceassembly"); + + // Note: System.Collections.NonGeneric is referenced in the lockfile, so DependencyContextBuilder + // appends ".Reference" to make it unique + dependencyContext.CompileLibraries.Should() + .Contain(c => c.Name == "System.Collections.NonGeneric.Reference" && c.Type == "referenceassembly"); + dependencyContext.CompileLibraries.Should() + .Contain(c => c.Name == "System.Collections.NonGeneric.Reference.Reference" && c.Type == "referenceassembly"); + } + + private DependencyContext BuildDependencyContextWithReferenceAssemblies(bool useCompilationOptions) + { + string mainProjectName = "simple.dependencies"; + LockFile lockFile = TestLockFiles.GetLockFile(mainProjectName); + + SingleProjectInfo mainProject = SingleProjectInfo.Create( + "/usr/Path", + mainProjectName, + ".dll", + "1.0.0", + new ITaskItem[] { }); + + ITaskItem[] referencePaths = new ITaskItem[] + { + new MockTaskItem( + "/usr/Path/System.NotConflicting.dll", + new Dictionary + { + { "CopyLocal", "false" }, + { "FusionName", "System.NotConflicting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" }, + { "Version", "" }, + }), + new MockTaskItem( + "/usr/Path/System.Collections.NonGeneric.dll", + new Dictionary + { + { "CopyLocal", "false" }, + { "FusionName", "System.Collections.NonGeneric, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" }, + { "Version", "" }, + }), + new MockTaskItem( + "/usr/Path/System.Collections.NonGeneric.Reference.dll", + new Dictionary + { + { "CopyLocal", "false" }, + { "FusionName", "System.Collections.NonGeneric.Reference, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" }, + { "Version", "" }, + }), + }; + + ProjectContext projectContext = lockFile.CreateProjectContext( + FrameworkConstants.CommonFrameworks.NetCoreApp10, + runtime: null, + platformLibraryName: Constants.DefaultPlatformLibrary, + isSelfContained: false); + + CompilationOptions compilationOptions = + useCompilationOptions ? CreateCompilationOptions() : + null; + + DependencyContext dependencyContext = new DependencyContextBuilder(mainProject, projectContext) + .WithReferenceAssemblies(ReferenceInfo.CreateReferenceInfos(referencePaths)) + .WithCompilationOptions(compilationOptions) + .Build(); + + // ensure the DependencyContext can be written out successfully - it has no duplicate dependency names + Save(dependencyContext); + + return dependencyContext; + } + + private static CompilationOptions CreateCompilationOptions() + { + return new CompilationOptions( + defines: new[] { "DEBUG", "TRACE" }, + languageVersion: "6", + platform: "x64", + allowUnsafe: true, + warningsAsErrors: false, + optimize: null, + keyFile: "../keyfile.snk", + delaySign: null, + publicSign: null, + debugType: "portable", + emitEntryPoint: true, + generateXmlDocumentation: true); + } } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAPublishAssembliesResolver.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAPublishAssembliesResolver.cs index 6bdb4fb64a2b..0e0d88a24a1a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAPublishAssembliesResolver.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAPublishAssembliesResolver.cs @@ -5,6 +5,7 @@ using System.IO; using FluentAssertions; using NuGet.Frameworks; +using NuGet.Packaging.Core; using NuGet.ProjectModel; using NuGet.Versioning; using Xunit; @@ -190,6 +191,7 @@ private static ResolvedFile CreateResolvedFile( return new ResolvedFile( sourcepath, destinationSubDirPath, + new PackageIdentity(packageId, NuGetVersion.Parse(version)), assetType); } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeReportAssetsLogMessages.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeReportAssetsLogMessages.cs new file mode 100644 index 000000000000..4c2bce1b65bd --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeReportAssetsLogMessages.cs @@ -0,0 +1,223 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using FluentAssertions; +using NuGet.Common; +using NuGet.ProjectModel; +using System; +using System.Linq; +using Xunit; +using static Microsoft.NET.Build.Tasks.UnitTests.LockFileSnippets; + +namespace Microsoft.NET.Build.Tasks.UnitTests +{ + public class GivenThatWeReportAssetsLogMessages + { + [Fact] + public void ItReportsDiagnosticsWithMinimumData() + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet( + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Warning, "Sample warning") + } + ); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + task.DiagnosticMessages.Should().HaveCount(1); + log.Messages.Should().HaveCount(1); + } + + [Theory] + [InlineData(null)] + [InlineData(new object[] { new string[0] })] + public void ItReportsZeroDiagnosticsWithNoLogs(string [] logsJson) + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet(logsJson); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + task.DiagnosticMessages.Should().BeEmpty(); + log.Messages.Should().BeEmpty(); + } + + [Fact] + public void ItReportsDiagnosticsMetadataWithLogs() + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet( + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Error, "Sample error", + filePath: "path/to/project.csproj", + libraryId: "LibA", + targetGraphs: new string[]{ ".NETCoreApp,Version=v1.0" }), + CreateLog(NuGetLogCode.NU1001, LogLevel.Warning, "Sample warning", + libraryId: "LibB", + targetGraphs: new string[]{ ".NETCoreApp,Version=v1.0" }) + } + ); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + log.Messages.Should().HaveCount(2); + task.DiagnosticMessages.Should().HaveCount(2); + + Action checkMetadata = (key, val1, val2) => { + task.DiagnosticMessages + .Select(item => item.GetMetadata(key)) + .Should().Contain(new string[] { val1, val2 }); + }; + + checkMetadata(MetadataKeys.DiagnosticCode, "NU1000", "NU1001"); + checkMetadata(MetadataKeys.Severity, "Error", "Warning"); + checkMetadata(MetadataKeys.Message, "Sample error", "Sample warning"); + checkMetadata(MetadataKeys.FilePath, "", "path/to/project.csproj"); + checkMetadata(MetadataKeys.ParentTarget, ".NETCoreApp,Version=v1.0", ".NETCoreApp,Version=v1.0"); + checkMetadata(MetadataKeys.ParentPackage, "LibA/1.2.3", "LibB/1.2.3"); + } + + [Theory] + [InlineData(null, null, "", "")] + [InlineData(new string[] { ".NETCoreApp,Version=v1.0" }, null, ".NETCoreApp,Version=v1.0", "")] + [InlineData(null, "LibA", "", "")] + [InlineData(new string[] { ".NETCoreApp,Version=v1.0" }, "LibA", ".NETCoreApp,Version=v1.0", "LibA/1.2.3")] + public void ItReportsDiagnosticsWithAllTargetLibraryCases(string[] targetGraphs, string libraryId, string expectedTarget, string expectedPackage) + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet( + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Warning, "Sample warning", + filePath: "path/to/project.csproj", + libraryId: libraryId, + targetGraphs: targetGraphs) + } + ); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + log.Messages.Should().HaveCount(1); + task.DiagnosticMessages.Should().HaveCount(1); + var item = task.DiagnosticMessages.First(); + + item.GetMetadata(MetadataKeys.ParentTarget).Should().Be(expectedTarget); + item.GetMetadata(MetadataKeys.ParentPackage).Should().Be(expectedPackage); + } + + [Fact] + public void ItHandlesInfoLogLevels() + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet( + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Information, "Sample message"), + CreateLog(NuGetLogCode.NU1000, LogLevel.Minimal, "Sample message"), + CreateLog(NuGetLogCode.NU1000, LogLevel.Verbose, "Sample message"), + CreateLog(NuGetLogCode.NU1000, LogLevel.Debug, "Sample message"), + } + ); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + log.Messages.Should().HaveCount(4); + task.DiagnosticMessages.Should().HaveCount(4); + + task.DiagnosticMessages + .Select(item => item.GetMetadata(MetadataKeys.Severity)) + .Should().OnlyContain(s => s == "Info"); + } + + [Theory] + [InlineData(new string[] { ".NETCoreApp,Version=v1.0", ".NETFramework,Version=v4.6.1" }, "LibA")] + [InlineData(new string[] { ".NETCoreApp,Version=v1.0" }, "LibA")] + public void ItHandlesMultiTFMScenarios(string[] targetGraphs, string libraryId) + { + var log = new MockLog(); + string lockFileContent = CreateLockFileSnippet( + targets: new string[] { + CreateTarget(".NETCoreApp,Version=v1.0", TargetLibA, TargetLibB, TargetLibC), + CreateTarget(".NETFramework,Version=v4.6.1", TargetLibA, TargetLibB, TargetLibC), + }, + libraries: new string[] { LibADefn, LibBDefn, LibCDefn }, + projectFileDependencyGroups: new string[] { + ProjectGroup, NETCoreGroup, NET461Group + }, + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Warning, "Sample warning", + filePath: "path/to/project.csproj", + libraryId: libraryId, + targetGraphs: targetGraphs) + } + ); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + // a diagnostic for each target graph... + task.DiagnosticMessages.Should().HaveCount(targetGraphs.Length); + + // ...but only one is logged + log.Messages.Should().HaveCount(1); + + task.DiagnosticMessages + .Select(item => item.GetMetadata(MetadataKeys.ParentTarget)) + .Should().Contain(targetGraphs); + + task.DiagnosticMessages + .Select(item => item.GetMetadata(MetadataKeys.ParentPackage)) + .Should().OnlyContain(v => v.StartsWith(libraryId)); + } + + [Fact] + public void ItSkipsInvalidEntries() + { + var log = new MockLog(); + string lockFileContent = CreateDefaultLockFileSnippet( + logs: new string[] { + CreateLog(NuGetLogCode.NU1000, LogLevel.Error, "Sample error that will be invalid"), + CreateLog(NuGetLogCode.NU1001, LogLevel.Warning, "Sample warning"), + } + ); + lockFileContent = lockFileContent.Replace("NU1000", "CA1000"); + + var task = GetExecutedTaskFromContents(lockFileContent, log); + + log.Messages.Should().HaveCount(1); + task.DiagnosticMessages.Should().HaveCount(1); + + task.DiagnosticMessages + .Select(item => item.GetMetadata(MetadataKeys.DiagnosticCode)) + .Should().OnlyContain(v => v == "NU1001"); + } + + private static string CreateDefaultLockFileSnippet(string[] logs = null) => + CreateLockFileSnippet( + targets: new string[] { + CreateTarget(".NETCoreApp,Version=v1.0", TargetLibA, TargetLibB, TargetLibC), + }, + libraries: new string[] { LibADefn, LibBDefn, LibCDefn }, + projectFileDependencyGroups: new string[] { + ProjectGroup, NETCoreGroup + }, + logs: logs + ); + + private ReportAssetsLogMessages GetExecutedTaskFromContents(string lockFileContents, MockLog logger) + { + var lockFile = TestLockFiles.CreateLockFile(lockFileContents); + return GetExecutedTask(lockFile, logger); + } + + private ReportAssetsLogMessages GetExecutedTask(LockFile lockFile, MockLog logger) + { + var task = new ReportAssetsLogMessages(lockFile, logger) + { + ProjectAssetsFile = lockFile.Path, + }; + + task.Execute().Should().BeTrue(); + + return task; + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs index 9c66bfd7591c..8d94925b5ec6 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs @@ -69,7 +69,9 @@ public void ItShouldReturnOnlyValidTargetsWithoutRIDs() task.FileDefinitions = new ITaskItem[] { }; task.PackageDependencies = new ITaskItem[] { }; task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -145,7 +147,9 @@ public void ItShouldNotReturnPackagesWithUnknownTypes() task.FileDefinitions = new ITaskItem[] { }; task.PackageDependencies = new ITaskItem[] { mockPackageDepNoType, mockPackageDepUnknown }; task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -203,7 +207,9 @@ public void ItShouldReturnUnresolvedPackageDependenciesWithTypePackage() task.FileDefinitions = new ITaskItem[] { }; task.PackageDependencies = new ITaskItem[] { mockPackageDepUnresolved }; task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -415,7 +421,9 @@ public void ItShouldIgnoreAllDependenciesWithTypeNotEqualToPackageOrUnresolved() mockPackageReferenceDep }; task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -550,7 +558,9 @@ public void ItReturnsCorrectHierarchyOfDependenciesThatHaveChildren() mockChildPackageDep2 }; task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -760,7 +770,9 @@ public void ItShouldIgnoreFileDependenciesThatAre_NotAssemblies_And_DontBelongTo mockWinmdDep, mockReferenceDep }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -936,7 +948,9 @@ public void ItShouldReturnCorrectHierarchyWhenPackageHasChildAssemblyOrAnalyzerD mockChildAssemblyNoCompileMetadataDep, mockChildAnalyzerAssemblyDep }; + task.References = new ITaskItem[] { }; task.DefaultImplicitPackages = "Package3;Package4"; + task.TargetFrameworkMoniker = string.Empty; // Act var result = task.Execute(); @@ -981,6 +995,295 @@ public void ItShouldReturnCorrectHierarchyWhenPackageHasChildAssemblyOrAnalyzerD VerifyTargetTaskItem(DependencyType.AnalyzerAssembly, mockChildAnalyzerAssembly, resultChildAnalyzerAssembly[0]); } + [Fact] + public void ItShouldReturnCorrectPackagesForCorrespondingTarget() + { + // Arrange + // target definitions + var mockTarget = new MockTaskItem( + itemSpec: ".Net Framework,Version=v4.5", + metadata: new Dictionary + { + { MetadataKeys.RuntimeIdentifier, "net45" }, + { MetadataKeys.TargetFrameworkMoniker, ".Net Framework,Version=v4.5" }, + { MetadataKeys.FrameworkName, ".Net Framework" }, + { MetadataKeys.FrameworkVersion, "4.5" }, + { MetadataKeys.Type, "Target" } + }); + + var mockTarget2 = new MockTaskItem( + itemSpec: ".Net Framework,Version=v4.6", + metadata: new Dictionary + { + { MetadataKeys.RuntimeIdentifier, "net46" }, + { MetadataKeys.TargetFrameworkMoniker, ".Net Framework,Version=v4.6" }, + { MetadataKeys.FrameworkName, ".Net Framework" }, + { MetadataKeys.FrameworkVersion, "4.6" }, + { MetadataKeys.Type, "Target" } + }); + + // package definitions + var mockPackage1 = new MockTaskItem( + itemSpec: "Package1/1.0.0", + metadata: new Dictionary + { + { MetadataKeys.Name, "Package1" }, + { MetadataKeys.Version, "1.0.0" }, + { MetadataKeys.Path, "some path" }, + { MetadataKeys.ResolvedPath, "" }, + { MetadataKeys.Type, "Package" }, + { PreprocessPackageDependenciesDesignTime.ResolvedMetadata, "True" } + }); + + var mockChildPackage1 = new MockTaskItem( + itemSpec: "ChildPackage1/1.0.0", + metadata: new Dictionary + { + { MetadataKeys.Name, "ChildPackage1" }, + { MetadataKeys.Version, "1.0.0" }, + { MetadataKeys.Path, "some path" }, + { MetadataKeys.ResolvedPath, "some resolved path" }, + { MetadataKeys.Type, "Package" }, + { PreprocessPackageDependenciesDesignTime.ResolvedMetadata, "True" }, + { MetadataKeys.IsTopLevelDependency, "False" } + }); + + // package dependencies + var mockPackageDep1 = new MockTaskItem( + itemSpec: "Package1/1.0.0", + metadata: new Dictionary + { + { MetadataKeys.ParentTarget, ".Net Framework,Version=v4.5" } + }); + + var mockChildPackageDep1 = new MockTaskItem( + itemSpec: "ChildPackage1/1.0.0", + metadata: new Dictionary + { + { MetadataKeys.ParentTarget, ".Net Framework,Version=v4.5" }, + { MetadataKeys.ParentPackage, "Package1/1.0.0" } + }); + + var mockPackageDep2 = new MockTaskItem( + itemSpec: "Package1/1.0.0", + metadata: new Dictionary + { + { MetadataKeys.ParentTarget, ".Net Framework,Version=v4.6" } + }); + + + var task = new PreprocessPackageDependenciesDesignTime(); + task.TargetDefinitions = new[] { mockTarget, mockTarget2 }; + task.PackageDefinitions = new ITaskItem[] { mockPackage1, mockChildPackage1 }; + task.FileDefinitions = new ITaskItem[] { }; + task.PackageDependencies = new ITaskItem[] { mockPackageDep1, mockPackageDep2, mockChildPackageDep1 }; + task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { }; + task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = string.Empty; + + // Act + var result = task.Execute(); + + // Assert + result.Should().BeTrue(); + task.DependenciesDesignTime.Count().Should().Be(5); + + var resultTargets = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".Net Framework,Version=v4.5")).ToArray(); + resultTargets.Length.Should().Be(1); + + resultTargets = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".Net Framework,Version=v4.6")).ToArray(); + resultTargets.Length.Should().Be(1); + + var resultPackage1 = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".Net Framework,Version=v4.5/Package1/1.0.0")).ToArray(); + resultPackage1.Length.Should().Be(1); + resultPackage1[0].GetMetadata(PreprocessPackageDependenciesDesignTime.DependenciesMetadata) + .Should().Be("ChildPackage1/1.0.0"); + + resultPackage1 = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".Net Framework,Version=v4.6/Package1/1.0.0")).ToArray(); + resultPackage1.Length.Should().Be(1); + resultPackage1[0].GetMetadata(PreprocessPackageDependenciesDesignTime.DependenciesMetadata) + .Should().Be(""); + } + + [Fact] + public void ItShouldCreateDependenciesForReferencesWithNuGetMetadata() + { + // Arrange + // target definitions + var netStandard20Target = new MockTaskItem( + itemSpec: ".NETStandard,Version=v2.0", + metadata: new Dictionary + { + { MetadataKeys.RuntimeIdentifier, "netstandard2.0" }, + { MetadataKeys.TargetFrameworkMoniker, ".NETStandard,Version=v2.0" }, + { MetadataKeys.FrameworkName, ".NETStandard" }, + { MetadataKeys.FrameworkVersion, "2.0" }, + { MetadataKeys.Type, "Target" } + }); + + // package definitions + var myPackage = new MockTaskItem( + itemSpec: "MyPackage/1.5.0", + metadata: new Dictionary + { + { MetadataKeys.Name, "MyPackage" }, + { MetadataKeys.Version, "1.5.0" }, + { MetadataKeys.Path, "Packages\\MyPackage\\1.5.0" }, + { MetadataKeys.ResolvedPath, "" }, + { MetadataKeys.Type, "Package" }, + { PreprocessPackageDependenciesDesignTime.ResolvedMetadata, "True" } + }); + + // package dependencies + var myPackageDependency = new MockTaskItem( + itemSpec: "MyPackage/1.5.0", + metadata: new Dictionary + { + { MetadataKeys.ParentTarget, ".NETStandard,Version=v2.0" } + }); + + // references + var referenceWithMetadata = new MockTaskItem( + itemSpec: "Packages\\MyPackage\\1.5.0\\AnAssembly.dll", + metadata: new Dictionary + { + { "NuGetPackageId", "MyPackage" }, + { "NuGetPackageVersion", "1.5.0" } + }); + + var referenceWithoutMetadata = new MockTaskItem( + itemSpec: "Packages\\MyPackage\\1.5.0\\AnotherAssembly.dll", + metadata: new Dictionary()); + + var task = new PreprocessPackageDependenciesDesignTime(); + task.TargetDefinitions = new[] { netStandard20Target }; + task.PackageDefinitions = new ITaskItem[] { myPackage }; + task.FileDefinitions = new ITaskItem[] { }; + task.PackageDependencies = new ITaskItem[] { myPackageDependency }; + task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { referenceWithMetadata, referenceWithoutMetadata }; + task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = ".NETStandard,Version=v2.0"; + + // Act + var result = task.Execute(); + + // Assert + result.Should().BeTrue(); + task.DependenciesDesignTime.Count().Should().Be(3); + + var resultPackage = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".NETStandard,Version=v2.0/MyPackage/1.5.0")).ToArray(); + resultPackage.Length.Should().Be(1); + resultPackage[0].GetMetadata(PreprocessPackageDependenciesDesignTime.DependenciesMetadata) + .Should().Be("MyPackage/1.5.0/AnAssembly.dll"); + } + + [Fact] + public void ItShouldMakeFacadeReferencesInvisible() + { + // Arrange + // target definitions + var netStandard20Target = new MockTaskItem( + itemSpec: ".NETStandard,Version=v2.0", + metadata: new Dictionary + { + { MetadataKeys.RuntimeIdentifier, "netstandard2.0" }, + { MetadataKeys.TargetFrameworkMoniker, ".NETStandard,Version=v2.0" }, + { MetadataKeys.FrameworkName, ".NETStandard" }, + { MetadataKeys.FrameworkVersion, "2.0" }, + { MetadataKeys.Type, "Target" } + }); + + // package definitions + var myPackage = new MockTaskItem( + itemSpec: "MyPackage/1.5.0", + metadata: new Dictionary + { + { MetadataKeys.Name, "MyPackage" }, + { MetadataKeys.Version, "1.5.0" }, + { MetadataKeys.Path, "Packages\\MyPackage\\1.5.0" }, + { MetadataKeys.ResolvedPath, "" }, + { MetadataKeys.Type, "Package" }, + { PreprocessPackageDependenciesDesignTime.ResolvedMetadata, "True" } + }); + + // package dependencies + var myPackageDependency = new MockTaskItem( + itemSpec: "MyPackage/1.5.0", + metadata: new Dictionary + { + { MetadataKeys.ParentTarget, ".NETStandard,Version=v2.0" } + }); + + // references + var alphaReference = new MockTaskItem( + itemSpec: "Packages\\MyPackage\\1.5.0\\AlphaAssembly.dll", + metadata: new Dictionary + { + { "NuGetPackageId", "MyPackage" }, + { "NuGetPackageVersion", "1.5.0" } + }); + + var betaReference = new MockTaskItem( + itemSpec: "Packages\\MyPackage\\1.5.0\\BetaAssembly.dll", + metadata: new Dictionary + { + { "NuGetPackageId", "MyPackage" }, + { "NuGetPackageVersion", "1.5.0" }, + { "Facade", "false" } + }); + + var gammaReference = new MockTaskItem( + itemSpec: "Packages\\MyPackage\\1.5.0\\GammaAssembly.dll", + metadata: new Dictionary + { + { "NuGetPackageId", "MyPackage" }, + { "NuGetPackageVersion", "1.5.0" }, + { "Facade", "true" } + }); + + var task = new PreprocessPackageDependenciesDesignTime(); + task.TargetDefinitions = new[] { netStandard20Target }; + task.PackageDefinitions = new ITaskItem[] { myPackage }; + task.FileDefinitions = new ITaskItem[] { }; + task.PackageDependencies = new ITaskItem[] { myPackageDependency }; + task.FileDependencies = new ITaskItem[] { }; + task.References = new ITaskItem[] { alphaReference, betaReference, gammaReference }; + task.DefaultImplicitPackages = string.Empty; + task.TargetFrameworkMoniker = ".NETStandard,Version=v2.0"; + + // Act + var result = task.Execute(); + + // Assert + result.Should().BeTrue(); + task.DependenciesDesignTime.Count().Should().Be(5); + + var alphaDependency = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".NETStandard,Version=v2.0/MyPackage/1.5.0/AlphaAssembly.dll")) + .Single(); + alphaDependency.GetBooleanMetadata(PreprocessPackageDependenciesDesignTime.VisibleMetadata) + .Should().BeTrue(); + + var betaDependency = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".NETStandard,Version=v2.0/MyPackage/1.5.0/BetaAssembly.dll")) + .Single(); + betaDependency.GetBooleanMetadata(PreprocessPackageDependenciesDesignTime.VisibleMetadata) + .Should().BeTrue(); + + var gammaDependency = task.DependenciesDesignTime + .Where(x => x.ItemSpec.Equals(".NETStandard,Version=v2.0/MyPackage/1.5.0/GammaAssembly.dll")) + .Single(); + gammaDependency.GetBooleanMetadata(PreprocessPackageDependenciesDesignTime.VisibleMetadata) + .Should().BeFalse(); + } + private void VerifyTargetTaskItem(DependencyType type, ITaskItem input, ITaskItem output) { type.ToString().Should().Be(output.GetMetadata(MetadataKeys.Type)); diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/LockFileSnippets.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/LockFileSnippets.cs index c91d5f2daf40..faf3b69af72f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/LockFileSnippets.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/LockFileSnippets.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System; using System.Linq; +using NuGet.Common; namespace Microsoft.NET.Build.Tasks.UnitTests { @@ -14,17 +15,22 @@ internal static class LockFileSnippets public static string CreateLockFileSnippet( string[] targets, string[] libraries, - string[] projectFileDependencyGroups) + string[] projectFileDependencyGroups, + string[] logs = null) { return $@"{{ - ""locked"": false, - ""version"": 2, + ""version"": 3, ""targets"": {{{string.Join(",", targets)}}}, ""libraries"": {{{string.Join(",", libraries)}}}, + {GetLogsPart(logs)} ""projectFileDependencyGroups"": {{{string.Join(",", projectFileDependencyGroups)}}} + }}"; } + private static string GetLogsPart(string[] logs) + => logs == null ? string.Empty : $@" ""logs"": [{string.Join(",", logs)}], "; + public static string CreateLibrary(string nameVer, string type = "package", params string[] members) { return $@" ""{nameVer}"": {{ @@ -101,6 +107,28 @@ public static string CreateProjectFileDependencyGroup(string tfm, params string[ return $"\"{tfm}\": [{ToStringList(dependencies)}]"; } + public static string CreateLog(NuGetLogCode code, LogLevel level, string message, + string filePath = null, + string libraryId = null, + string warningLevel = "0", + string[] targetGraphs = null) + { + List parts = new List(); + + parts.Add($"\"code\": \"{code}\""); + parts.Add($"\"level\": \"{level}\""); + parts.Add($"\"message\": \"{message}\""); + parts.Add($"\"warningLevel\": \"{warningLevel}\""); + + if (filePath != null) parts.Add($"\"filePath\": \"{filePath}\""); + if (libraryId != null) parts.Add($"\"libraryId\": \"{libraryId}\""); + if (targetGraphs != null) parts.Add($"\"targetGraphs\": [{ToStringList(targetGraphs)}]"); + + return $@"{{ + {string.Join(",", parts)} + }}"; + } + private static string ToStringList(params string[] members) { return members == null ? string.Empty : string.Join(",", members.Select(m => $"\"{m}\"")); @@ -119,6 +147,9 @@ private static string ToStringList(params string[] members) public static readonly string NETCoreOsxGroup = CreateProjectFileDependencyGroup(".NETCoreApp,Version=v1.0/osx.10.11-x64"); + public static readonly string NET461Group = + CreateProjectFileDependencyGroup(".NETFramework,Version=v4.6.1"); + public static readonly string LibADefn = CreateLibrary("LibA/1.2.3", "package", "lib/file/A.dll", "lib/file/B.dll", "lib/file/C.dll"); diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Microsoft.NET.Build.Tasks.UnitTests.csproj b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Microsoft.NET.Build.Tasks.UnitTests.csproj index 2aedcbaa6211..e9e27ada8842 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Microsoft.NET.Build.Tasks.UnitTests.csproj +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Microsoft.NET.Build.Tasks.UnitTests.csproj @@ -32,8 +32,11 @@ + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockBuildEngine.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockBuildEngine.cs new file mode 100644 index 000000000000..0e4387ca8b69 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockBuildEngine.cs @@ -0,0 +1,51 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using Microsoft.Build.Framework; + +namespace Microsoft.NET.Build.Tasks.UnitTests +{ + public class MockBuildEngine : IBuildEngine + { + public int ColumnNumberOfTaskNode { get; set; } + + public bool ContinueOnError { get; set; } + + public int LineNumberOfTaskNode { get; set; } + + public string ProjectFileOfTaskNode { get; set; } + + public bool BuildProjectFile(string projectFileName, string[] targetNames, IDictionary globalProperties, IDictionary targetOutputs) + { + throw new NotImplementedException(); + } + + public void LogCustomEvent(CustomBuildEventArgs e) + { + CustomEvents.Add(e); + } + + public void LogErrorEvent(BuildErrorEventArgs e) + { + Errors.Add(e); + } + + public void LogMessageEvent(BuildMessageEventArgs e) + { + Messages.Add(e); + } + + public void LogWarningEvent(BuildWarningEventArgs e) + { + Warnings.Add(e); + } + + public ICollection CustomEvents { get; } = new List(); + public ICollection Errors { get; } = new List(); + public ICollection Messages { get; } = new List(); + public ICollection Warnings { get; } = new List(); + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockLog.cs b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockLog.cs new file mode 100644 index 000000000000..3877a8c18aa7 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/Mocks/MockLog.cs @@ -0,0 +1,84 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using System.Collections.Generic; + +namespace Microsoft.NET.Build.Tasks.UnitTests +{ + public class MockLog : ILog + { + public const string ErrorPrefix = "[ERROR]"; + public const string WarningPrefix = "[WARNING]"; + public const string MessagePrefix = "[MESSAGE]"; + + // track unformatted messages + public List Messages { get; } = new List(); + + public void LogError(string message, params object[] messageArgs) + { + Messages.Add($"{ErrorPrefix}: {message}"); + } + + public void LogMessage(string message, params object[] messageArgs) + { + Messages.Add($"{MessagePrefix}: {message}"); + } + + public void LogMessage(LogImportance importance, string message, params object[] messageArgs) + { + Messages.Add($"{MessagePrefix}: {message}"); + } + + public void LogWarning(string message, params object[] messageArgs) + { + Messages.Add($"{WarningPrefix}: {message}"); + } + + public void LogError( + string subcategory, + string errorCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + Messages.Add($"{ErrorPrefix}: {message}"); + } + + public void LogWarning( + string subcategory, + string warningCode, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + string message, + params object[] messageArgs) + { + Messages.Add($"{WarningPrefix}: {message}"); + } + + public void LogMessage( + string subcategory, + string code, + string helpKeyword, + string file, + int lineNumber, + int columnNumber, + int endLineNumber, + int endColumnNumber, + MessageImportance importance, + string message, + params object[] messageArgs) + { + Messages.Add($"{MessagePrefix}: {message}"); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/CheckForTargetInAssetsFile.cs b/src/Tasks/Microsoft.NET.Build.Tasks/CheckForTargetInAssetsFile.cs new file mode 100644 index 000000000000..85d16c366b56 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/CheckForTargetInAssetsFile.cs @@ -0,0 +1,32 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using NuGet.ProjectModel; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.NET.Build.Tasks +{ + public class CheckForTargetInAssetsFile : TaskBase + { + [Required] + public string AssetsFilePath { get; set; } + + [Required] + public string TargetFrameworkMoniker { get; set; } + + public string RuntimeIdentifier { get; set; } + + + protected override void ExecuteCore() + { + LockFile lockFile = new LockFileCache(BuildEngine4).GetLockFile(AssetsFilePath); + + var nugetFramework = NuGetUtils.ParseFrameworkName(TargetFrameworkMoniker); + + lockFile.GetTargetAndThrowIfNotFound(nugetFramework, RuntimeIdentifier); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MSBuildLog.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MSBuildLog.cs deleted file mode 100644 index c8b588499829..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ConflictResolution/MSBuildLog.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Build.Tasks.ConflictResolution -{ - internal class MSBuildLog : ILog - { - private TaskLoggingHelper logger; - public MSBuildLog(TaskLoggingHelper logger) - { - this.logger = logger; - } - - public void LogError(string message, params object[] messageArgs) - { - logger.LogError(message, messageArgs); - } - - public void LogMessage(string message, params object[] messageArgs) - { - logger.LogMessage(message, messageArgs); - } - - public void LogMessage(LogImportance importance, string message, params object[] messageArgs) - { - logger.LogMessage((MessageImportance)importance, message, messageArgs); - } - - public void LogWarning(string message, params object[] messageArgs) - { - logger.LogWarning(message, messageArgs); - } - } -} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs b/src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs index 467974379212..115b9083b6d4 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/DependencyContextBuilder.cs @@ -20,7 +20,7 @@ internal class DependencyContextBuilder private readonly VersionFolderPathResolver _versionFolderPathResolver; private readonly SingleProjectInfo _mainProjectInfo; private readonly ProjectContext _projectContext; - private IEnumerable _frameworkReferences; + private IEnumerable _referenceAssemblies; private IEnumerable _directReferences; private Dictionary _referenceProjectInfos; private IEnumerable _excludeFromPublishPackageIds; @@ -28,6 +28,8 @@ internal class DependencyContextBuilder private string _referenceAssembliesPath; private Dictionary _filteredPackages; private bool _includeMainProjectInDepsFile = true; + private HashSet _usedLibraryNames; + private Dictionary _referenceLibraryNames; public DependencyContextBuilder(SingleProjectInfo mainProjectInfo, ProjectContext projectContext) { @@ -38,17 +40,54 @@ public DependencyContextBuilder(SingleProjectInfo mainProjectInfo, ProjectContex _versionFolderPathResolver = new VersionFolderPathResolver(rootPath: null); } + /// + /// Keeps track of the Library names being used in the DependencyContext. + /// + /// + /// Since `Reference` and `PackageReference` names can conflict, we need to ensure + /// each separate Library has a unique name. Since PackageReference names are guaranteed + /// to be unique amongst other PackageReferences, start with that set, and ensure + /// Reference names are unique amongst all. + /// + private HashSet UsedLibraryNames + { + get + { + if (_usedLibraryNames == null) + { + _usedLibraryNames = new HashSet( + _projectContext.LockFile.Libraries.Select(l => l.Name), + StringComparer.OrdinalIgnoreCase); + } + + return _usedLibraryNames; + } + } + + private Dictionary ReferenceLibraryNames + { + get + { + if (_referenceLibraryNames == null) + { + _referenceLibraryNames = new Dictionary(); + } + + return _referenceLibraryNames; + } + } + public DependencyContextBuilder WithMainProjectInDepsFile(bool includeMainProjectInDepsFile) { _includeMainProjectInDepsFile = includeMainProjectInDepsFile; return this; } - public DependencyContextBuilder WithFrameworkReferences(IEnumerable frameworkReferences) + public DependencyContextBuilder WithReferenceAssemblies(IEnumerable referenceAssemblies) { - // note: Framework libraries only export compile-time stuff + // note: ReferenceAssembly libraries only export compile-time stuff // since they assume the runtime library is present already - _frameworkReferences = frameworkReferences; + _referenceAssemblies = referenceAssemblies; return this; } @@ -116,7 +155,8 @@ public DependencyContext Build() GetProjectRuntimeLibrary( _mainProjectInfo, _projectContext, - dependencyLookup) + dependencyLookup, + includeCompilationLibraries) }); } runtimeLibraries = runtimeLibraries @@ -133,12 +173,13 @@ public DependencyContext Build() GetProjectCompilationLibrary( _mainProjectInfo, _projectContext, - dependencyLookup) + dependencyLookup, + includeCompilationLibraries) }); } compilationLibraries = compilationLibraries - .Concat(GetFrameworkLibraries()) + .Concat(GetReferenceAssemblyLibraries()) .Concat(GetLibraries(compilationExports, libraryLookup, dependencyLookup, runtime: false).Cast()) .Concat(GetDirectReferenceCompilationLibraries()); } @@ -183,7 +224,8 @@ private static string GenerateRuntimeSignature(IEnumerable GetProjectDependencies( ProjectContext projectContext, - Dictionary dependencyLookup) + Dictionary dependencyLookup, + bool includeCompilationLibraries) { List dependencies = new List(); @@ -197,12 +239,17 @@ private List GetProjectDependencies( } var referenceInfos = Enumerable.Concat( - _frameworkReferences ?? Enumerable.Empty(), + includeCompilationLibraries && _referenceAssemblies != null ? + _referenceAssemblies : + Enumerable.Empty(), _directReferences ?? Enumerable.Empty()); foreach (ReferenceInfo referenceInfo in referenceInfos) { - dependencies.Add(new Dependency(referenceInfo.Name, referenceInfo.Version)); + dependencies.Add( + new Dependency( + GetReferenceLibraryName(referenceInfo), + referenceInfo.Version)); } return dependencies; @@ -239,14 +286,16 @@ private RuntimeLibrary CreateRuntimeLibrary( runtimeStoreManifestName: runtimeStoreManifestName, serviceable: serviceable); } + private RuntimeLibrary GetProjectRuntimeLibrary( SingleProjectInfo projectInfo, ProjectContext projectContext, - Dictionary dependencyLookup) + Dictionary dependencyLookup, + bool includeCompilationLibraries) { RuntimeAssetGroup[] runtimeAssemblyGroups = new[] { new RuntimeAssetGroup(string.Empty, projectInfo.OutputName) }; - List dependencies = GetProjectDependencies(projectContext, dependencyLookup); + List dependencies = GetProjectDependencies(projectContext, dependencyLookup, includeCompilationLibraries); return CreateRuntimeLibrary( type: "project", @@ -263,9 +312,10 @@ private RuntimeLibrary GetProjectRuntimeLibrary( private CompilationLibrary GetProjectCompilationLibrary( SingleProjectInfo projectInfo, ProjectContext projectContext, - Dictionary dependencyLookup) + Dictionary dependencyLookup, + bool includeCompilationLibraries) { - List dependencies = GetProjectDependencies(projectContext, dependencyLookup); + List dependencies = GetProjectDependencies(projectContext, dependencyLookup, includeCompilationLibraries); return new CompilationLibrary( type: "project", @@ -452,12 +502,12 @@ private IEnumerable GetCompileTimeAssemblies(LockFileTargetLibrary targe } } - private IEnumerable GetFrameworkLibraries() + private IEnumerable GetReferenceAssemblyLibraries() { - return _frameworkReferences + return _referenceAssemblies ?.Select(r => new CompilationLibrary( type: "referenceassembly", - name: r.Name, + name: GetReferenceLibraryName(r), version: r.Version, hash: string.Empty, assemblies: new[] { ResolveFrameworkReferencePath(r.FullPath) }, @@ -485,7 +535,7 @@ private IEnumerable GetDirectReferenceRuntimeLibraries() return _directReferences ?.Select(r => CreateRuntimeLibrary( type: "reference", - name: r.Name, + name: GetReferenceLibraryName(r), version: r.Version, hash: string.Empty, runtimeAssemblyGroups: new[] { new RuntimeAssetGroup(string.Empty, r.FileName) }, @@ -502,7 +552,7 @@ private IEnumerable GetDirectReferenceCompilationLibraries() return _directReferences ?.Select(r => new CompilationLibrary( type: "reference", - name: r.Name, + name: GetReferenceLibraryName(r), version: r.Version, hash: string.Empty, assemblies: new[] { r.FileName }, @@ -512,6 +562,38 @@ private IEnumerable GetDirectReferenceCompilationLibraries() Enumerable.Empty(); } + private string GetReferenceLibraryName(ReferenceInfo reference) + { + if (!ReferenceLibraryNames.TryGetValue(reference, out string name)) + { + // Reference names can conflict with PackageReference names, so + // ensure that the Reference names are unique when creating libraries + name = GetUniqueReferenceName(reference.Name); + + ReferenceLibraryNames.Add(reference, name); + UsedLibraryNames.Add(name); + } + + return name; + } + + private string GetUniqueReferenceName(string name) + { + if (UsedLibraryNames.Contains(name)) + { + string startingName = $"{name}.Reference"; + name = startingName; + + int suffix = 1; + while (UsedLibraryNames.Contains(name)) + { + name = $"{startingName}{suffix++}"; + } + } + + return name; + } + private static IEnumerable CreateResourceAssemblies(IEnumerable resourceAssemblyInfos) { return resourceAssemblyInfos diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs b/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs index 8d82f5b554d5..c4fbc9cfd5b6 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/EmbedAppNameInHost.cs @@ -59,7 +59,15 @@ protected override void ExecuteCore() { Directory.CreateDirectory(destinationDirectory); } - File.WriteAllBytes(ModifiedAppHostPath, array); + + // Copy AppHostSourcePath to ModifiedAppHostPath so it inherits the same attributes\permissions. + File.Copy(AppHostSourcePath, ModifiedAppHostPath); + + // Re-write ModifiedAppHostPath with the proper contents. + using (FileStream fs = new FileStream(ModifiedAppHostPath, FileMode.Truncate, FileAccess.ReadWrite, FileShare.Read)) + { + fs.Write(array, 0, array.Length); + } } // See: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/FilterResolvedFiles.cs b/src/Tasks/Microsoft.NET.Build.Tasks/FilterResolvedFiles.cs new file mode 100644 index 000000000000..89df3493a65b --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/FilterResolvedFiles.cs @@ -0,0 +1,99 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Collections.Generic; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System.Globalization; +using NuGet.ProjectModel; +using NuGet.Packaging.Core; +using NuGet.Versioning; + +namespace Microsoft.NET.Build.Tasks +{ + /// + /// Filters out the assemblies from the list based on a given package closure. + /// + public class FilterResolvedFiles : TaskBase + { + private readonly List _assembliesToPublish = new List(); + private readonly List _packagesResolved = new List(); + + [Required] + public string AssetsFilePath { get; set; } + + [Required] + public ITaskItem[] ResolvedFiles { get; set; } + + [Required] + public ITaskItem[] PackagesToPrune { get; set; } + + [Required] + public string TargetFramework { get; set; } + + public string RuntimeIdentifier { get; set; } + + public string PlatformLibraryName { get; set; } + + public bool IsSelfContained { get; set; } + + /// + /// All the assemblies to publish. + /// + [Output] + public ITaskItem[] AssembliesToPublish + { + get; private set; + } + [Output] + public ITaskItem[] PublishedPackges + { + get; private set; + } + + protected override void ExecuteCore() + { + var lockFileCache = new LockFileCache(BuildEngine4); + LockFile lockFile = lockFileCache.GetLockFile(AssetsFilePath); + + ProjectContext projectContext = lockFile.CreateProjectContext( + NuGetUtils.ParseFrameworkName(TargetFramework), + RuntimeIdentifier, + PlatformLibraryName, + IsSelfContained); + + var packageClosure = new HashSet(); + + foreach ( var pakageItem in PackagesToPrune) + { + var pkgName = pakageItem.ItemSpec; + if (!string.IsNullOrEmpty(pkgName)) + { + packageClosure.UnionWith(projectContext.GetTransitiveList(pkgName)); + } + } + + var packagesToPublish = new HashSet(); + foreach (var resolvedFile in ResolvedFiles) + { + var resolvedPkg = ItemUtilities.GetPackageIdentity(resolvedFile); + + if (resolvedPkg != null && !packageClosure.Contains(resolvedPkg)) + { + _assembliesToPublish.Add(resolvedFile); + packagesToPublish.Add(resolvedPkg); + + } + } + AssembliesToPublish = _assembliesToPublish.ToArray(); + + foreach (var resolvedPkg in packagesToPublish) + { + TaskItem item = new TaskItem(resolvedPkg.Id); + item.SetMetadata("Version", resolvedPkg.Version.ToString()); + _packagesResolved.Add(item); + } + PublishedPackges = _packagesResolved.ToArray(); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs index a43abb5a11d2..b9cd8b077b0d 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs @@ -57,6 +57,9 @@ public class GenerateDepsFile : TaskBase [Required] public ITaskItem[] ReferenceSatellitePaths { get; set; } + [Required] + public ITaskItem[] ReferenceAssemblies { get; set; } + [Required] public ITaskItem[] FilesToSkip { get; set; } @@ -111,8 +114,8 @@ protected override void ExecuteCore() AssemblyVersion, AssemblySatelliteAssemblies); - IEnumerable frameworkReferences = - ReferenceInfo.CreateFrameworkReferenceInfos(ReferencePaths); + IEnumerable referenceAssemblyInfos = + ReferenceInfo.CreateReferenceInfos(ReferenceAssemblies); IEnumerable directReferences = ReferenceInfo.CreateDirectReferenceInfos(ReferencePaths, ReferenceSatellitePaths); @@ -131,7 +134,7 @@ protected override void ExecuteCore() DependencyContext dependencyContext = new DependencyContextBuilder(mainProject, projectContext) .WithMainProjectInDepsFile(IncludeMainProject) - .WithFrameworkReferences(frameworkReferences) + .WithReferenceAssemblies(referenceAssemblyInfos) .WithDirectReferences(directReferences) .WithReferenceProjectInfos(referenceProjects) .WithExcludeFromPublishAssets(excludeFromPublishAssets) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs index 90fd739dfe00..9a284232652f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs @@ -43,6 +43,8 @@ public class GenerateRuntimeConfigurationFiles : TaskBase public ITaskItem[] HostConfigurationOptions { get; set; } + public ITaskItem[] AdditionalProbingPaths { get; set; } + public bool IsSelfContained { get; set; } List _filesWritten = new List(); @@ -55,6 +57,13 @@ public ITaskItem[] FilesWritten protected override void ExecuteCore() { + bool writeDevRuntimeConfig = !string.IsNullOrEmpty(RuntimeConfigDevPath); + + if (AdditionalProbingPaths?.Any() == true && !writeDevRuntimeConfig) + { + Log.LogWarning(Strings.SkippingAdditionalProbingPaths); + } + LockFile lockFile = new LockFileCache(BuildEngine4).GetLockFile(AssetsFilePath); ProjectContext projectContext = lockFile.CreateProjectContext( NuGetUtils.ParseFrameworkName(TargetFrameworkMoniker), @@ -64,7 +73,7 @@ protected override void ExecuteCore() WriteRuntimeConfig(projectContext); - if (!string.IsNullOrEmpty(RuntimeConfigDevPath)) + if (writeDevRuntimeConfig) { WriteDevRuntimeConfig(projectContext); } @@ -181,13 +190,22 @@ private void WriteDevRuntimeConfig(ProjectContext projectContext) private void AddAdditionalProbingPaths(RuntimeOptions runtimeOptions, ProjectContext projectContext) { - foreach (var packageFolder in projectContext.LockFile.PackageFolders) + if (runtimeOptions.AdditionalProbingPaths == null) { - if (runtimeOptions.AdditionalProbingPaths == null) + runtimeOptions.AdditionalProbingPaths = new List(); + } + + // Add the specified probing paths first so they are probed first + if (AdditionalProbingPaths?.Any() == true) + { + foreach (var additionalProbingPath in AdditionalProbingPaths) { - runtimeOptions.AdditionalProbingPaths = new List(); + runtimeOptions.AdditionalProbingPaths.Add(additionalProbingPath.ItemSpec); } + } + foreach (var packageFolder in projectContext.LockFile.PackageFolders) + { // DotNetHost doesn't handle additional probing paths with a trailing slash runtimeOptions.AdditionalProbingPaths.Add(EnsureNoTrailingDirectorySeparator(packageFolder.Path)); } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.NuGet.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.NuGet.cs new file mode 100644 index 000000000000..ebf5e66d8870 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ItemUtilities.NuGet.cs @@ -0,0 +1,27 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using NuGet.Packaging.Core; +using NuGet.Versioning; + +namespace Microsoft.NET.Build.Tasks +{ + internal static partial class ItemUtilities + { + public static PackageIdentity GetPackageIdentity(ITaskItem item) + { + string packageName = item.GetMetadata(MetadataKeys.PackageName); + string packageVersion = item.GetMetadata(MetadataKeys.PackageVersion); + + if (string.IsNullOrEmpty(packageName) || string.IsNullOrEmpty(packageVersion)) + { + return null; + } + + return new PackageIdentity( + packageName, + NuGetVersion.Parse(packageVersion)); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/LockFileExtensions.cs b/src/Tasks/Microsoft.NET.Build.Tasks/LockFileExtensions.cs index 6e0fe73d4629..5ac26b84036d 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/LockFileExtensions.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/LockFileExtensions.cs @@ -12,6 +12,33 @@ namespace Microsoft.NET.Build.Tasks { internal static class LockFileExtensions { + public static LockFileTarget GetTargetAndThrowIfNotFound(this LockFile lockFile, NuGetFramework framework, string runtime) + { + LockFileTarget lockFileTarget = lockFile.GetTarget(framework, runtime); + + if (lockFileTarget == null) + { + string frameworkString = framework.DotNetFrameworkName; + string targetMoniker = string.IsNullOrEmpty(runtime) ? + frameworkString : + $"{frameworkString}/{runtime}"; + + string message; + if (string.IsNullOrEmpty(runtime)) + { + message = string.Format(Strings.AssetsFileMissingTarget, lockFile.Path, targetMoniker, framework.GetShortFolderName()); + } + else + { + message = string.Format(Strings.AssetsFileMissingRuntimeIdentifier, lockFile.Path, targetMoniker, framework.GetShortFolderName(), runtime); + } + + throw new BuildErrorException(message); + } + + return lockFileTarget; + } + public static ProjectContext CreateProjectContext( this LockFile lockFile, NuGetFramework framework, @@ -28,17 +55,7 @@ public static ProjectContext CreateProjectContext( throw new ArgumentNullException(nameof(framework)); } - LockFileTarget lockFileTarget = lockFile.GetTarget(framework, runtime); - - if (lockFileTarget == null) - { - string frameworkString = framework.DotNetFrameworkName; - string targetMoniker = string.IsNullOrEmpty(runtime) ? - frameworkString : - $"{frameworkString}/{runtime}"; - - throw new BuildErrorException(Strings.AssetsFileMissingTarget, lockFile.Path, targetMoniker, framework.GetShortFolderName(), runtime); - } + var lockFileTarget = lockFile.GetTargetAndThrowIfNotFound(framework, runtime); LockFileTargetLibrary platformLibrary = lockFileTarget.GetLibrary(platformLibraryName); bool isFrameworkDependent = platformLibrary != null && (!isSelfContained || string.IsNullOrEmpty(lockFileTarget.RuntimeIdentifier)); @@ -95,17 +112,44 @@ public static HashSet GetPlatformExclusionList( return exclusionList; } + public static HashSet GetTransitivePackagesList( + this LockFileTarget lockFileTarget, + LockFileTargetLibrary package, + IDictionary libraryLookup) + { + var exclusionList = new HashSet(); + + exclusionList.Add(new PackageIdentity(package.Name, package.Version)); + CollectDependencies(libraryLookup, package.Dependencies, exclusionList); + + return exclusionList; + } + private static void CollectDependencies( IDictionary libraryLookup, IEnumerable dependencies, HashSet exclusionList) + { + var excludedPackages = new HashSet(); + CollectDependencies(libraryLookup, dependencies, excludedPackages); + + foreach (var pkg in excludedPackages) + { + exclusionList.Add(pkg.Id); + } + } + + private static void CollectDependencies( + IDictionary libraryLookup, + IEnumerable dependencies, + HashSet exclusionList) { foreach (PackageDependency dependency in dependencies) { LockFileTargetLibrary library = libraryLookup[dependency.Id]; if (library.Version.Equals(dependency.VersionRange.MinVersion)) { - if (exclusionList.Add(library.Name)) + if (exclusionList.Add(new PackageIdentity(library.Name, library.Version))) { CollectDependencies(libraryLookup, library.Dependencies, exclusionList); } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj b/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj index d98ebd7e7196..71cf696cf101 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj +++ b/src/Tasks/Microsoft.NET.Build.Tasks/Microsoft.NET.Build.Tasks.csproj @@ -29,33 +29,40 @@ + + + + Common\%(RecursiveDir)\%(FileName)%(Extension) + - + + Resources\xlf\%(FileName)%(Extension) + + + Resources\%(FileName)%(Extension) ResXFileCodeGenerator Strings.Designer.cs Microsoft.NET.Build.Tasks - - Strings.resx - - - true - true + + Resources\%(FileName)%(Extension) + True + True Strings.resx - + %(None.PackagePath)\%(None.RecursiveDir)%(None.Filename)%(None.Extension) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.NuGet.cs b/src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.NuGet.cs new file mode 100644 index 000000000000..d43e92dfdb67 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/NuGetUtils.NuGet.cs @@ -0,0 +1,41 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using NuGet.Frameworks; +using NuGet.Packaging.Core; +using NuGet.ProjectModel; + +namespace Microsoft.NET.Build.Tasks +{ + internal static partial class NuGetUtils + { + public static bool IsPlaceholderFile(string path) + { + return string.Equals(Path.GetFileName(path), PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal); + } + + public static IEnumerable FilterPlaceHolderFiles(this IEnumerable files) + { + return files.Where(f => !IsPlaceholderFile(f.Path)); + } + + public static string GetLockFileLanguageName(string projectLanguage) + { + switch (projectLanguage) + { + case "C#": return "cs"; + case "F#": return "fs"; + default: return projectLanguage?.ToLowerInvariant(); + } + } + + public static NuGetFramework ParseFrameworkName(string frameworkName) + { + return frameworkName == null ? null : NuGetFramework.Parse(frameworkName); + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs b/src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs index 2737cd2bc1e3..6c400639b780 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/PreprocessPackageDependenciesDesignTime.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; @@ -22,6 +23,7 @@ public class PreprocessPackageDependenciesDesignTime : TaskBase public const string DependenciesMetadata = "Dependencies"; public const string CompileTimeAssemblyMetadata = "CompileTimeAssembly"; public const string ResolvedMetadata = "Resolved"; + public const string VisibleMetadata = "Visible"; [Required] public ITaskItem[] TargetDefinitions { get; set; } @@ -41,6 +43,12 @@ public class PreprocessPackageDependenciesDesignTime : TaskBase [Required] public string DefaultImplicitPackages { get; set; } + [Required] + public ITaskItem[] References { get; set; } + + [Required] + public string TargetFrameworkMoniker { get; set; } + public ITaskItem[] InputDiagnosticMessages { get; set; } [Output] @@ -63,6 +71,8 @@ public class PreprocessPackageDependenciesDesignTime : TaskBase private HashSet ImplicitPackageReferences { get; set; } + private ITaskItem[] ExistingReferenceItemDependencies { get; set; } + protected override void ExecuteCore() { ImplicitPackageReferences = GetImplicitPackageReferences(DefaultImplicitPackages); @@ -72,6 +82,7 @@ protected override void ExecuteCore() PopulatePackages(); PopulateAssemblies(); + PopulateExistingReferenceItems(); InputDiagnosticMessages = InputDiagnosticMessages ?? Array.Empty(); PopulateDiagnosticsMap(); @@ -93,6 +104,8 @@ protected override void ExecuteCore() return string.IsNullOrEmpty(fileGroup) || !fileGroup.Equals(CompileTimeAssemblyMetadata); }); + AddDependenciesToTheWorld(Assemblies, ExistingReferenceItemDependencies); + AddDependenciesToTheWorld(DiagnosticsMap, InputDiagnosticMessages); // prepare output collection: add corresponding metadata to ITaskItem based in item type @@ -182,6 +195,69 @@ private void PopulateAssemblies() } } + /// + /// Update FileDefinitions and FileDependencies to pretend that certain Reference items + /// explicitly added by a .targets file in the NETStandard.Library are actually normal + /// package items. This allows them to show up properly under the "SDK" node in Solution + /// Explorer, rather than just under the "Assemblies" node. + /// + /// This is not meant to be a general mechanism for injecting files that can't be handled + /// through the normal NuGet package mechanisms. + /// + private void PopulateExistingReferenceItems() + { + var existingReferenceItemDependencies = new List(); + foreach (var reference in References) + { + var packageName = reference.GetMetadata("NuGetPackageId"); + var packageVersion = reference.GetMetadata("NuGetPackageVersion"); + + // This is not a "pre-resolved" assembly; skip it. + if (packageName == null || packageVersion == null) + { + continue; + } + + // If we don't know about the specified package, skip it. + var packageId = $"{packageName}/{packageVersion}"; + if (!Packages.TryGetValue(packageId, out ItemMetadata packageItemMetadata)) + { + continue; + } + + // If the file isn't actually a part of the package, skip it. + var packageMetadata = (PackageMetadata)packageItemMetadata; + if (!reference.ItemSpec.StartsWith(packageMetadata.Path, StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + var referenceRelativePath = reference.ItemSpec.Substring(packageMetadata.Path.Length).Trim('\\'); + var referenceKey = $"{packageId}/{referenceRelativePath.Replace('\\', '/')}"; + + // If we already know about the assembly file, skip it. + if (Assemblies.TryGetValue(referenceKey, out ItemMetadata assemblyItemMetadata)) + { + continue; + } + + // Create the appropriate metadata. + var name = Path.GetFileName(referenceKey); + var facadeMetadata = reference.GetBooleanMetadata("Facade"); + var visible = facadeMetadata.HasValue ? !facadeMetadata.Value : true; + var assembly = new ExistingReferenceItemMetadata(name, reference.ItemSpec, visible); + Assemblies[referenceKey] = assembly; + + // Create the file dependency. + existingReferenceItemDependencies.Add(new ExistingReferenceItemDependency( + referenceKey, + TargetFrameworkMoniker, + packageId)); + } + + ExistingReferenceItemDependencies = existingReferenceItemDependencies.ToArray(); + } + private void PopulateDiagnosticsMap() { foreach (var diagnostic in InputDiagnosticMessages) @@ -236,7 +312,7 @@ private void AddDependenciesToTheWorld(Dictionary items, var currentPackageUniqueId = $"{parentTargetId}/{currentItemId}"; // add current package to dependencies world - var currentItem = items[currentItemId]; + var currentItem = GetItem(items, currentItemId); DependenciesWorld[currentPackageUniqueId] = currentItem; // update parent @@ -255,11 +331,11 @@ private void AddDependenciesToTheWorld(Dictionary items, // Update parent's Dependencies count and make sure parent is in the dependencies world if (!string.IsNullOrEmpty(parentPackageId)) { - parentDependency = Packages[parentPackageId]; + parentDependency = GetItem(Packages, parentPackageId); } else { - parentDependency = Targets[parentTargetId]; + parentDependency = GetItem(Targets, parentTargetId); currentItem.IsTopLevelDependency = true; } @@ -269,12 +345,18 @@ private void AddDependenciesToTheWorld(Dictionary items, } } + private ItemMetadata GetItem(Dictionary items, string id) + { + return Targets.Count > 1 ? items[id].Clone() : items[id]; + } + private abstract class ItemMetadata { - public ItemMetadata(DependencyType type) + public ItemMetadata(DependencyType type, IList dependencies = null, bool isTopLevelDependency = false) { Type = type; - Dependencies = new List(); + Dependencies = dependencies == null ? new List() : new List(dependencies); + IsTopLevelDependency = isTopLevelDependency; } public DependencyType Type { get; protected set; } @@ -291,6 +373,11 @@ public ItemMetadata(DependencyType type) /// /// public abstract IDictionary ToDictionary(); + + /// + /// Creates a copy of the item + /// + public abstract ItemMetadata Clone(); } private class TargetMetadata : ItemMetadata @@ -304,6 +391,22 @@ public TargetMetadata(ITaskItem item) FrameworkVersion = item.GetMetadata(MetadataKeys.FrameworkVersion) ?? string.Empty; } + private TargetMetadata( + DependencyType type, + IList dependencies, + bool isTopLevelDependency, + string runtimeIdentifier, + string targetFrameworkMoniker, + string frameworkName, + string frameworkVersion) + : base(type, dependencies, isTopLevelDependency) + { + RuntimeIdentifier = runtimeIdentifier; + TargetFrameworkMoniker = targetFrameworkMoniker; + FrameworkName = frameworkName; + FrameworkVersion = frameworkVersion; + } + public string RuntimeIdentifier { get; } public string TargetFrameworkMoniker { get; } public string FrameworkName { get; } @@ -321,6 +424,18 @@ public override IDictionary ToDictionary() { DependenciesMetadata, string.Join(";", Dependencies) } }; } + + public override ItemMetadata Clone() + { + return new TargetMetadata( + Type, + Dependencies, + IsTopLevelDependency, + RuntimeIdentifier, + TargetFrameworkMoniker, + FrameworkName, + FrameworkVersion); + } } private class PackageMetadata : ItemMetadata @@ -336,6 +451,24 @@ public PackageMetadata(ITaskItem item) : item.GetMetadata(MetadataKeys.Path)) ?? string.Empty; } + protected PackageMetadata( + DependencyType type, + IList dependencies, + bool isTopLevelDependency, + string name, + string version, + string path, + bool resolved, + bool isImplicitlyDefined) + : base(type, dependencies, isTopLevelDependency) + { + Name = name; + Version = version; + Path = path; + Resolved = resolved; + IsImplicitlyDefined = isImplicitlyDefined; + } + public string Name { get; protected set; } public string Version { get; } public string Path { get; } @@ -356,6 +489,19 @@ public override IDictionary ToDictionary() { DependenciesMetadata, string.Join(";", Dependencies) } }; } + + public override ItemMetadata Clone() + { + return new PackageMetadata( + Type, + Dependencies, + IsTopLevelDependency, + Name, + Version, + Path, + Resolved, + IsImplicitlyDefined); + } } private class AssemblyMetadata : PackageMetadata @@ -370,6 +516,51 @@ public AssemblyMetadata(DependencyType type, } } + /// + /// Represents metadata for a Reference item that we want to pretend was resolved as a + /// standard NuGet package assembly. + /// + private class ExistingReferenceItemMetadata : ItemMetadata + { + public ExistingReferenceItemMetadata(string name, string path, bool visible) + : base( + type: DependencyType.Assembly, + dependencies: null, + isTopLevelDependency: false) + { + Name = name; + Path = path; + Visible = visible; + } + + public string Name { get; } + public string Path { get; } + public bool Visible { get; } + + public override IDictionary ToDictionary() + { + return new Dictionary + { + { MetadataKeys.Name, Name }, + { MetadataKeys.Path, Path }, + { MetadataKeys.Type, Type.ToString() }, + { MetadataKeys.IsImplicitlyDefined, "false" }, + { MetadataKeys.IsTopLevelDependency, "false" }, + { ResolvedMetadata, "true" }, + { VisibleMetadata, Visible.ToString() }, + { DependenciesMetadata, string.Empty } + }; + } + + public override ItemMetadata Clone() + { + return new ExistingReferenceItemMetadata( + Name, + Path, + Visible); + } + } + private sealed class DiagnosticMetadata : ItemMetadata { public DiagnosticMetadata(ITaskItem item) @@ -385,6 +576,30 @@ public DiagnosticMetadata(ITaskItem item) EndColumn = item.GetMetadata(MetadataKeys.EndColumn) ?? string.Empty; } + private DiagnosticMetadata( + DependencyType type, + IList dependencies, + bool isTopLevelDependency, + string diagnosticCode, + string message, + string filePath, + string severity, + string startLine, + string startColumn, + string endLine, + string endColumn) + : base(type, dependencies, isTopLevelDependency) + { + DiagnosticCode = diagnosticCode; + Message = message; + FilePath = filePath; + Severity = severity; + StartLine = startLine; + StartColumn = startColumn; + EndLine = endLine; + EndColumn = endColumn; + } + public string DiagnosticCode { get; } public string Message { get; } public string FilePath { get; } @@ -411,6 +626,78 @@ public override IDictionary ToDictionary() { DependenciesMetadata, string.Join(";", Dependencies) } }; } + + public override ItemMetadata Clone() + { + return new DiagnosticMetadata( + Type, + Dependencies, + IsTopLevelDependency, + DiagnosticCode, + Message, + FilePath, + Severity, + StartLine, + StartColumn, + EndLine, + EndColumn); + } + } + + /// + /// Represents the FileDependency metadata for a Reference item that we want to pretend was + /// resolved as a standard NuGet package assembly. + /// + private sealed class ExistingReferenceItemDependency : ITaskItem + { + private readonly Dictionary _metadata = new Dictionary(capacity: 3, comparer: StringComparer.OrdinalIgnoreCase); + + public ExistingReferenceItemDependency(string itemSpec, string parentTarget, string parentPackage) + { + ItemSpec = itemSpec; + _metadata[MetadataKeys.FileGroup] = CompileTimeAssemblyMetadata; + _metadata[MetadataKeys.ParentTarget] = parentTarget; + _metadata[MetadataKeys.ParentPackage] = parentPackage; + } + + public string ItemSpec { get; set; } + + public ICollection MetadataNames => _metadata.Keys; + + public int MetadataCount => _metadata.Count; + + public IDictionary CloneCustomMetadata() + { + return new Dictionary(_metadata, _metadata.Comparer); + } + + public void CopyMetadataTo(ITaskItem destinationItem) + { + foreach (var pair in _metadata) + { + destinationItem.SetMetadata(pair.Key, pair.Value); + } + } + + public string GetMetadata(string metadataName) + { + if (_metadata.TryGetValue(metadataName, out string metadataValue)) + { + return metadataValue; + } + + return null; + } + + public void RemoveMetadata(string metadataName) + { + _metadata.Remove(metadataName); + } + + public void SetMetadata(string metadataName, string metadataValue) + { + _metadata[metadataName] = metadataValue; + } } internal static HashSet GetImplicitPackageReferences(string defaultImplicitPackages) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs index 87e21e9f3977..b2bfc47ebf32 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProjectContext.cs @@ -99,6 +99,16 @@ public IEnumerable GetRuntimeLibraries(IEnumerable GetTransitiveList(string package) + { + LockFileTargetLibrary platformLibrary = _lockFileTarget.GetLibrary(package); + IEnumerable runtimeLibraries = _lockFileTarget.Libraries; + Dictionary libraryLookup = + runtimeLibraries.ToDictionary(e => e.Name, StringComparer.OrdinalIgnoreCase); + + return _lockFileTarget.GetTransitivePackagesList(platformLibrary, libraryLookup); + } + public IEnumerable GetCompileLibraries(IEnumerable compileExcludeFromPublishPackageIds) { IEnumerable compileLibraries = _lockFileTarget.Libraries; diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/PublishAssembliesResolver.cs b/src/Tasks/Microsoft.NET.Build.Tasks/PublishAssembliesResolver.cs index c5ac7296d605..2e082a1bd500 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/PublishAssembliesResolver.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/PublishAssembliesResolver.cs @@ -12,7 +12,6 @@ namespace Microsoft.NET.Build.Tasks { internal class PublishAssembliesResolver { - private HashSet _allResolvedPackages = new HashSet(); private readonly IPackageResolver _packageResolver; private IEnumerable _excludeFromPublishPackageIds; private bool _preserveStoreLayout; @@ -42,14 +41,13 @@ public IEnumerable Resolve(ProjectContext projectContext) { continue; } - - _allResolvedPackages.Add(new PackageIdentity(targetLibrary.Name, targetLibrary.Version)); + var targetLibraryPackage = new PackageIdentity(targetLibrary.Name, targetLibrary.Version); string pkgRoot; string libraryPath = _packageResolver.GetPackageDirectory(targetLibrary.Name, targetLibrary.Version, out pkgRoot); - results.AddRange(GetResolvedFiles(targetLibrary.RuntimeAssemblies, libraryPath, pkgRoot, AssetType.Runtime)); - results.AddRange(GetResolvedFiles(targetLibrary.NativeLibraries, libraryPath, pkgRoot, AssetType.Native)); + results.AddRange(GetResolvedFiles(targetLibrary.RuntimeAssemblies, targetLibraryPackage, libraryPath, pkgRoot, AssetType.Runtime)); + results.AddRange(GetResolvedFiles(targetLibrary.NativeLibraries, targetLibraryPackage, libraryPath, pkgRoot, AssetType.Native)); foreach (LockFileRuntimeTarget runtimeTarget in targetLibrary.RuntimeTargets.FilterPlaceHolderFiles()) { @@ -66,6 +64,7 @@ public IEnumerable Resolve(ProjectContext projectContext) destinationSubDirectory: GetDestinationSubDirectory(sourcePath, pkgRoot, GetRuntimeTargetDestinationSubDirectory(runtimeTarget)), + package: targetLibraryPackage, assetType: _assetType)); } } @@ -85,6 +84,7 @@ public IEnumerable Resolve(ProjectContext projectContext) new ResolvedFile( sourcePath: sourcePath, destinationSubDirectory: locale, + package: targetLibraryPackage, assetType: AssetType.Resources)); } } @@ -92,12 +92,7 @@ public IEnumerable Resolve(ProjectContext projectContext) return results; } - public IEnumerable GetResolvedPackages() - { - return _allResolvedPackages; - } - - private IEnumerable GetResolvedFiles(IEnumerable items, string libraryPath, string pkgRoot, AssetType assetType) + private IEnumerable GetResolvedFiles(IEnumerable items, PackageIdentity package, string libraryPath, string pkgRoot, AssetType assetType) { foreach (LockFileItem item in items.FilterPlaceHolderFiles()) { @@ -106,6 +101,7 @@ private IEnumerable GetResolvedFiles(IEnumerable ite yield return new ResolvedFile( sourcePath: srcpath, destinationSubDirectory: GetDestinationSubDirectory(srcpath, pkgRoot), + package: package, assetType: assetType); } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ReferenceInfo.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ReferenceInfo.cs index 9c85935f139a..868cbd89a9be 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ReferenceInfo.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ReferenceInfo.cs @@ -31,19 +31,15 @@ private ReferenceInfo(string name, string version, string fullPath) _resourceAssemblies = new List(); } - public static IEnumerable CreateFrameworkReferenceInfos(IEnumerable referencePaths) + public static IEnumerable CreateReferenceInfos(IEnumerable referencePaths) { - IEnumerable frameworkReferencePaths = referencePaths - .Where(r => r.GetBooleanMetadata("FrameworkFile") == true || - r.GetMetadata("ResolvedFrom") == "ImplicitlyExpandDesignTimeFacades"); - - List frameworkReferences = new List(); - foreach (ITaskItem frameworkReferencePath in frameworkReferencePaths) + List referenceInfos = new List(); + foreach (ITaskItem referencePath in referencePaths) { - frameworkReferences.Add(CreateReferenceInfo(frameworkReferencePath)); + referenceInfos.Add(CreateReferenceInfo(referencePath)); } - return frameworkReferences; + return referenceInfos; } public static IEnumerable CreateDirectReferenceInfos( diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ReportAssetsLogMessages.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ReportAssetsLogMessages.cs new file mode 100644 index 000000000000..75af620e6ab0 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ReportAssetsLogMessages.cs @@ -0,0 +1,121 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Build.Framework; +using NuGet.Common; +using NuGet.ProjectModel; +using System.Linq; + +namespace Microsoft.NET.Build.Tasks +{ + /// + /// Report Log Messages in the assets file to MSBuild and raise them as + /// DiagnosticMessage items that can be consumed downstream (e.g. by the + /// dependency node in the solution explorer) + /// + public sealed class ReportAssetsLogMessages : TaskBase + { + private LockFile _lockFile; + + #region Outputs + + // Only output is 'DiagnosticMessages' which is in the base class TaskBase + + #endregion + + #region Inputs + + /// + /// The assets file to process + /// + [Required] + public string ProjectAssetsFile + { + get; set; + } + + #endregion + + public ReportAssetsLogMessages() + { + } + + #region Test Support + + public ReportAssetsLogMessages(LockFile lockFile, ILog logger) + : base(logger) + { + _lockFile = lockFile; + } + + #endregion + + private LockFile LockFile + { + get + { + if (_lockFile == null) + { + _lockFile = new LockFileCache(BuildEngine4).GetLockFile(ProjectAssetsFile); + } + + return _lockFile; + } + } + + protected override void ExecuteCore() + { + foreach (var message in LockFile.LogMessages) + { + AddMessage(message); + } + } + + private void AddMessage(IAssetsLogMessage message) + { + var logToMsBuild = true; + var targetGraphs = message.GetTargetGraphs(LockFile); + + targetGraphs = targetGraphs.Any() ? targetGraphs : new LockFileTarget[] { null }; + + foreach (var target in targetGraphs) + { + var targetLib = message.LibraryId == null ? null : target?.GetTargetLibrary(message.LibraryId); + + Diagnostics.Add( + message.Code.ToString(), + message.Message, + message.FilePath, + FromLogLevel(message.Level), + message.StartLineNumber, + message.StartColumnNumber, + message.EndLineNumber, + message.EndColumnNumber, + target?.Name, + targetLib == null ? null : $"{targetLib.Name}/{targetLib.Version.ToNormalizedString()}", + logToMsBuild); + + logToMsBuild = false; // only write first instance of this diagnostic to msbuild + } + } + + private static DiagnosticMessageSeverity FromLogLevel(LogLevel level) + { + switch (level) + { + case LogLevel.Error: + return DiagnosticMessageSeverity.Error; + + case LogLevel.Warning: + return DiagnosticMessageSeverity.Warning; + + case LogLevel.Debug: + case LogLevel.Verbose: + case LogLevel.Information: + case LogLevel.Minimal: + default: + return DiagnosticMessageSeverity.Info; + } + } + } +} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageDependencies.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageDependencies.cs index 39fe9efbc6a6..d9fd035a0fe4 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageDependencies.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageDependencies.cs @@ -163,7 +163,6 @@ protected override void ExecuteCore() ReadProjectFileDependencies(); RaiseLockFileTargets(); GetPackageAndFileDefinitions(); - GetDependencyDiagnostics(); } private void ReadProjectFileDependencies() @@ -345,7 +344,6 @@ private void GetPackageDependencies( string version; if (!resolvedPackageVersions.TryGetValue(deps.Id, out version)) { - Log.LogError(Strings.UnexpectedDependencyWithNoVersionNumber, deps.Id); continue; } @@ -409,64 +407,6 @@ private void GetFileDependencies(LockFileTargetLibrary package, string targetNam } } - private void GetDependencyDiagnostics() - { - Dictionary projectDeps = LockFile.GetProjectFileDependencies(); - - // Temporarily suppress MSBuild logging because these diagnostics are also - // reported by NuGet. This will no longer be necessary when NuGet moves - // these diagnostics into the lockfile: - // - https://github.com/NuGet/Home/issues/1599 - // - https://github.com/dotnet/sdk/issues/585 - bool logToMsBuild = false; - - // if a project dependency is not in the list of libs, then it is an unresolved reference - var unresolvedDeps = projectDeps.Where(dep => - null == LockFile.Libraries.FirstOrDefault(lib => - string.Equals(lib.Name, dep.Key, StringComparison.OrdinalIgnoreCase))); - - foreach (var target in LockFile.Targets) - { - foreach (var dep in unresolvedDeps) - { - string packageId = dep.Key; - packageId += dep.Value == null ? string.Empty : $"/{dep.Value}"; - - Diagnostics.Add(nameof(Strings.NU1001), - string.Format(CultureInfo.CurrentCulture, Strings.NU1001, packageId), - ProjectPath, - DiagnosticMessageSeverity.Warning, - 1, 0, - target.Name, - packageId, - logToMSBuild: logToMsBuild - ); - } - - // report diagnostic if project dependency version does not match library version - foreach (var dep in projectDeps) - { - var library = target.Libraries.FirstOrDefault(lib => - string.Equals(lib.Name, dep.Key, StringComparison.OrdinalIgnoreCase)); - var libraryVersion = library?.Version?.ToNormalizedString(); - - if (libraryVersion != null && dep.Value != null && - !string.Equals(libraryVersion, dep.Value, StringComparison.OrdinalIgnoreCase)) - { - Diagnostics.Add(nameof(Strings.NU1012), - string.Format(CultureInfo.CurrentCulture, Strings.NU1012, library.Name, dep.Value, libraryVersion), - ProjectPath, - DiagnosticMessageSeverity.Warning, - 1, 0, - target.Name, - $"{library.Name}/{libraryVersion}", - logToMSBuild: logToMsBuild - ); - } - } - } - } - // save file type metadata based on the group the file appears in private void SaveFileKeyType(string fileKey, FileGroup fileGroup) { diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePublishAssemblies.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePublishAssemblies.cs index 175443edc6d6..662dc24d4081 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePublishAssemblies.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvePublishAssemblies.cs @@ -16,7 +16,6 @@ namespace Microsoft.NET.Build.Tasks public class ResolvePublishAssemblies : TaskBase { private readonly List _assembliesToPublish = new List(); - private readonly List _packagesResolved = new List(); [Required] public string ProjectPath { get; set; } @@ -48,12 +47,6 @@ public ITaskItem[] AssembliesToPublish get { return _assembliesToPublish.ToArray(); } } - [Output] - public ITaskItem[] PackagesResolved - { - get { return _packagesResolved.ToArray(); } - } - protected override void ExecuteCore() { var lockFileCache = new LockFileCache(BuildEngine4); @@ -90,15 +83,11 @@ protected override void ExecuteCore() TaskItem item = new TaskItem(resolvedAssembly.SourcePath); item.SetMetadata("DestinationSubPath", resolvedAssembly.DestinationSubPath); item.SetMetadata("AssetType", resolvedAssembly.Asset.ToString().ToLower()); + item.SetMetadata(MetadataKeys.PackageName, resolvedAssembly.Package.Id.ToString().ToLower()); + item.SetMetadata(MetadataKeys.PackageVersion, resolvedAssembly.Package.Version.ToString().ToLower()); _assembliesToPublish.Add(item); } - foreach (var resolvedPkg in assemblyResolver.GetResolvedPackages()) - { - TaskItem item = new TaskItem(resolvedPkg.Id); - item.SetMetadata("Version", resolvedPkg.Version.ToString()); - _packagesResolved.Add(item); - } } } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs index d2171fd74d42..7ba8ea38eff2 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs @@ -3,6 +3,7 @@ using System.IO; using System; +using NuGet.Packaging.Core; namespace Microsoft.NET.Build.Tasks { internal enum AssetType @@ -16,7 +17,7 @@ internal enum AssetType internal class ResolvedFile { public string SourcePath { get; } - + public PackageIdentity Package { get; } public string DestinationSubDirectory { get; } public AssetType Asset{ get; } public string FileName @@ -34,11 +35,13 @@ public string DestinationSubPath } } - public ResolvedFile(string sourcePath, string destinationSubDirectory, AssetType assetType = AssetType.None) + public ResolvedFile(string sourcePath, string destinationSubDirectory, PackageIdentity package, AssetType assetType = AssetType.None) { SourcePath = Path.GetFullPath(sourcePath); DestinationSubDirectory = destinationSubDirectory; Asset = assetType; + Package = package; + } public override bool Equals(object obj) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.cs.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.cs.resx deleted file mode 100644 index 8702bb040393..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.cs.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Je potřeba zadat alespoň jednu možnou cílovou platformu - - - Cílová platforma projektu {0} není kompatibilní s {1}. - - - Neplatný název platformy: {0} - - - Soubor prostředků {0} se nenašel. Pokud chcete tento soubor vygenerovat, spusťte obnovení balíčku NuGet. - - - Soubor prostředků {0} nemá cíl pro {1}. Ověřte, že jste projekt obnovili pro hodnoty TargetFramework={2} a RuntimeIdentifier={3}. - - - Cesta k souboru prostředků {0} není uvedena od kořene. Podporované jsou jen celé cesty. - - - Nelze najít informace o projektu pro {0}. Může to znamenat chybějící odkaz na projekt. - - - V souboru obsahu {0} nejsou očekávané informace o nadřízeném balíčku. - - - Chybí metadata {0} o {1} položky {2}. - - - Nerozpoznaný token preprocesoru {0} v {1}. - - - Úloha {0} musí mít hodnotu parametru {1}, aby mohla použít předem zpracovaný obsah. - - - Prostředky se použijí z projektu {0}, ale v {1} se nenašla odpovídající cesta k projektu MSBuildu. - - - Nečekaný typ souboru {0}. Typ je {1} i {2}. - - - Z údaje TargetFramework={0} nejde odvodit hodnota TargetFrameworkIdentifier ani hodnota TargetFrameworkVersion. Musí být výslovně zadané. - - - Položka obsahu pro {0} nastaví {1}, ale neposkytuje {2} ani {3}. - - - Token preprocesoru {0} získal víc hodnot než jednu. Volba hodnoty {1}. - - - Při generování satelitního sestavení {0} došlo k chybám. - - - Nepodařilo se najít vyhodnocenou cestu pro {0}. - - - Nečekaná závislost {0} bez čísla verze. - - - Před zpracováním prostředků je potřeba nakonfigurovat preprocesor prostředků. - - - Neplatný řetězec verze NuGet: {0} - - - Nenainstalovaná platforma: {0} v {1} - - - Není zadaný adresář referenčních sestavení. K nastavení umístění použijte proměnnou prostředí DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Následující závislosti jsou označené typem „platform“, ale tento typ může mít jenom jedna závislost: {0} - - - Soubor zámku se nedá přečíst. - - - Soubor projektu neexistuje {0}. - - - Závislost {0} se nepodařilo vyřešit. - - - Závislost {0} v projektu {1} nepodporuje platformu {2}. - - - {0}. Ke generování nového souboru prostředků prosím použijte příkaz „dotnet restore“. - - - Zadaná závislost byla {0}, ale skončila s {1}. - - - {0} není podporovaná platforma. - - - Očekávaný soubor prostředků neexistuje. Ke generování nového souboru prostředků prosím použijte příkaz „dotnet restore“. - - - Typ závislosti se změnil. - - - Cíl závislosti {0} není podporovaný. - - - Konflikt závislostí. {0} očekával {1}, ale přijal {2}. - - - Byl zahrnut tento počet duplicitních položek: {0}. Sada .NET SDK obsahuje standardně tento počet položek z adresáře vašeho projektu: {0}. Buď můžete tyto položky odebrat ze souboru projektu, nebo vlastnost {1} nastavit na {2}, pokud je chcete ze souboru projektu explicitně vyloučit. Duplicitní položky: {3} - - - Do projektu byl zahrnut odkaz na balíček pro {0}. Na tento balíček implicitně odkazuje sada .NET SDK, takže na něj zpravidla nemusíte odkazovat z projektu. Další informace najdete na adrese {1}. - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.de.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.de.resx deleted file mode 100644 index 4d943712c1c8..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.de.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Geben Sie mindestens ein mögliches Zielframework an. - - - Für das Projekt "{0}" ist kein mit "{1}" kompatibles Framework vorhanden. - - - Ungültiger Frameworkname: {0}. - - - Die Ressourcendatei "{0}" wurde nicht gefunden. Führen Sie eine NuGet-Paketwiederherstellung aus, um diese Datei zu generieren. - - - Die Ressourcendatei "{0}" hat kein Ziel für "{1}". Vergewissern Sie sich, dass Sie dieses Projekt für das Zielframework "{2}" und die Laufzeit-ID "{3}" wiederhergestellt haben. - - - Der Ressourcendateipfad "{0}" hat keinen Stamm. Nur vollständige Pfade werden unterstützt. - - - Die Projektinformationen für "{0}" wurden nicht gefunden. Dies ist möglicherweise auf einen fehlenden Projektverweis zurückzuführen. - - - Die Inhaltsdatei "{0}" enthält nicht die erwarteten Informationen zum übergeordneten Paket. - - - Die Metadaten "{0}" für das Element "{2}" vom Typ "{1}" sind nicht vorhanden. - - - Unbekanntes Präprozessortoken "{0}" in "{1}". - - - Die Aufgabe "{0}" muss für die Nutzung vorverarbeiteter Inhalte mit einem Wert für den Parameter "{1}" versehen werden. - - - Es werden Ressourcen aus dem Projekt "{0}" genutzt, in "{1}" wurde jedoch kein entsprechender MSBuild-Projektpfad gefunden. - - - Unerwarteter Dateityp für "{0}". Der Typ ist sowohl "{1}" als auch "{2}". - - - "TargetFrameworkIdentifier" und/oder "TargetFrameworkVersion" kann nicht von "TargetFramework='{0}'" abgeleitet werden. Sie müssen explizit angegeben werden. - - - Das Inhaltselement für "{0}" legt "{1}" fest, gibt aber "{2}" oder "{3}" nicht an. - - - Das Präprozessortoken "{0}" wurde mit mehreren Werten versehen. "{1}" wird als Wert ausgewählt. - - - Fehler beim Ausgeben der Satellitenassembly "{0}". - - - Der aufgelöste Pfad für "{0}" wurde nicht gefunden. - - - Unerwartete Abhängigkeit "{0}" ohne Versionsnummer. - - - Der Ressourcenpräprozessor muss konfiguriert werden, bevor Ressourcen verarbeitet werden. - - - Ungültige NuGet-Versionszeichenfolge: {0}. - - - Framework nicht installiert: {0} in {1} - - - Das Verzeichnis für Verweisassemblys wurde nicht angegeben. Sie können den Speicherort mit der Umgebungsvariablen DOTNET_REFERENCE_ASSEMBLIES_PATH festlegen. - - - Die folgenden Abhängigkeiten sind mit dem Typ "platform" gekennzeichnet, doch nur eine Abhängigkeit kann diesen Typ haben: {0}. - - - Fehler beim Lesen der Sperrdatei - - - Die Projektdatei ist nicht vorhanden: "{0}". - - - Die Abhängigkeit "{0}" konnte nicht aufgelöst werden. - - - Die Abhängigkeit "{0}" in Projekt "{1}" unterstützt das Framework "{2}" nicht. - - - {0}. Bitte führen Sie "dotnet restore" aus, um eine neue Ressourcendatei zu erzeugen. - - - Angegeben war Abhängigkeit "{0}", die tatsächliche Abhängigkeit war aber "{1}". - - - {0} ist ein nicht unterstütztes Framework. - - - Die erwartete Ressourcendatei ist nicht vorhanden. Bitte führen Sie "dotnet restore" aus, um eine neue Ressourcendatei zu erzeugen. - - - Der Abhängigkeitstyp wurde geändert. - - - Das Abhängigkeitsziel "{0}" wird nicht unterstützt. - - - Abhängigkeitskonflikt. "{0}" hat "{1}" erwartet, empfangen wurde jedoch "{2}". - - - Doppelte "{0}"-Elemente sind vorhanden. Das .NET SDK enthält standardmäßig "{0}"-Elemente aus ihrem Projektverzeichnis. Sie können entweder diese Elemente aus der Projektdatei entfernen oder die Eigenschaft "{1}" auf "{2}" festlegen, wenn Sie sie explizit in Ihre Projektdatei einbeziehen möchten. Die doppelten Elemente waren: {3}. - - - Ein Paketverweis für "{0}" war in Ihrem Projekt vorhanden. Auf dieses Paket wird vom .NET SDK implizit verwiesen, und Sie müssen in der Regel nicht von Ihrem Projekt aus darauf verweisen. Weitere Informationen finden Sie unter {1}. - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.es.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.es.resx deleted file mode 100644 index 478388ef94eb..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.es.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Debe especificarse al menos una plataforma de destino posible. - - - El proyecto '{0}' no tiene una plataforma de destino compatible con '{1}'. - - - Nombre de plataforma no válido: '{0}'. - - - No se encuentra el archivo de recursos '{0}'. Ejecute una restauración de paquetes NuGet para generar el archivo. - - - El archivo de recursos '{0}' no tiene un destino para '{1}'. Asegúrese de que ha restaurado el proyecto para TargetFramework='{2}' y RuntimeIdentifier='{3}'. - - - La ruta de acceso del archivo de recursos '{0}' no tiene raíz. Solo se admiten rutas de acceso completas. - - - No se encuentra la información de proyecto de '{0}'. Esto puede indicar que falta una referencia de proyecto. - - - El archivo de contenido '{0}' no tiene la información de paquete primario que se esperaba. - - - Faltan los metadatos de '{0}' en el elemento de '{1}' '{2}'. - - - Token de preprocesador no reconocido '{0}' en '{1}'. - - - Debe darse un valor al parámetro '{1}' de la tarea '{0}' para poder consumir contenido preprocesado. - - - Los recursos se consumen desde el proyecto '{0}', pero no se ha encontrado la ruta de acceso de proyecto de MSBuild correspondiente en '{1}'. - - - Tipo de archivo no esperado para '{0}'. El tipo es tanto '{1}' como '{2}'. - - - No se puede inferir TargetFrameworkIdentifier y/o TargetFrameworkVersion de TargetFramework='{0}'. Deben especificarse de forma explícita. - - - El elemento de contenido de '{0}' establece '{1}', pero no proporciona '{2}' ni '{3}'. - - - Se han dado varios valores para el token de preprocesador '{0}'. Se va a elegir '{1}' como valor. - - - Se han producido errores al emitir el ensamblado satélite '{0}'. - - - No se encuentra la ruta de acceso resuelta para '{0}'. - - - Dependencia '{0}' sin número de versión no esperada. - - - Debe configurarse el preprocesador de recursos antes de que se procesen los recursos. - - - Cadena de versión de NuGet no válida: '{0}'. - - - Plataforma no instalada: {0} en {1} - - - No se especificó el directorio de ensamblados de referencia. Puede establecer la ubicación mediante la variable de entorno DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Las dependencias siguientes están marcadas con el tipo "plataforma"; sin embargo, solo una dependencia puede tener este tipo: {0} - - - No se pudo leer el archivo de bloqueo - - - El archivo de proyecto no existe "{0}". - - - No se pudo resolver la dependencia "{0}". - - - La dependencia "{0}" del proyecto "{1}" no es compatible con la plataforma "{2}". - - - {0}. Ejecute "dotnet restore" para generar un nuevo archivo de recurso. - - - La dependencia especificada era "{0}", pero finalizaba con "{1}". - - - {0} es una plataforma no compatible. - - - El archivo de recurso esperado no existe. Ejecute "dotnet restore" para generar un nuevo archivo de recurso. - - - El tipo de dependencia cambió - - - El destino de dependencia"{0}" no es compatible. - - - Conflicto de dependencia. "{0}" esperaba "{1}", pero recibió "{2}" - - - Se incluyeron "{0}" elementos duplicados. El SDK de .NET incluye "{0}" elementos de su directorio de proyecto de manera predeterminada. Puede quitar esos elementos del archivo de proyecto o establecer la propiedad "{1}" en "{2}" si desea incluirlos explícitamente en el archivo de proyecto. Los elementos duplicados eran: {3} - - - Se incluyó un elemento PackageReference para "{0}" en su proyecto. El SDK de .NET hace referencia implícita a este paquete y normalmente no tiene que hacer referencia a él desde su proyecto. Para obtener más información, consulte {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.fr.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.fr.resx deleted file mode 100644 index 6977e7615180..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.fr.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Au moins un framework cible doit être spécifié. - - - Le projet '{0}' n'a aucun framework cible compatible avec '{1}'. - - - Nom de framework non valide : '{0}'. - - - Fichier de composants '{0}' introuvable. Exécutez une restauration de package NuGet pour générer ce fichier. - - - Le fichier de composant '{0}' n'a pas de cible pour '{1}'. Vérifiez que vous avez restauré ce projet pour TargetFramework='{2}' et RuntimeIdentifier='{3}'. - - - Le chemin du fichier de composant '{0}' n'est pas associé à une racine. Seuls les chemins complets sont pris en charge. - - - Informations sur le projet introuvables pour '{0}'. Ceci peut indiquer une référence de projet manquante. - - - Le fichier de contenu '{0}' ne contient pas les informations attendues sur le package parent. - - - Métadonnées '{0}' manquantes sur l'élément '{1}' '{2}'. - - - Jeton de préprocesseur '{0}' non reconnu dans '{1}'. - - - La tâche '{0}' doit recevoir une valeur pour le paramètre '{1}' pour pouvoir consommer du contenu prétraité. - - - Les composants sont consommés à partir du projet '{0}', mais aucun chemin de projet MSBuild correspondant n'a été trouvé dans '{1}'. - - - Type de fichier inattendu pour '{0}'. Le type est à la fois '{1}' et '{2}'. - - - Impossible de déduire TargetFrameworkIdentifier et/ou TargetFrameworkVersion à partir de TargetFramework='{0}'. Ils doivent être spécifiés explicitement. - - - L'élément de contenu pour '{0}' définit '{1}', mais ne fournit ni '{2}' ni '{3}'. - - - Plusieurs valeurs ont été affectées au jeton de préprocesseur '{0}'. La valeur choisie est '{1}'. - - - Des erreurs se sont produites pendant l'émission de l'assembly satellite '{0}'. - - - Chemin résolu introuvable pour '{0}'. - - - Dépendance '{0}' sans numéro de version inattendue. - - - Le préprocesseur de composants doit être configuré avant que les composants ne soient traités. - - - Chaîne de version NuGet non valide : '{0}'. - - - Framework non installé : {0} dans {1} - - - Le répertoire des assemblys de référence n'a pas été spécifié. Vous pouvez définir l'emplacement à l'aide de la variable d'environnement DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Les dépendances suivantes sont marquées avec le type 'platform'. Toutefois, une seule dépendance peut avoir ce type : {0} - - - Échec de la lecture du fichier de verrouillage - - - Le fichier projet n'existe pas : '{0}'. - - - Impossible de résoudre la dépendance '{0}'. - - - La dépendance '{0}' du projet '{1}' ne prend pas en charge le framework '{2}'. - - - {0}. Exécutez 'dotnet restore' pour générer un nouveau fichier de composants. - - - La dépendance spécifiée était '{0}' mais se terminait par '{1}'. - - - {0} est un framework non pris en charge. - - - Le fichier de composants attendu n'existe pas. Exécutez 'dotnet restore' pour générer un nouveau fichier de composants. - - - Le type de dépendance a été changé - - - La cible de dépendance '{0}' n'est pas prise en charge. - - - Conflit de dépendances. '{0}' attendait '{1}' mais a reçu '{2}' - - - Des éléments '{0}' dupliqués ont été inclus. Le SDK .NET inclut les éléments '{0}' de votre répertoire de projet par défaut. Vous pouvez supprimer ces éléments de votre fichier projet ou affecter à la propriété '{1}' la valeur '{2}', si vous souhaitez les inclure explicitement dans votre fichier projet. Les éléments dupliqués sont les suivants : {3} - - - Un PackageReference pour '{0}' a été inclus dans votre projet. Comme ce package est implicitement référencé par le SDK .NET, vous n'avez généralement pas besoin de le référencer à partir de votre projet. Pour plus d'informations, consultez {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.it.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.it.resx deleted file mode 100644 index 67ad41d54ae1..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.it.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - È necessario specificare almeno un framework di destinazione possibile. - - - Per il progetto '{0}' non esiste alcun framework di destinazione compatibile con '{1}'. - - - Nome di framework non valido: '{0}'. - - - Il file di risorse '{0}' non è stato trovato. Per generare questo file, eseguire un ripristino del pacchetto NuGet. - - - Il file di risorse '{0}' non contiene una destinazione per '{1}'. Assicurarsi di aver ripristinato questo progetto per TargetFramework='{2}' e RuntimeIdentifier='{3}'. - - - Il percorso dei file di risorse '{0}' non contiene una radice. Sono supportati solo percorsi completi. - - - Le informazioni del progetto per '{0}' non sono state trovate. Questo errore può indicare la mancanza di un riferimento al progetto. - - - Il file di contenuto '{0}' non contiene le informazioni previste sul pacchetto padre. - - - Mancano i metadati di '{0}' sull'elemento '{2}' di '{1}'. - - - Token di preprocessore '{0}' non riconosciuto in '{1}'. - - - Per poter utilizzare il contenuto pre-elaborato, è necessario assegnare un valore per il parametro '{1}' nell'attività '{0}'. - - - Le risorse vengono utilizzate dal progetto '{0}', ma non è stato trovato alcun percorso di progetto MSBuild corrispondente in '{1}'. - - - Tipo di file imprevisto per '{0}'. Il tipo è sia '{1}' che '{2}'. - - - Non è possibile dedurre TargetFrameworkIdentifier e/o TargetFrameworkVersion da TargetFramework='{0}'. Devono essere specificati in modo esplicito. - - - L'elemento di contenuto per '{0}' imposta '{1}', ma non fornisce '{2}' o '{3}'. - - - Al token di preprocessore '{0}' è stato assegnato più di un valore. Come valore verrà scelto '{1}'. - - - Si sono verificati errori durante la creazione dell'assembly satellite '{0}'. - - - Il percorso risolto per '{0}' non è stato trovato. - - - La dipendenza '{0}' è imprevista e non ha numero di versione. - - - Prima di elaborare le risorse, è necessario configurare il preprocessore di risorse. - - - La stringa di versione '{0}' di NuGet non è valida. - - - Framework non installato: {0} in {1} - - - La directory degli assembly di riferimento non è stata specificata. È possibile impostare il percorso con la variabile di ambiente DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Le dipendenze seguenti sono contrassegnate dal tipo 'platform', tuttavia questo tipo può essere assegnato a una sola dipendenza: {0} - - - Non è stato possibile leggere il file di blocco - - - Il file di progetto '{0}' non esiste. - - - Non è stato possibile risolvere la dipendenza '{0}'. - - - La dipendenza '{0}' nel progetto '{1}' non supporta il framework '{2}'. - - - {0}. Per generare un nuovo file di risorse, eseguire 'dotnet restore'. - - - La dipendenza specificata era '{0}' ma è risultata essere '{1}'. - - - {0} è un framework non supportato. - - - Il file di risorse previsto non esiste. Per generare un nuovo file di risorse, eseguire 'dotnet restore'. - - - Il tipo di dipendenza è cambiato - - - La destinazione '{0}' della dipendenza non è supportata. - - - Conflitto di dipendenze. In '{0}' è previsto '{1}', ma è stato ricevuto '{2}' - - - Sono stati inclusi '{0}' elementi duplicati. Per impostazione predefinita, .NET SDK include '{0}' elementi della directory del progetto. È possibile rimuovere tali elementi dal file di progetto oppure impostare la proprietà '{1}' su '{2}' se si vuole includerli implicitamente nel file di progetto. Gli elementi duplicati sono: {3} - - - Nel progetto è stato incluso un riferimento al pacchetto per '{0}'. Questo pacchetto viene usato come riferimento implicito da .NET SDK e non è in genere necessario farvi riferimento dal progetto. Per altre informazioni, vedere {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ja.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ja.resx deleted file mode 100644 index 71a5a1ca967b..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ja.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 可能性のあるターゲット フレームワークを少なくとも 1 つ指定する必要があります。 - - - プロジェクト '{0}' には、'{1}' と互換性のあるターゲット フレームワークがありません。 - - - 無効なフレームワーク名: '{0}'。 - - - 資産ファイル '{0}' が見つかりません。NuGet パッケージの復元を実行して、このファイルを生成してください。 - - - 資産ファイル '{0}' に '{1}' のターゲットがありません。TargetFramework='{2}' および RuntimeIdentifier='{3}' のこのプロジェクトを復元したことを確認してください。 - - - 資産ファイル パス '{0}' にルートが指定されていません。完全パスのみがサポートされます。 - - - '{0}' のプロジェクト情報が見つかりません。これは、プロジェクト参照がないことを示している可能性があります。 - - - 予期される親パッケージ情報がコンテンツ ファイル '{0}' に入っていません。 - - - '{1}' 項目 '{2}' の '{0}' メタデータがありません。 - - - 認識されないプリプロセッサ トークン '{0}' が '{1}' に存在します。 - - - 前処理されたコンテンツを使用するためには、パラメーター '{1}' の値を '{0}' タスクに指定する必要があります。 - - - プロジェクト '{0}' の資産が使用されますが、対応する MSBuild プロジェクト パスが '{1}' で見つかりませんでした。 - - - '{0}' のファイルの種類が正しくありません。種類は '{1}' と '{2}' の両方です。 - - - TargetFrameworkIdentifier または TargetFrameworkVersion あるいはその両方を TargetFramework='{0}' から推論できません。それらは明示的に指定する必要があります。 - - - '{0}' のコンテンツ項目で '{1}' が設定されますが、'{2}' または '{3}' は指定されません。 - - - プリプロセッサ トークン '{0}' に複数の値が指定されています。値として '{1}' を選択します。 - - - サテライト アセンブリ '{0}' を出力しているときに、エラーが発生しました。 - - - 解決された '{0}' のパスが見つかりません。 - - - バージョン番号のない予期しない依存関係 '{0}' です。 - - - 資産を処理する前に、資産プリプロセッサを構成する必要があります。 - - - 無効な NuGet バージョン文字列: '{0}'。 - - - {1} にフレームワーク {0} がインストールされていません - - - 参照アセンブリのディレクトリが指定されていません。DOTNET_REFERENCE_ASSEMBLIES_PATH 環境変数を使用して、場所を設定できます。 - - - 次の依存関係は型 'platform' でマークされています。ただし、この型 {0} を持つことができる依存関係は 1 つのみです - - - ロック ファイルの読み取りに失敗しました - - - プロジェクト ファイルが存在しません: '{0}'。 - - - 依存関係 '{0}' を解決できませんでした。 - - - プロジェクト '{1}' の依存関係 '{0}' は、フレームワーク '{2}' をサポートしません。 - - - {0}。'dotnet restore' を実行して、新しい資産ファイルを生成してください。 - - - 指定した依存関係は '{0}' ですが、'{1}' が見つかりました。 - - - {0} は、サポートされていないフレームワークです。 - - - 必要な資産ファイルが存在しません。'dotnet restore' を実行して、新しい資産ファイルを生成してください。 - - - 依存関係の種類が変更されました - - - 依存関係ターゲット '{0}' はサポートされていません。 - - - 依存関係の競合。'{0}' には '{1}' が必要ですが、'{2}' を受信しました。 - - - 重複する '{0}' 個のアイテムが含められました。.NET SDK には、既定でプロジェクト ディレクトリからのアイテムが '{0}' 個含まれています。これらのアイテムをプロジェクト ファイルから削除するか、プロジェクト ファイルに明示的に含める場合は '{1}' プロパティを '{2}' に設定します。重複するアイテムは、{3} でした。 - - - '{0}' の PackageReference がプロジェクトに含められました。このパッケージは .NET SDK によって暗黙的に参照されるため、通常はプロジェクトから参照する必要がありません。詳細については、{1} をご覧ください。 - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ko.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ko.resx deleted file mode 100644 index 501008f3b14a..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ko.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 가능한 대상 프레임워크를 하나 이상 지정해야 합니다. - - - '{0}' 프로젝트에 '{1}'과(와) 호환되는 대상 프레임워크가 없습니다. - - - 프레임워크 이름 '{0}'이(가) 잘못되었습니다. - - - 자산 파일 `{0}`을(를) 찾을 수 없습니다. NuGet 패키지 복원을 실행하여 이 파일을 생성하세요. - - - 자산 파일 '{0}'에 '{1}'의 대상이 없습니다. TargetFramework='{2}' 및 RuntimeIdentifier='{3}'에 대해 이 프로젝트를 복원했는지 확인하세요. - - - 자산 파일 경로 '{0}'이(가) 루트에서 시작하지 않습니다. 전체 경로만 지원됩니다. - - - '{0}'에 대한 프로젝트 정보를 찾을 수 없습니다. 프로젝트 참조가 없음을 나타낼 수 있습니다. - - - 콘텐츠 파일 '{0}'에 필요한 패키지 정보가 없습니다. - - - '{1}' 항목 '{2}'에 '{0}' 메타데이터가 없습니다. - - - '{1}'에서 전처리기 토큰 '{0}'을(를) 인식할 수 없습니다. - - - 전처리된 콘텐츠를 사용하려면 '{0}' 작업에서 '{1}' 매개 변수의 값을 지정해야 합니다. - - - '{0}' 프로젝트의 자산이 사용되었지만, '{1}'에서 해당 MSBuild 프로젝트 경로를 찾을 수 없습니다. - - - '{0}'에 대해 예기치 않은 파일 형식입니다. 형식이 '{1}'인 동시에 '{2}'입니다. - - - TargetFramework='{0}'에서 TargetFrameworkIdentifier 및/또는 TargetFrameworkVersion을 유추할 수 없습니다. 명시적으로 지정해야 합니다. - - - {0}'의 콘텐츠 항목이 '{1}'을(를) 설정하지만, '{2}' 또는 '{3}'을(를) 제공하지 않습니다. - - - 전처리기 토큰 '{0}'의 값이 두 개 이상 지정되었습니다. '{1}'을(를) 값으로 선택합니다. - - - 위성 어셈블리 '{0}'을(를) 내보내는 동안 오류가 발생했습니다. - - - '{0}'에 대해 확인된 경로를 찾을 수 없습니다. - - - 버전 번호가 없는 예기치 않은 종속성 '{0}'입니다. - - - 자산을 처리하려면 먼저 자산 전처리기를 구성해야 합니다. - - - NuGet 버전 문자열 '{0}'이(가) 잘못되었습니다. - - - {0} 프레임워크가 {1}에 설치되지 않았습니다. - - - 참조 어셈블리 디렉터리가 지정되지 않았습니다. DOTNET_REFERENCE_ASSEMBLIES_PATH 환경 변수를 사용하여 위치를 설정할 수 있습니다. - - - 다음 종속성이 '플랫폼' 유형으로 표시되었지만, 하나의 종속성만 이 유형을 가질 수 있습니다. {0} - - - 잠금 파일 읽기 실패 - - - 프로젝트 파일에 '{0}'이(가) 없습니다. - - - '{0}' 종속성을 확인할 수 없습니다. - - - '{1}' 프로젝트의 '{0}' 종속성이 '{2}' 프레임워크를 지원하지 않습니다. - - - {0}. 새 자산 파일을 생성하려면 'dotnet restore'를 실행하세요. - - - 지정된 종속성은 '{0}'인데 '{1}'(으)로 끝납니다. - - - {0}은(는) 지원되지 않는 프레임워크입니다. - - - 예상되는 자산 파일이 없습니다. 새 자산 파일을 생성하려면 'dotnet restore'를 실행하세요. - - - 종속성 유형이 변경되었습니다. - - - '{0}' 종속성 대상은 지원되지 않습니다. - - - 종속성 충돌. '{0}'에서 '{1}'을(를) 예상했지만 '{2}'을(를) 수신했습니다. - - - 중복 '{0}' 항목이 포함되었습니다. .NET SDK에는 기본적으로 프로젝트 디렉터리의 '{0}' 항목이 포함됩니다. 프로젝트 파일에서 이러한 항목을 제거하거나, 프로젝트 파일에 명시적으로 포함하려면 '{1}' 속성을 '{2}'(으)로 설정할 수 있습니다. 중복 항목은 다음과 같습니다. {3} - - - '{0}'에 대한 PackageReference가 프로젝트에 포함되어 있습니다. 이 패키지는 .NET SDK에서 암시적으로 참조되며, 일반적으로 사용자가 프로젝트에서 참조할 필요가 없습니다. 자세한 내용은 {1}을(를) 참조하세요. - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pl.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pl.resx deleted file mode 100644 index 09773daa2845..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pl.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Należy określić co najmniej jedną możliwą platformę docelową. - - - Projekt „{0}” nie ma platformy docelowej kompatybilnej z „{1}”. - - - Nieprawidłowa nazwa platformy: „{0}”. - - - Nie odnaleziono pliku zasobów „{0}”. Uruchom przywracanie pakietu NuGet, aby wygenerować ten plik. - - - Plik zasobów „{0}” nie ma obiektu docelowego dla „{1}”. Upewnij się, że projekt został przywrócony dla elementu TargetFramework=„{2}” i RuntimeIdentifier=„{3}”. - - - Ścieżka pliku zasobów „{0}” nie prowadzi do katalogu głównego. Tylko pełne ścieżki są obsługiwane. - - - Nie odnaleziono informacji o projekcie dla elementu „{0}”. Może to wskazywać na brakujące odwołanie do projektu. - - - Plik zawartości „{0}” nie zawiera oczekiwanych informacji o pakiecie nadrzędnym. - - - Brak metadanych „{0}” w elemencie „{1}” „{2}”. - - - Nierozpoznany token preprocesora „{0}” w elemencie „{1}”. - - - Dla zadania „{0}” musi zostać podana wartość parametru „{1}” w celu użycia wstępnie przetworzonej zawartości. - - - Zasoby są używane z projektu „{0}”, ale w elemencie „{1}” nie odnaleziono odpowiadającej ścieżki projektu MSBuild. - - - Nieoczekiwany typ pliku dla „{0}”. Typ to „{1}” oraz „{2}”. - - - Nie można wywnioskować elementu TargetFrameworkIdentifier i/lub TargetFrameworkVersion z elementu TargetFramework=„{0}”. Należy jawnie je określić. - - - Element zawartości dla elementu „{0}” ustawia „{1}”, ale nie zapewnia „{2}” ani „{3}”. - - - Dla tokenu preprocesora „{0}” podano więcej niż jedną wartość. Wybieranie elementu „{1}” jako wartości. - - - Podczas emitowania zestawu satelickiego „{0}” wystąpiły błędy. - - - Nie można odnaleźć rozpoznanej ścieżki dla elementu „{0}”. - - - Nieoczekiwana zależność „{0}” bez numeru wersji. - - - Preprocesor zasobów musi być skonfigurowany przed przetworzeniem zasobów. - - - Nieprawidłowy ciąg wersji NuGet: „{0}”. - - - Nie zainstalowano platformy: {0} w lokalizacji {1} - - - Nie określono katalogu zestawów referencyjnych. Aby ustawić jego lokalizację, użyj zmiennej środowiskowej DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Następujące zależności oznaczono za pomocą typu „platform”, jednak tylko jedna zależność może mieć ten typ: {0} - - - Nie można odczytać pliku blokady - - - Plik projektu nie istnieje „{0}”. - - - Nie można rozpoznać zależności „{0}”. - - - Zależność „{0}” w projekcie „{1}” nie obsługuje platformy „{2}”. - - - {0}. Uruchom polecenie „dotnet restore”, aby wygenerować nowy plik zasobów. - - - Określono zależność „{0}”, ale ostatecznie otrzymano zależność „{1}”. - - - {0} to nieobsługiwana platforma. - - - Oczekiwany plik zasobów nie istnieje. Uruchom polecenie „dotnet restore”, aby wygenerować nowy plik zasobów. - - - Zmieniono typ zależności - - - Element docelowy zależności „{0}” jest nieobsługiwany. - - - Konflikt zależności. Element „{0}” oczekiwał elementu „{1}”, ale otrzymał element „{2}” - - - Zostały uwzględnione zduplikowane elementy „{0}”. Zestaw .NET SDK dołącza domyślnie elementy „{0}” z katalogu projektu. Możesz usunąć te elementy z pliku projektu lub ustawić właściwość „{1}” na wartość „{2}”, aby jawnie uwzględnić je w pliku projektu. Zduplikowane elementy: {3} - - - Odwołanie do pakietu dla „{0}” zostało uwzględnione w projekcie. Ten pakiet jest jawnie przywoływany przez zestaw .NET SDK i zwykle nie ma potrzeby tworzenia odwołania do niego z projektu. Aby uzyskać więcej informacji, zobacz {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pt-BR.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pt-BR.resx deleted file mode 100644 index ee5f4a234bc4..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.pt-BR.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - É necessário especificar pelo menos uma estrutura de destino possível. - - - O projeto '{0}' não tem nenhuma estrutura de destino compatível com '{1}'. - - - Nome de estrutura inválido: '{0}'. - - - Arquivo de ativos '{0}' não encontrado. Execute uma restauração de pacote NuGet para gerar esse arquivo. - - - O arquivo de ativos '{0}' não tem um destino para '{1}'. Certifique-se de ter restaurado esse projeto para TargetFramework='{2}' e RuntimeIdentifier='{3}'. - - - O caminho de arquivo de ativos '{0}' não tem raiz. Apenas caminhos completos têm suporte. - - - Não é possível localizar informações de projeto para '{0}'. Isso pode indicar uma referência de projeto ausente. - - - O arquivo de conteúdo '{0}' não contém as informações de pacote pai esperadas. - - - Metadados '{0}' ausentes no item '{1}' '{2}'. - - - Token de pré-processador não reconhecido '{0}' no '{1}'. - - - A tarefa '{0}' deve receber um valor para o parâmetro '{1}' para consumir o conteúdo pré-processado. - - - Os ativos são consumidos de um projeto '{0}', mas não foi encontrado nenhum caminho de projeto do MSBuild correspondente em '{1}'. - - - Tipo de arquivo inesperado para '{0}'. O tipo é '{1}' e '{2}'. - - - Não é possível inferir TargetFrameworkIdentifier e/ou TargetFrameworkVersion de TargetFramework='{0}'. Eles devem ser especificados explicitamente. - - - O item de conteúdo para '{0}' define '{1}', mas não fornece '{2}' ou '{3}'. - - - O token de pré-processador '{0}' recebeu mais de um valor. Escolhendo '{1}' como o valor. - - - Ocorreram erros ao emitir o assembly satélite '{0}'. - - - Não foi possível localizar o caminho resolvido para '{0}'. - - - Dependência inesperada '{0}' sem número de versão. - - - O pré-processador de ativos deve ser configurado antes de os ativos serem processados. - - - Cadeia de caracteres de versão do NuGet inválida: '{0}'. - - - Estrutura não instalada: {0} em {1} - - - O diretório de assemblies de referência não foi especificado. É possível definir o local usando a variável de ambiente DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - As seguintes dependências estão marcadas com o tipo 'platform'; no entanto, apenas uma dependência pode ter esse tipo: {0} - - - Falha ao ler arquivo de bloqueio - - - O arquivo de projeto não existe: '{0}'. - - - A dependência '{0}' não pôde ser resolvida. - - - A dependência '{0}' do projeto '{1}' não dá suporte à estrutura '{2}'. - - - {0}. Execute 'dotnet restore' para gerar um novo arquivo de ativo. - - - A dependência especificada era '{0}', mas terminou com '{1}'. - - - {0} é uma estrutura sem suporte. - - - O arquivo de ativo esperado não existe. Execute 'dotnet restore' para gerar um novo arquivo de ativo. - - - O tipo de dependência foi alterado - - - Não há suporte para o destino de dependência '{0}'. - - - Conflito de dependência. '{0}' esperava '{1}', mas recebeu '{2\}' - - - Os itens '{0}' duplicados foram incluídos. O .NET SDK inclui '{0}' itens do seu diretório de projeto por padrão. Você poderá remover esses itens do seu arquivo de projeto ou configurar a propriedade '{1}' para '{2}', se desejar os incluir explicitamente no arquivo de projeto. Os itens duplicados são: {3} - - - Um PackageReference para '{0}' foi incluído no seu projeto. Esse pacote é referenciado implicitamente pelo .NET SDK e normalmente você não precisa referenciá-lo no seu projeto. Para obter mais informações, consulte {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ru.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ru.resx deleted file mode 100644 index 251bc9eed230..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.ru.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Необходимо указать хотя бы одну целевую платформу. - - - Проект "{0}" не содержит целевую платформу, совместимую с "{1}". - - - Недопустимое имя платформы: "{0}". - - - Файл ресурсов "{0}" не найден. Выполните восстановление пакета NuGet, чтобы создать этот файл. - - - Файл ресурсов "{0}" не имеет целевого объекта для "{1}". Убедитесь, что выполнено восстановление этого проекта для TargetFramework="{2}" и RuntimeIdentifier="{3}". - - - Путь к файлу ресурсов "{0}" должен содержать корневой каталог. Поддерживаются только полные пути. - - - Невозможно найти сведения о проекте для "{0}". Возможно, отсутствует ссылка на проект. - - - Файл содержимого "{0}" не содержит ожидаемые сведения о родительском пакете. - - - Отсутствуют метаданные "{0}" для элемента "{2}" "{1}". - - - Нераспознанный маркер препроцессора "{0}" в "{1}". - - - В задачу "{0}" необходимо передать значение для параметра "{1}" для использования предварительно обработанного содержимого. - - - Ресурсы используются из проекта "{0}", однако соответствующий путь к проекту MSBuild не найден в "{1}". - - - Непредвиденный тип файла для "{0}". Тип является "{1}" и "{2}". - - - Невозможно определить TargetFrameworkIdentifier и (или) TargetFrameworkVersion на основе TargetFramework="{0}". Они должны быть указаны явно. - - - Элемент содержимого для "{0}" задает "{1}", но не предоставляет "{2}" или "{3}". - - - Для маркера препроцессора "{0}" задано несколько значений. Выбор "{1}" в качестве значения. - - - При выпуске вспомогательной сборки "{0}" возникли ошибки. - - - Не удается найти разрешенный путь для "{0}". - - - Непредвиденная зависимость "{0}" без номера версии. - - - Препроцессор ресурсов необходимо настроить перед обработкой ресурсов. - - - Недопустимая строка версии Invalid NuGet: "{0}". - - - Платформа не установлена: {0} в {1} - - - Не указан каталог ссылочной сборки. Вы можете задать это расположение с помощью переменной среды DOTNET_REFERENCE_ASSEMBLIES_PATH. - - - Следующие зависимости помечены с типом "platform", но всего одна зависимость может иметь этот тип: {0}. - - - Не удалось считать файл блокировки. - - - Файл проекта не существует: "{0}". - - - Не удалось разрешить зависимость "{0}". - - - Зависимость "{0}" в проекте "{1}" не поддерживает платформу "{2}". - - - {0}. Выполните команду "dotnet restore" для создания нового файла активов. - - - Была указана зависимость "{0}", но в конце стоит "{1}". - - - Платформа {0} не поддерживается. - - - Ожидаемый файл активов не существует. Выполните команду "dotnet restore" для создания нового файла активов. - - - Тип зависимости был изменен. - - - Целевой объект зависимости "{0}" не поддерживается. - - - Конфликт зависимостей. "{0}" ожидал "{1}", но получил "{2}". - - - Были включены повторяющиеся элементы ("{0}"). Пакет .NET SDK по умолчанию включает элементы "{0}" из каталога проекта. Можно удалить эти элементы из файла проекта или присвоить свойству "{1}" значение "{2}", если нужно явно включить их в файл проекта. Повторяющиеся элементы: {3} - - - PackageReference для "{0}" был включен в проект. На этот пакет неявно указывает пакет .NET SDK и обычно не нужно ссылаться на него из проекта. Дополнительные сведения: {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.tr.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.tr.resx deleted file mode 100644 index 231f4972ecb6..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.tr.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - En az bir olası hedef çerçeve belirtilmelidir. - - - '{0}' projesinde '{1}' ile uyumlu bir hedef çerçeve yok. - - - Geçersiz çerçeve adı: '{0}'. - - - '{0}' varlık dosyası bulunamadı. Bu dosyayı oluşturmak için, NuGet paketi geri yükleme işlemi gerçekleştirin. - - - '{0}' varlık dosyasında '{1}' için hedef yok. TargetFramework='{2}' ve RuntimeIdentifier='{3}' için bu projeyi geri yüklediğinizden emin olun. - - - '{0}' varlık dosya yolunun kökü belirtilmemiş. Yalnızca tam yollar desteklenir. - - - '{0}' için proje bilgisi bulunamıyor. Bu durum, eksik bir proje başvurusu olduğunu gösteriyor olabilir. - - - '{0}' içerik dosyası beklenen üst paket bilgilerini içermiyor. - - - '{1}' öğesi '{2}' üzerinde '{0}' meta verileri eksik. - - - '{1}' içinde tanınmayan ön işlemci belirteci: '{0}'. - - - Önceden işlenen içeriği kullanabilmesi için '{0}' görevine, '{1}' parametresine ilişkin bir değer verilmelidir. - - - '{0}' projesindeki varlıklar kullanılıyor, ancak '{1}' içinde karşılık gelen bir MSBuild projesi bulunamadı. - - - '{0}' için beklenmeyen dosya türü. Tür, hem '{1}' hem de '{2}'. - - - TargetFrameworkIdentifier ve/veya TargetFrameworkVersion, TargetFramework='{0}' içinden çıkarsanamıyor. Bunlar açıkça belirtilmelidir. - - - '{0}' için içerik öğesi, '{1}' değerini ayarlıyor ancak '{2}' veya '{3}' sağlamıyor. - - - '{0}' ön işlemci belirtecine birden fazla değer verildi. Değer olarak '{1}' seçiliyor. - - - '{0}' uydu bütünleştirilmiş kodu yayılırken hatalar oluştu. - - - '{0}' için çözümlenmiş yol bulunamıyor. - - - Sürüm numarası olmayan, beklenmeyen bağımlılık: '{0}'. - - - Varlıkların işlenebilmesi için varlık ön işlemcisi yapılandırılmalıdır. - - - Geçersiz NuGet sürüm dizesi: '{0}'. - - - Çerçeve yüklenmedi: {1} içinde {0} - - - Başvuru bütünleştirilmiş kodları dizini belirtilmedi. DOTNET_REFERENCE_ASSEMBLIES_PATH ortam değişkenini kullanarak konumu ayarlayabilirsiniz. - - - Aşağıdaki bağımlılıklar 'platform' türüyle işaretlendi ancak yalnızca bir bağımlılık bu türe sahip olabilir: {0} - - - Kilit dosyası okunamadı - - - Proje dosyası yok: '{0}'. - - - '{0}' bağımlılığı çözülemedi. - - - '{1}' projesi içindeki '{0}' bağımlılığı '{2}' çerçevesini desteklemiyor. - - - {0}. Yeni bir varlık dosyası oluşturmak için 'dotnet restore' çalıştırın. - - - Belirtilen bağımlılık '{0}' ancak '{1}' alındı. - - - {0} çerçevesi desteklenmiyor. - - - Beklenen varlık dosyası yok.Yeni bir varlık dosyası oluşturmak için 'dotnet restore' çalıştırın. - - - Bağımlılık türü değiştirildi - - - Bağımlılık hedefi ('{0}') desteklenmiyor. - - - Bağımlılık çakışması. '{0}' '{1}' bekliyordu ancak '{2}' alındı - - - Yinelenen '{0}' öğeleri eklendi. .NET SDK, proje dizininizdeki '{0}' öğelerini varsayılan olarak içeriyor. Bu öğeleri proje dosyanızdan kaldırabilir veya bunları proje dosyanıza açıkça dahil etmek istiyorsanız '{1}' özelliğini '{2}' olarak ayarlayabilirsiniz. Yinelenen öğeler: {3} - - - Projenize '{0}' için bir paket başvurusu eklendi. .NET SDK bu pakete örtük olarak başvuruyor; buna projenizden başvurmanız genellikle gerekli değildir. Daha fazla bilgi için bkz. {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hans.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hans.resx deleted file mode 100644 index 9969d429f629..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hans.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 必须指定至少一个可能的目标框架。 - - - 项目“{0}”没有与“{1}”兼容的目标框架。 - - - 无效的框架名称:“{0}”。 - - - 找不到资产文件“{0}”。运行 NuGet 程序包还原以生成此文件。 - - - 资产文件“{0}”没有“{1}”的目标。确保已针对 TargetFramework=“{2}”和 RuntimeIdentifier=“{3}”还原此项目。 - - - 资产文件路径“{0}”不是根路径。仅支持完整路径。 - - - 找不到“{0}”的项目信息。这可以指示缺少一个项目引用。 - - - 内容文件“{0}”不包含预期的父包信息。 - - - 在“{1}”项“{2}”上缺少“{0}”元数据。 - - - “{1}”中无法识别的预处理器标记“{0}”。 - - - 必须向“{0}”任务提供参数“{1}”的值以便使用预处理的内容。 - - - 从项目“{0}”消耗资产,但在“{1}”中找不到相应的 MSBuild 项目路径。 - - - “{0}”的意外文件类型。类型是“{1}”和“{2}”。 - - - 无法从 TargetFramework=“{0}”推断 TargetFrameworkIdentifier 和/或 TargetFrameworkVersion。必须显式指定这两项。 - - - “{0}”的内容项设置“{1}”,但不提供“{2}”或“{3}”。 - - - 已向预处理器标记“{0}”提供多个值。选择“{1}”作为值。 - - - 发出附属程序集“{0}”时出错。 - - - 找不到“{0}”的已解析路径。 - - - 不具有版本号的意外依赖项“{0}”。 - - - 必须在处理资产之前配置资产预处理器。 - - - 无效的 NuGet 版本字符串:“{0}”。 - - - 未安装的框架: {1} 中的 {0} - - - 未指定引用程序集目录。可以使用 DOTNET_REFERENCE_ASSEMBLIES_PATH 环境变量设置位置。 - - - 以下依赖项使用类型“platform”标记,但只有一个依赖项可以具有此类型: {0} - - - 未能读取锁定文件 - - - 项目文件不存在“{0}”。 - - - 无法解析依赖项“{0}”。 - - - 项目“{1}”中的依赖项“{0}”不支持框架“{2}”。 - - - {0}。请运行“dotnet restore”以生成新的资产文件。 - - - 指定的依赖项为“{0}”,但以“{1}”结尾。 - - - {0} 是不受支持的框架。 - - - 预期资产文件不存在。请运行“dotnet restore”以生成新的资产文件。 - - - 依赖项类型已更改 - - - 不支持依赖项目标“{0}”。 - - - 依赖项冲突。“{0}”预期“{1}”,但接收到“{2}” - - - 包含了重复的“{0}”项。.NET SDK 默认情况下包括你项目中的“{0}”项。可以从项目文件中删除这些项,或者如果希望将其显示包含在项目文件中,则可以将“{1}”属性设置为“{2}”。重复项为: {3} - - - 项目中包含了“{0}”的 PackageReference。此包由 .NET SDK 隐式引用,且通常情况下你无需从项目中对其进行引用。有关详细信息,请参阅 {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hant.resx b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hant.resx deleted file mode 100644 index e79eef2fb943..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/Strings.zh-Hant.resx +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 必須指定至少一個可能的目標 Framework。 - - - 專案 '{0}' 沒有與 '{1}' 相容的目標 Framework。 - - - 無效的架構名稱: '{0}'。 - - - 找不到資產檔案 '{0}'。執行 NuGet 套件還原以產生此檔案。 - - - 資產檔案 '{0}' 沒有 '{1}' 的目標。請確定您已還原此專案 (TargetFramework='{2}' 且 RuntimeIdentifier='{3}')。 - - - 資產檔案路徑 '{0}' 不是根目錄。僅支援完整路徑。 - - - 找不到 '{0}' 的專案資訊。這可能表示遺漏專案參考。 - - - 內容檔案 '{0}' 未包含必要的父套件資訊。 - - - '{1}' 項目 '{2}' 上遺漏 '{0}' 中繼資料。 - - - '{1}' 中的前置處理器 Token '{0}' 無法辨識。 - - - 必須為 '{0}' 工作指定參數 '{1}' 的值,才能取用前置處理過的內容。 - - - 已從專案 '{0}' 取用資產,但在 '{1}' 中找不到對應的 MSBuild 專案路徑。 - - - '{0}' 屬於未預期的檔案類型類型同時為 '{1}' 和 '{2}'。 - - - 無法從 TargetFramework='{0}' 推斷 TargetFrameworkIdentifier 及/或 TargetFrameworkVersion。您必須明確加以指定。 - - - '{0}' 的內容項目設定 '{1}',但未提供 '{2}' 或 '{3}'。 - - - 已為前置處理器 Token '{0}' 指定多個值。正在選擇 '{1}' 作為值。 - - - 發出附屬組件 '{0}' 時發生錯誤。 - - - 找不到 '{0}' 的解析路徑。 - - - 未預期的相依性 '{0}',沒有版本號碼。 - - - 必須設定資產前置處理器,才能處理資產。 - - - 無效的 NuGet 版本字串: '{0}'。 - - - 未安裝架構: {0} (在 {1} 中) - - - 未指定參考組件目錄。您可使用 DOTNET_REFERENCE_ASSEMBLIES_PATH 環境變數設定位置。 - - - 下列相依性以類型 'platform' 標記,但只有一個相依性可具備此類型: {0} - - - 無法讀取鎖定檔案 - - - 專案檔不存在 '{0}'。 - - - 無法解析相依性 '{0}'。 - - - 專案 '{1}' 中的相依性 '{0}' 不支援架構 '{2}'。 - - - {0}。請執行 'dotnet restore' 產生新的資產檔案。 - - - 指定的相依性為 '{0}' 但最終為 '{1}'。 - - - {0} 為不受支援的架構。 - - - 所需的資產檔案不存在。請執行 'dotnet restore' 產生新的資產檔案。 - - - 相依性類型已變更 - - - 相依性目標 '{0}' 不受支援。 - - - 相依性衝突。'{0}' 需要 '{1}' 但收到 '{2}' - - - 包含重複的 '{0}' 項目。根據預設,.NET SDK 會包含來自您專案目錄的 '{0}' 項目。您可以從專案檔移除這些項目,如果您想在專案檔中明確納入這些項目,也可以將 '{1}' 屬性設為 '{2}'。重複的項目為: {3} - - - 您的專案中包含 '{0}' 的 PackageReference。.NET SDK 會隱含參考此套件,您通常不需要從專案加以參考。如需詳細資訊,請參閱 {1} - - - Package Root {0} was incorrectly given for Resolved library {1} - - - More than one file found for {0} - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - Parsing the Files : '{0}' - - - Package Name='{0}', Version='{1}' was parsed - - - Specify a RuntimeIdentifier - - - The target manifest {0} provided is of not the correct format - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - Given file name '{0}' is longer than 1024 bytes - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - Choosing '{0}' because it is a platform item. - - - Choosing '{0}' because it comes from a package that is preferred. - - - Could not determine winner due to equal file and assembly versions. - - - Could not determine winner because '{0}' does not exist. - - - Could not determine a winner because '{0}' has no file version. - - - Could not determine a winner because '{0}' is not an assembly. - - - Encountered conflict between '{0}' and '{1}'. - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.xlf b/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.xlf deleted file mode 100644 index 16102bcde017..000000000000 --- a/src/Tasks/Microsoft.NET.Build.Tasks/Resources/xlf/Strings.xlf +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - At least one possible target framework must be specified. - - - - Project '{0}' targets '{2}'. It cannot be referenced by a project that targets '{1}'. - - - - Invalid framework name: '{0}'. - - - - Assets file '{0}' not found. Run a NuGet package restore to generate this file. - - - - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have restored this project for TargetFramework='{2}' and RuntimeIdentifier='{3}'. - - - - Assets file path '{0}' is not rooted. Only full paths are supported. - - - - Cannot find project info for '{0}'. This can indicate a missing project reference. - - - - Content file '{0}' does not contain expected parent package information. - - - - Missing '{0}' metadata on '{1}' item '{2}'. - - - - Unrecognized preprocessor token '{0}' in '{1}'. - - - - The '{0}' task must be given a value for parameter '{1}' in order to consume preprocessed content. - - - - Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'. - - - - Unexpected file type for '{0}'. Type is both '{1}' and '{2}'. - - - - Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='{0}'. They must be specified explicitly. - - - - Content item for '{0}' sets '{1}', but does not provide '{2}' or '{3}'. - - - - The preprocessor token '{0}' has been given more than one value. Choosing '{1}' as the value. - - - - Errors occured when emitting satellite assembly '{0}'. - - - - Unable to find resolved path for '{0}'. - - - - Unexpected dependency '{0}' with no version number. - - - - Asset preprocessor must be configured before assets are processed. - - - - Invalid NuGet version string: '{0}'. - - - - Framework not installed: {0} in {1} - - - - The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable. - - - - The following dependencies are marked with type 'platform', however only one dependency can have this type: {0} - - - - Failed to read lock file - - - - Project file does not exist '{0}'. - - - - The dependency '{0}' could not be resolved. - - - - The dependency '{0}' in project '{1}' does not support framework '{2}'. - - - - {0}. Please run 'dotnet restore' to generate a new asset file. - - - - Dependency specified was '{0}' but ended up with '{1}'. - - - - {0} is an unsupported framework. - - - - The expected asset file does not exist. Please run 'dotnet restore' to generate a new asset file. - - - - The dependency type was changed - - - - The dependency target '{0}' is unsupported. - - - - Dependency conflict. '{0}' expected '{1}' but received '{2}' - - - - Duplicate '{0}' items were included. The .NET SDK includes '{0}' items from your project directory by default. You can either remove these items from your project file, or set the '{1}' property to '{2}' if you want to explicitly include them in your project file. For more information, see {4}. The duplicate items were: {3} - - - - A PackageReference for '{0}' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see {1} - - - - Package Root {0} was incorrectly given for Resolved library {1} - - - - More than one file found for {0} - - - - Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir - - - - Parsing the Files : '{0}' - - - - Package Name='{0}', Version='{1}' was parsed - - - - Specify a RuntimeIdentifier - - - - The target manifest {0} provided is of not the correct format - - - - Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written. - - - - Given file name '{0}' is longer than 1024 bytes - - - - It is not supported to build or publish a self-contained application without specifying a RuntimeIdentifier. Please either specify a RuntimeIdentifier or set SelfContained to false. - - - - Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. - - - - Choosing '{0}' because file version '{1}' is greater than '{2}'. - - - - Choosing '{0}' because it is a platform item. - - - - Choosing '{0}' because it comes from a package that is preferred. - - - - Could not determine winner due to equal file and assembly versions. - - - - Could not determine winner because '{0}' does not exist. - - - - Could not determine a winner because '{0}' has no file version. - - - - Could not determine a winner because '{0}' is not an assembly. - - - - Encountered conflict between '{0}' and '{1}'. - - - - Could not load PlatformManifest from '{0}' because it did not exist. - - - - Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}. - - - - Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid. - - - - - \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ComposeStore.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ComposeStore.targets index c7d149a24691..ea331b93551c 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ComposeStore.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.ComposeStore.targets @@ -53,7 +53,6 @@ Copyright (c) .NET Foundation. All rights reserved. TargetFramework=$(_TFM); JitPath=$(JitPath); Crossgen=$(Crossgen); - RestoreProj=$(RestoreProj); DisableImplicitFrameworkReferences=true; SkipUnchangedFiles=$(SkipUnchangedFiles); PreserveStoreLayout=$(PreserveStoreLayout); @@ -75,8 +74,8 @@ Copyright (c) .NET Foundation. All rights reserved. Returns ="@(ResolvedPackagesFromMapper)"> - - + + StorePackageName=%(PackageReference.Identity); StorePackageVersion=%(PackageReference.Version); ComposeWorkingDir=$(ComposeWorkingDir); @@ -89,28 +88,38 @@ Copyright (c) .NET Foundation. All rights reserved. SkipUnchangedFiles=$(SkipUnchangedFiles); PreserveStoreLayout=$(PreserveStoreLayout); CreateProfilingSymbols=$(CreateProfilingSymbols); - StoreSymbolsStagingDir=$(StoreSymbolsStagingDir) - + StoreSymbolsStagingDir=$(StoreSymbolsStagingDir); + DisableImplicitFrameworkReferences=false; + + + + + + + - + DependsOnTargets="ComputeAndCopyFilesToStoreDirectory;" + Condition="Exists($(StoreWorkerWorkingDir))" /> $([System.IO.Path]::Combine($(ComposeWorkingDir),"SymbolsStagingDir")) - $([System.IO.Path]::Combine($(ComposeWorkingDir),"Restore.csproj")) $(PublishDir)\ @@ -259,40 +269,23 @@ Copyright (c) .NET Foundation. All rights reserved. - - - - - -]]> - - - - - + $(StorePackageVersion.Replace('*','-')) $([System.IO.Path]::Combine($(ComposeWorkingDir),"$(StorePackageName)_$(StorePackageVersionForFolderName)")) - <_PackageProjFile>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "Package.csproj")) - $(StoreWorkerWorkingDir)\project.assets.json - <_PackageProjContent> - - - - - -]]> - + <_PackageProjFile>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "Restore.csproj")) + $(StoreWorkerWorkingDir)\ + $(BaseIntermediateOutputPath)\project.assets.json + + $(MicrosoftNETPlatformLibrary) + true + + DependsOnTargets="PrepforRestoreForComposeStore;" + Condition="!Exists($(StoreWorkerWorkingDir))"> - - - - @@ -424,7 +413,7 @@ Copyright (c) .NET Foundation. All rights reserved. Gathers all the files that need to be copied to the publish directory. ============================================================ --> - + @@ -434,12 +423,37 @@ Copyright (c) .NET Foundation. All rights reserved. true - + + + + - - - + + + + + + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.CrossGen.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.CrossGen.targets index d33512955a0e..26d4b230a57c 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.CrossGen.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.CrossGen.targets @@ -27,8 +27,7 @@ Copyright (c) .NET Foundation. All rights reserved. --> @@ -74,8 +73,19 @@ Copyright (c) .NET Foundation. All rights reserved. ResourceName="UnableToFindResolvedPath" FormatArguments="$(Crossgen)" /> + + + + + - $([System.IO.Path]::GetFullPath($(Crossgen))) + $([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine($(_NetCoreRefDir), $([System.IO.Path]::GetFileName($(Crossgen))))))) @@ -198,44 +208,12 @@ Copyright (c) .NET Foundation. All rights reserved. <_CrossProjFileDir>$([System.IO.Path]::Combine($(ComposeWorkingDir),"Optimize")) <_NetCoreRefDir>$([System.IO.Path]::Combine($(_CrossProjFileDir), "netcoreapp")) - - - - - - - - - - $(_TFM) - $(RuntimeIdentifier) - $(RuntimeFrameworkVersion) - - - -]]> - - - + - <_CrossProjFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), "OptimizeCrossgen_$(RuntimeIdentifier)_$(_TFM).csproj")) - <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), "obj", project.assets.json)) + <_CrossProjAssetsFile>$([System.IO.Path]::Combine($(_CrossProjFileDir), project.assets.json)) - - + DependsOnTargets="_GetCrossgenProps;"> <_RuntimeRefDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimeref")) <_RuntimeOptimizedDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimopt")) <_RuntimeSymbolsDir>$([System.IO.Path]::Combine($(StoreWorkerWorkingDir), "runtimesymbols")) - + + + <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> + + @@ -270,33 +252,6 @@ Copyright (c) .NET Foundation. All rights reserved. - - - - - - <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" Condition="!Exists('$(_NetCoreRefDir)$(DirectorySeparatorChar)%(FileName)%(Extension)')"/> - - - - - - - - <_ManagedResolvedFilesToOptimize Include="@(_ManagedResolvedFileToPublishCandidates)" /> - - - - + + Properties="RestoreGraphProjectInput=$(MSBuildProjectFullPath); + DisableImplicitFrameworkReferences=true; + RestoreOutputPath=$(_CrossProjFileDir); + StorePackageName=$(MicrosoftNETPlatformLibrary); + StorePackageVersion=$(RuntimeFrameworkVersion);"/> - diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.PreserveCompilationContext.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.PreserveCompilationContext.targets index e1a604dbe28b..bc8233bfc006 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.PreserveCompilationContext.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.PreserveCompilationContext.targets @@ -13,14 +13,14 @@ Copyright (c) .NET Foundation. All rights reserved. $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - + refs + Condition="'$(PreserveCompilationContext)' == 'true'" + BeforeTargets="GenerateBuildDependencyFile; + GeneratePublishDependencyFile"> @@ -53,7 +53,7 @@ Copyright (c) .NET Foundation. All rights reserved. Packages="@(RuntimeStorePackages)"> - + + + + + + + + + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Publish.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Publish.targets index 3d0bdc6c706b..6955c30f351e 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Publish.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Publish.targets @@ -257,14 +257,7 @@ Copyright (c) .NET Foundation. All rights reserved. IsSelfContained="$(SelfContained)" > - - - - - - - - - + <_SDKImplicitReference Include="System.Core" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/> + <_SDKImplicitReference Include="System.Runtime.Serialization" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/> + <_SDKImplicitReference Include="System.Xml.Linq" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '3.5' "/> - + <_SDKImplicitReference Include="System.Numerics" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.0' "/> - + <_SDKImplicitReference Include="System.IO.Compression.FileSystem" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/> + <_SDKImplicitReference Include="System.Net.Http" Condition=" '$(_TargetFrameworkVersionWithoutV)' >= '4.5' "/>--> + + + <_SDKImplicitReference Update="@(_SDKImplicitReference)" + Pack="false" /> + + <_SDKImplicitReference Remove="@(Reference)" /> + + + - - $(PackageTargetFallback);net461 + + + false + + + + $(AssetTargetFallback);net461 - + <_FrameworkIdentifierForImplicitDefine>$(TargetFrameworkIdentifier.Replace('.', '').ToUpperInvariant()) <_FrameworkIdentifierForImplicitDefine Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework'">NET diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.CSharp.props b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.CSharp.props index d13575455515..485a89a332f2 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.CSharp.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.CSharp.props @@ -15,6 +15,9 @@ Copyright (c) .NET Foundation. All rights reserved. $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 4 1701;1702;1705 + + + NU1605 $(DefineConstants); diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.FSharp.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.FSharp.targets index e11cf8f3821a..1f62c01c9933 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.FSharp.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.FSharp.targets @@ -45,11 +45,11 @@ Copyright (c) .NET Foundation. All rights reserved. Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed. Import design time targets before the common crosstargeting targets, which import targets from Nuget. *************************************************************************************************************** --> - + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets + Condition=" '$(UseBundledFSharpTargets)' == 'true' and '$(FSharpDesignTimeTargetsPath)' != '' and Exists('$(FSharpDesignTimeTargetsPath)') " /> diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.props b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.props index ad02da5dc8ae..e67125e34f44 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.props @@ -13,6 +13,16 @@ Copyright (c) .NET Foundation. All rights reserved. Embed + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + 1 + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 + On + Binary + Off + On + + + NU1605 diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.targets index 10d036ae23c3..4c8eded50cc4 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.VisualBasic.targets @@ -16,5 +16,30 @@ Copyright (c) .NET Foundation. All rights reserved. $(DefineConstants),$(ImplicitFrameworkDefine) + $(DisableImplicitFrameworkReferences) + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.props index 1a75dcfe1193..a8fd34dd3221 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.props @@ -102,6 +102,9 @@ Copyright (c) .NET Foundation. All rights reserved. false false false + + + @@ -114,7 +117,7 @@ Copyright (c) .NET Foundation. All rights reserved. - + @@ -124,11 +127,9 @@ Copyright (c) .NET Foundation. All rights reserved. $(DotnetHostPath) - - - CurrentArchitecture - CurrentRuntime - + + + diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.targets index 1d87448fd3f7..bedbe52b930b 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.targets @@ -14,6 +14,12 @@ Copyright (c) .NET Foundation. All rights reserved. $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + CurrentArchitecture + CurrentRuntime + @@ -33,7 +39,7 @@ Copyright (c) .NET Foundation. All rights reserved. - true + true $(MSBuildProjectDirectory)/runtimeconfig.template.json true true @@ -63,7 +69,14 @@ Copyright (c) .NET Foundation. All rights reserved. <_DotNetHostPolicyLibraryName>$(_NativeLibraryPrefix)hostpolicy$(_NativeLibraryExtension) <_DotNetHostFxrLibraryName>$(_NativeLibraryPrefix)hostfxr$(_NativeLibraryExtension) - + + + <_DefaultUserProfileRuntimeStorePath>$(HOME) + <_DefaultUserProfileRuntimeStorePath Condition="'$(OS)' == 'Windows_NT'">$(USERPROFILE) + <_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store')) + $(_DefaultUserProfileRuntimeStorePath) + + $(CoreBuildDependsOn); @@ -81,7 +94,9 @@ Copyright (c) .NET Foundation. All rights reserved. --> @@ -192,6 +209,19 @@ Copyright (c) .NET Foundation. All rights reserved. Value="$(ThreadPoolMaxThreads)" /> + + + + + + + + + + + <_FrameworkReferenceAssemblies Include="@(ReferencePath)" + Condition="%(ReferencePath.FrameworkFile) == 'true' or + %(ReferencePath.ResolvedFrom) == 'ImplicitlyExpandDesignTimeFacades'" /> + + + <_ReferenceOnlyAssemblies Include="@(ReferencePath)" + Exclude="@(_FrameworkReferenceAssemblies)" + Condition="%(ReferencePath.CopyLocal) != 'true' and + %(ReferencePath.NuGetSourceType) == ''" /> + + <_ReferenceAssemblies Include="@(_FrameworkReferenceAssemblies)" /> + <_ReferenceAssemblies Include="@(_ReferenceOnlyAssemblies)" /> + + + + + + + + v0.0 + + _ + @@ -62,10 +64,12 @@ Copyright (c) .NET Foundation. All rights reserved. $(ResolveAssemblyReferencesDependsOn); ResolvePackageDependenciesForBuild; + _HandlePackageFileConflicts; ResolvePackageDependenciesForBuild; + _HandlePackageFileConflicts; $(PrepareResourcesDependsOn) @@ -119,8 +123,7 @@ Copyright (c) .NET Foundation. All rights reserved. ResolveLockFileReferences; ResolveLockFileAnalyzers; ResolveLockFileCopyLocalProjectDeps; - IncludeTransitiveProjectReferences; - _HandlePackageFileConflicts + IncludeTransitiveProjectReferences + + Condition=" '$(DesignTimeBuild)' != 'true' Or Exists('$(ProjectAssetsFile)')" + DependsOnTargets="ReportAssetsLogMessages"> + + + + + InputDiagnosticMessages="@(DiagnosticMessages)" + TargetFrameworkMoniker="$(NuGetTargetMoniker)"> @@ -241,7 +258,7 @@ Copyright (c) .NET Foundation. All rights reserved. - + + + + + + + + + + + + + + + + + ReportAssetsLogMessages; + $(EmitsDependencyDiagnosticMessages) + + +