From 3748d660e262d6166733e1a79bb9e8bfdedf0202 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Thu, 29 Jun 2017 21:58:13 -0700 Subject: [PATCH 01/22] When copying the App-Host for a self-contained app, only use the extension when publishing for windows. Otherwise, for apps with a . in the name, the part that comes after the . ends up being used as an extension and the executable has a duplicated last piece of the name, like sample.console.console, instead of sample.console. --- .../build/Microsoft.NET.Publish.targets | 2 +- ...enThatWeWantToPublishAHelloWorldProject.cs | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) 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 6955c30f351e..b79f3ccdd6ba 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 @@ -579,7 +579,7 @@ Copyright (c) .NET Foundation. All rights reserved. - $(AssemblyName)%(Extension) + $(AssemblyName)$(_NativeExecutableExtension) diff --git a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs index 6829a879fddf..3e56bec38970 100644 --- a/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs +++ b/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs @@ -102,6 +102,45 @@ public void It_publishes_self_contained_apps_to_the_publish_folder_and_the_app_s .HaveStdOutContaining("Hello World!"); } + [Fact] + public void Publish_self_contained_app_with_dot_in_the_name() + { + var targetFramework = "netcoreapp2.0"; + var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); + + TestProject testProject = new TestProject() + { + Name = "Hello.World", + IsSdkProject = true, + TargetFrameworks = targetFramework, + RuntimeIdentifier = rid, + IsExe = true, + }; + + + testProject.SourceFiles["Program.cs"] = @" +using System; +public static class Program +{ + public static void Main() + { + Console.WriteLine(""Hello from a netcoreapp2.0.!""); + } +} +"; + var testProjectInstance = _testAssetsManager.CreateTestProject(testProject); + + testProjectInstance.Restore(Log, testProject.Name); + var publishCommand = new PublishCommand(Log, Path.Combine(testProjectInstance.TestRoot, testProject.Name)); + publishCommand.Execute().Should().Pass(); + + var publishDirectory = publishCommand.GetOutputDirectory( + targetFramework: targetFramework, + runtimeIdentifier: rid); + + publishDirectory.Should().HaveFile($"Hello.World{Constants.ExeSuffix}"); + } + //Note: Pre Netcoreapp2.0 stanalone activation uses renamed dotnet.exe // While Post 2.0 we are shifting to using apphost.exe, so both publish needs to be validated [Fact] @@ -110,7 +149,6 @@ public void Publish_standalone_post_netcoreapp2_app_and_it_should_run() var targetFramework = "netcoreapp2.0"; var rid = EnvironmentInfo.GetCompatibleRid(targetFramework); - TestProject testProject = new TestProject() { Name = "Hello", From cfbd651fa3d990d2c60142b05cf4a31ff663f2e0 Mon Sep 17 00:00:00 2001 From: William Li Date: Thu, 29 Jun 2017 11:13:14 -0700 Subject: [PATCH 02/22] Dependency's framework assembly should not be hoist --- ...rosoft.PackageDependencyResolution.targets | 1 + ...enThatThereAreImplicitPackageReferences.cs | 81 ++++++++++++++++--- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.PackageDependencyResolution.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.PackageDependencyResolution.targets index a9737af1596d..36b9b302206a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.PackageDependencyResolution.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.PackageDependencyResolution.targets @@ -405,6 +405,7 @@ Copyright (c) .NET Foundation. All rights reserved. false + false true Package %(PackageName) diff --git a/test/Microsoft.NET.Pack.Tests/GivenThatThereAreImplicitPackageReferences.cs b/test/Microsoft.NET.Pack.Tests/GivenThatThereAreImplicitPackageReferences.cs index cff5e04ad37f..952dda563466 100644 --- a/test/Microsoft.NET.Pack.Tests/GivenThatThereAreImplicitPackageReferences.cs +++ b/test/Microsoft.NET.Pack.Tests/GivenThatThereAreImplicitPackageReferences.cs @@ -121,6 +121,35 @@ public void Packing_a_netcoreapp_1_1_app_includes_the_implicit_dependency() } [Fact] + public void Packing_an_app_exclude_dependencys_framework_assemblies_dependency() + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return; + } + TestProject testProject = new TestProject() + { + Name = "PackNet461App", + IsSdkProject = true, + TargetFrameworks = "net461", + }; + + testProject.PackageReferences.Add( + new TestPackageReference( + "System.IO.Compression", + "4.3.0", + null)); + testProject.References.Add("System.Web"); + + var dependencies = GetFrameworkAssemblies(PackAndGetNuspec(testProject), out var _); + + dependencies.Count().Should().Be(1); + dependencies.Single().Attribute("assemblyName").Value.Should().Be("System.Web"); + } + + // Disabled on full framework MSBuild until CI machines have VS with bundled .NET Core / .NET Standard versions + // See https://github.com/dotnet/sdk/issues/1077 + [CoreMSBuildOnlyFact] public void Packing_a_netcoreapp_2_0_app_includes_the_implicit_dependency() { TestProject testProject = new TestProject() @@ -158,7 +187,7 @@ public void Packing_a_multitargeted_library_includes_implicit_dependencies_when_ testProject.TargetFrameworks += ";net461"; } - var dependencyGroups = PackAndGetDependencyGroups(testProject, out var ns); + var dependencyGroups = GetDependencyGroups(PackAndGetNuspec(testProject), out var ns); void ExpectDependencyGroup(string targetFramework, string dependencyId) { @@ -188,7 +217,31 @@ void ExpectDependencyGroup(string targetFramework, string dependencyId) } } - private List PackAndGetDependencyGroups(TestProject testProject, out XNamespace ns) + private List GetDependencyGroups(XDocument nuspec, out XNamespace ns) + { + ns = nuspec.Root.Name.Namespace; + + var dependencyGroups = nuspec.Root + .Element(ns + "metadata") + .Element(ns + "dependencies") + .Elements() + .ToList(); + + return dependencyGroups; + } + + private List GetFrameworkAssemblies(XDocument nuspec, out XNamespace ns) + { + ns = nuspec.Root.Name.Namespace; + + return nuspec.Root + .Element(ns + "metadata") + .Element(ns + "frameworkAssemblies") + .Elements() + .ToList(); + } + + private XDocument PackAndGetNuspec(TestProject testProject) { var testProjectInstance = _testAssetsManager.CreateTestProject(testProject, testProject.Name) .Restore(Log, testProject.Name); @@ -201,20 +254,12 @@ private List PackAndGetDependencyGroups(TestProject testProject, out X string nuspecPath = packCommand.GetIntermediateNuspecPath(); var nuspec = XDocument.Load(nuspecPath); - ns = nuspec.Root.Name.Namespace; - - var dependencyGroups = nuspec.Root - .Element(ns + "metadata") - .Element(ns + "dependencies") - .Elements() - .ToList(); - - return dependencyGroups; + return nuspec; } private List PackAndGetDependencies(TestProject testProject) { - var dependencyGroups = PackAndGetDependencyGroups(testProject, out var ns); + var dependencyGroups = GetDependencyGroups(PackAndGetNuspec(testProject), out var ns); // There should be only one dependency group for these tests dependencyGroups.Count().Should().Be(1); @@ -226,5 +271,17 @@ private List PackAndGetDependencies(TestProject testProject) return dependencies; } + + private List PackAndGetFrameworkAssemblies(TestProject testProject) + { + var frameworkAssemblies = GetFrameworkAssemblies(PackAndGetNuspec(testProject), out var ns); + + // There should be only one dependency group for these tests + frameworkAssemblies.Count().Should().Be(1); + + frameworkAssemblies.Should().Contain(f => f.Name == "frameworkAssembly"); + + return frameworkAssemblies.Elements(ns + "frameworkAssembly").ToList(); + } } } From c602e1a171c87f0cde3e8635ff62c9fdc01fad5e Mon Sep 17 00:00:00 2001 From: "Eric St. John" Date: Wed, 5 Jul 2017 14:42:02 -0700 Subject: [PATCH 03/22] Add netstandard support facades when ns1.5+ libraries are referenced Previously we only added the netstandard2.0 facades when a netstandard2.0 library was referenced. This will also apply them if a netstandard1.5 or greater library is referenced. This addresses the case where packages (like System.Runtime) are broken after NuGet remapped net461 from netstandard1.4 to netstandard2.0. --- .../GivenAGetDependsOnNETStandardTask.cs | 8 +-- .../GetDependsOnNETStandard.cs | 8 +++ .../GetDependsOnNETStandard.net46.cs | 60 ++++++++++++++++++- .../GetDependsOnNETStandard.netstandard.cs | 6 ++ ...antToBuildADesktopExeWtihNetStandardLib.cs | 50 +++++++++++++++- 5 files changed, 123 insertions(+), 9 deletions(-) diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs index 893c0634cce8..cae332c597c1 100644 --- a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks.UnitTests/GivenAGetDependsOnNETStandardTask.cs @@ -28,8 +28,8 @@ public void CanCheckThisAssembly() }; 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(); + // this test compiles against a sufficiently high System.Runtime + task.DependsOnNETStandard.Should().BeTrue(); } [Fact] @@ -51,8 +51,8 @@ public void CanCheckThisAssemblyByHintPath() }; 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(); + // this test compiles against a sufficiently high System.Runtime + task.DependsOnNETStandard.Should().BeTrue(); } diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs index 8d45c63c8b84..3e7b5908c6bd 100644 --- a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.cs @@ -14,6 +14,14 @@ namespace Microsoft.NET.Build.Tasks public partial class GetDependsOnNETStandard : TaskBase { private const string NetStandardAssemblyName = "netstandard"; + + // System.Runtime from netstandard1.5 + // We also treat this as depending on netstandard so that we can provide netstandard1.5 and netstandard1.6 compatible + // facades since net461 was previously only compatible with netstandard1.4 and thus packages only provided netstandard1.4 + // compatible facades. + private const string SystemRuntimeAssemblyName = "System.Runtime"; + private static readonly Version SystemRuntimeMinVersion = new Version(4, 1, 0, 0); + /// /// Set of reference items to analyze. /// diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs index 513988b9f0a2..cec0cfb6163a 100644 --- a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.net46.cs @@ -48,6 +48,17 @@ internal static bool GetFileDependsOnNETStandard(string filePath) var asmRefEnum = IntPtr.Zero; var asmRefTokens = new UInt32[16]; UInt32 fetched; + + var assemblyMD = new ASSEMBLYMETADATA() + { + rpLocale = IntPtr.Zero, + cchLocale = 0, + rpProcessors = IntPtr.Zero, + cProcessors = 0, + rOses = IntPtr.Zero, + cOses = 0 + }; + // Ensure the enum handle is closed. try { @@ -72,7 +83,7 @@ internal static bool GetFileDependsOnNETStandard(string filePath) null, 0, out asmNameLength, - IntPtr.Zero, + ref assemblyMD, out hashDataPtr, out hashDataLength, out flags); @@ -88,7 +99,7 @@ internal static bool GetFileDependsOnNETStandard(string filePath) assemblyNameBuffer, (uint)assemblyNameBuffer.Capacity, out asmNameLength, - IntPtr.Zero, + ref assemblyMD, out hashDataPtr, out hashDataLength, out flags); @@ -99,6 +110,16 @@ internal static bool GetFileDependsOnNETStandard(string filePath) { return true; } + + if (assemblyName.Equals(SystemRuntimeAssemblyName, StringComparison.Ordinal)) + { + var assemblyVersion = new Version(assemblyMD.usMajorVersion, assemblyMD.usMinorVersion, assemblyMD.usBuildNumber, assemblyMD.usRevisionNumber); + + if (assemblyVersion >= SystemRuntimeMinVersion) + { + return true; + } + } } } while (fetched > 0); } @@ -145,7 +166,7 @@ internal interface IMetaDataDispenser 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 GetAssemblyRefProps(UInt32 mdAsmRef, out IntPtr ppbPublicKeyOrToken, out UInt32 pcbPublicKeyOrToken, StringBuilder strName, UInt32 cchNameIn, out UInt32 pchNameOut, ref ASSEMBLYMETADATA 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(); @@ -162,6 +183,39 @@ internal interface IMetaDataAssemblyImport void CloseEnum([In] IntPtr phEnum); void FindAssembliesByName(); } + + + /* + From cor.h: + typedef struct + { + USHORT usMajorVersion; // Major Version. + USHORT usMinorVersion; // Minor Version. + USHORT usBuildNumber; // Build Number. + USHORT usRevisionNumber; // Revision Number. + LPWSTR szLocale; // Locale. + ULONG cbLocale; // [IN/OUT] Size of the buffer in wide chars/Actual size. + DWORD *rProcessor; // Processor ID array. + ULONG ulProcessor; // [IN/OUT] Size of the Processor ID array/Actual # of entries filled in. + OSINFO *rOS; // OSINFO array. + ULONG ulOS; // [IN/OUT]Size of the OSINFO array/Actual # of entries filled in. + } ASSEMBLYMETADATA; + */ + [StructLayout(LayoutKind.Sequential)] + internal struct ASSEMBLYMETADATA + { + public UInt16 usMajorVersion; + public UInt16 usMinorVersion; + public UInt16 usBuildNumber; + public UInt16 usRevisionNumber; + public IntPtr rpLocale; + public UInt32 cchLocale; + public IntPtr rpProcessors; + public UInt32 cProcessors; + public IntPtr rOses; + public UInt32 cOses; + } + #endregion } } diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs index 871f6da70732..b7ed956079be 100644 --- a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetDependsOnNETStandard.netstandard.cs @@ -29,6 +29,12 @@ internal static bool GetFileDependsOnNETStandard(string filePath) { return true; } + + if (reader.StringComparer.Equals(reference.Name, SystemRuntimeAssemblyName) && + reference.Version >= SystemRuntimeMinVersion) + { + return true; + } } } } diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs index b59e7c79493a..e9a743884db6 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs @@ -294,7 +294,7 @@ public void It_does_not_include_netstandard_when_inbox(bool isSdk) [WindowsOnlyTheory] [InlineData(true)] [InlineData(false)] - public void It_does_not_include_netstandard_when_libary_targets_netstandard1(bool isSdk) + public void It_does_not_include_netstandard_when_libary_targets_netstandard14(bool isSdk) { var testAsset = _testAssetsManager .CopyTestAsset(GetTemplateName(isSdk)) @@ -311,7 +311,7 @@ public void It_does_not_include_netstandard_when_libary_targets_netstandard1(boo var ns = project.Root.Name.Namespace; var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First(); var targetFrameworkProperty = propertyGroup.Element(ns + "TargetFramework"); - targetFrameworkProperty.Value = "netstandard1.6"; + targetFrameworkProperty.Value = "netstandard1.4"; } }); @@ -330,5 +330,51 @@ public void It_does_not_include_netstandard_when_libary_targets_netstandard1(boo outputDirectory.Should().NotHaveFile("netstandard.dll"); } + + [WindowsOnlyTheory] + [InlineData(true)] + [InlineData(false)] + public void It_includes_netstandard_when_libary_targets_netstandard15(bool isSdk) + { + var testAsset = _testAssetsManager + .CopyTestAsset(GetTemplateName(isSdk)) + .WithSource() + .WithProjectChanges((projectPath, project) => + { + if (IsAppProject(projectPath)) + { + AddReferenceToLibrary(project, ReferenceScenario.ProjectReference); + } + + if (IsLibraryProject(projectPath)) + { + var ns = project.Root.Name.Namespace; + var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First(); + var targetFrameworkProperty = propertyGroup.Element(ns + "TargetFramework"); + targetFrameworkProperty.Value = "netstandard1.5"; + } + }); + + testAsset.Restore(Log, relativePath: AppName); + + var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, AppName)); + buildCommand + .Execute() + .Should() + .Pass(); + + var outputDirectory = isSdk ? + buildCommand.GetOutputDirectory("net461") : + buildCommand.GetNonSDKOutputDirectory(); + + // NET461 didn't originally support netstandard2.0, (nor netstandard1.5 or netstandard1.6) + // Since support was added after we need to ensure we apply the shims for netstandard1.5 projects as well. + + outputDirectory.Should().HaveFiles(new[] { + "netstandard.dll", + $"{AppName}.exe.config" + }); + } + } } From c95c82e0f0156df39915434a588101e53c699526 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Wed, 5 Jul 2017 16:32:31 -0700 Subject: [PATCH 04/22] Updating the error message for when you try to build for a TFM/RID not available in your assets.file. --- src/Tasks/Common/Resources/Strings.resx | 4 ++-- src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.de.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.es.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.it.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf | 6 +++--- src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf | 6 +++--- 14 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index 0ab8e8e6537f..78cc0a545876 100644 --- a/src/Tasks/Common/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 included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. Assets file path '{0}' is not rooted. Only full paths are supported. @@ -301,7 +301,7 @@ 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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. diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index d534522bd10f..b417820bc473 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index df8d76c669ca..52a9884dfb41 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index dc493f419980..d5aa53b3d9bf 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}'. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index b9c2df98534f..5fde287e7062 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}'. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index 8b26a76ff72f..04a4bbcf9182 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}'. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index abb116d63d12..6aaf891c2c64 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. 資産ファイル '{0}' に '{1}' のターゲットがありません。TargetFramework='{2}' および RuntimeIdentifier='{3}' のこのプロジェクトを復元したことを確認してください。 @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index e1a10f6a350b..6f2fdbf3e450 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. 자산 파일 '{0}'에 '{1}'의 대상이 없습니다. TargetFramework='{2}' 및 RuntimeIdentifier='{3}'에 대해 이 프로젝트를 복원했는지 확인하세요. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 64d2b36fd761..c5bfd487ef92 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}”. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 34d6e26b4221..cfbf7d7a23ff 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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}'. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index c310e75adade..5f5eef275955 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. Файл ресурсов "{0}" не имеет целевого объекта для "{1}". Убедитесь, что выполнено восстановление этого проекта для TargetFramework="{2}" и RuntimeIdentifier="{3}". @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index d5e6e2a251bb..f58c4f2b7f73 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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. @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index 2ac747cdb397..5cf54b2269a9 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. 资产文件“{0}”没有“{1}”的目标。确保已针对 TargetFramework=“{2}”和 RuntimeIdentifier=“{3}”还原此项目。 @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index a1706c4a4687..17775bccf0ce 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -23,7 +23,7 @@ - Assets file '{0}' doesn't have a target for '{1}'. Ensure you have included '{2}' in the TargetFrameworks for your project. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that you have included '{2}' in the TargetFrameworks for your project. 資產檔案 '{0}' 沒有 '{1}' 的目標。請確定您已還原此專案 (TargetFramework='{2}' 且 RuntimeIdentifier='{3}')。 @@ -303,8 +303,8 @@ - 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. + Assets file '{0}' doesn't have a target for '{1}'. Ensure that restore has run and that 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 that restore has run and that you have included '{2}' in the TargetFrameworks for your project. You may also need to include '{3}' in your project's RuntimeIdentifiers. From 7f5d6e281927ed8fe61e1b4bf287ed0852935ac6 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Sat, 8 Jul 2017 09:56:08 -0700 Subject: [PATCH 05/22] Only use runtimeconfig.dev.json as an input to GenerateRuntimeConfigurationFiles if it exists, thus preventing the task from running every time. --- .../build/Microsoft.NET.Sdk.targets | 7 ++- .../GivenThatWeWantBuildsToBeIncremental.cs | 43 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 test/Microsoft.NET.Build.Tests/GivenThatWeWantBuildsToBeIncremental.cs 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 bedbe52b930b..606b29e1ca89 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 @@ -45,6 +45,11 @@ Copyright (c) .NET Foundation. All rights reserved. true + + + + + $(AssemblyName).deps.json $(TargetDir)$(ProjectDepsFileName) @@ -144,7 +149,7 @@ Copyright (c) .NET Foundation. All rights reserved. DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary" BeforeTargets="CopyFilesToOutputDirectory" Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'" - Inputs="$(ProjectAssetsFile);$(UserRuntimeConfig)" + Inputs="@(GenerateRuntimeConfigurationFilesInputs)" Outputs="$(ProjectRuntimeConfigFilePath);$(ProjectRuntimeConfigDevFilePath)"> Date: Wed, 12 Jul 2017 18:22:48 -0700 Subject: [PATCH 06/22] Expand .NET Standard facades during design-time builds when referencing a .NET Standard project that hasn't been built yet. Fixes #1403 --- ....NET.Build.Extensions.NETFramework.targets | 10 +++++++ .../build/Microsoft.NET.Sdk.targets | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+) 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 index f5f0ebfe4d21..d9d8e3f6f72e 100644 --- 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 @@ -35,6 +35,16 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + true + + 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 606b29e1ca89..2c7e7be7a083 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 @@ -470,6 +470,34 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + + + + $(TargetFrameworkIdentifier) + $(_TargetFrameworkVersionWithoutV) + + + + + + - - - - - $(TargetFrameworkIdentifier) - $(_TargetFrameworkVersionWithoutV) - - - - - + + + $(TargetFrameworkIdentifier) + $(_TargetFrameworkVersionWithoutV) + + + + $(TargetFrameworks);net46 + + + + false + + + diff --git a/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Program.cs b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Program.cs new file mode 100644 index 000000000000..1c43cbef3541 --- /dev/null +++ b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Globalization; +using System.Reflection; +using System.Resources; + +namespace AllResourcesInSatellite +{ + public class Program + { + public static void Main(string[] args) + { + CultureInfo.CurrentUICulture = new CultureInfo("en-US"); + + var resources = new ResourceManager("AllResourcesInSatellite.Strings", typeof(Program).GetTypeInfo().Assembly); + + Console.WriteLine(resources.GetString("HelloWorld")); + } + } +} diff --git a/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Properties/AssemblyInfo.cs b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..74955804d007 --- /dev/null +++ b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Properties/AssemblyInfo.cs @@ -0,0 +1,14 @@ +// 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.Reflection; + +[assembly: AssemblyCompany("My Company")] +[assembly: AssemblyConfiguration("Debug")] +[assembly: AssemblyCopyright("Copyright © 2008 My Company")] +[assembly: AssemblyDescription("My assembly description")] +[assembly: AssemblyFileVersion("12.34.56.78")] +[assembly: AssemblyInformationalVersion("34.56.78.90")] +[assembly: AssemblyProduct("My Product Name")] +[assembly: AssemblyTitle("My assembly title")] +[assembly: AssemblyVersion("12.34")] diff --git a/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Strings.en.resx b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Strings.en.resx new file mode 100644 index 000000000000..a53ceecd7fae --- /dev/null +++ b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/Strings.en.resx @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hello World from en satellite assembly + + \ No newline at end of file diff --git a/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/test.snk b/TestAssets/TestProjects/AllResourcesInSatelliteDisableVersionGenerate/test.snk new file mode 100644 index 0000000000000000000000000000000000000000..066366fae51dd5c4afcf35f9652027c204e9961c GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096yUzVTqL)B#sDt`eSMj-iLAl|a^a4Ukd z{fG?KMPo2*0pV3EjQLw&93WucWgfbAN?|Wr%OPzI;2K16{Di$NaV5g`9Qq56L7pT< zA$!-(E3>XFLTs4FJ+`oZb4Wu0>U!4D@ME@TaW-H5Hu*-Dd*+9Fy*R@eK8=@H>gSxZ zNrJp;AKh4EyhAByKec}b(Q8liywbU4dnZSg`NF(n(Xuqq8Q52xBU$PHT*NGY!)+-UbU)59b*p|Q zIIiCu2yom9c;>X#BMd~fT%U<+;lRcXK2KdzM%tpn?wD1jWVJ`VRTOtTXceter$8Wt z7mmu-@juO7!Xt>oyejg$0afD*L9h;gh*1=`-xLewRTJTrm6UG&h!w3vZslDm9^aYSM+fcQl%VAYbR@hkivO`4K zuHk7F04FP+TfmYo{PKiwc^U!n=a20~yY+^(CQz*;5O~mfG>givIa!wF4l*E~)3iM Date: Mon, 17 Jul 2017 18:38:48 -0700 Subject: [PATCH 15/22] Get Assembly info from Main assembly for SatelliteAssembly Instead of using the info from generating AssemblyInfo. It is not available when GenerateAssemblyInfo flag is off --- .../Common/src/FileUtilities.netstandard.cs | 2 +- .../GetAssemblyAttributes.cs | 58 +++++++++++++++ .../build/Microsoft.NET.Sdk.targets | 16 ++++- ...tSatelliteAssembliesHaveassemblyVersion.cs | 72 +++++++++++++++++++ 4 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs create mode 100644 test/Microsoft.NET.Build.Tests/GivenThatWeWantSatelliteAssembliesHaveassemblyVersion.cs diff --git a/src/Tasks/Common/src/FileUtilities.netstandard.cs b/src/Tasks/Common/src/FileUtilities.netstandard.cs index e972aa2ed5c2..cd11b26128d9 100644 --- a/src/Tasks/Common/src/FileUtilities.netstandard.cs +++ b/src/Tasks/Common/src/FileUtilities.netstandard.cs @@ -42,4 +42,4 @@ private static Version GetAssemblyVersion(string sourcePath) } } -#endif \ No newline at end of file +#endif diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs new file mode 100644 index 000000000000..49a1a8ee3cb3 --- /dev/null +++ b/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs @@ -0,0 +1,58 @@ +// 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.Diagnostics; +using System.IO; +using System.Collections.Generic; +using System; +using Microsoft.Build.Utilities; +using System.Linq; + +namespace Microsoft.NET.Build.Tasks +{ + public class GetAssemblyAttributes : TaskBase + { + [Required] + public string PathToTemplateFile { get; set; } + + [Output] + public ITaskItem[] AssemblyAttributes { get; private set; } + + protected override void ExecuteCore() + { + var fileVersionInfo = FileVersionInfo.GetVersionInfo(Path.GetFullPath(PathToTemplateFile)); + Version assemblyVersion = FileUtilities.TryGetAssemblyVersion(Path.GetFullPath(PathToTemplateFile)); + + AssemblyAttributes = FormatToAttributes(AssemblyAttributesNameByFieldInFileVersionInfo: new Dictionary + { + ["System.Reflection.AssemblyCompanyAttribute"] = fileVersionInfo.CompanyName, + ["System.Reflection.AssemblyCopyrightAttribute"] = fileVersionInfo.LegalCopyright, + ["System.Reflection.AssemblyDescriptionAttribute"] = fileVersionInfo.Comments, + ["System.Reflection.AssemblyFileVersionAttribute"] = fileVersionInfo.FileVersion, + ["System.Reflection.AssemblyInformationalVersionAttribute"] = fileVersionInfo.ProductVersion, + ["System.Reflection.AssemblyProductAttribute"] = fileVersionInfo.ProductName, + ["System.Reflection.AssemblyTitleAttribute"] = fileVersionInfo.FileDescription, + ["System.Reflection.AssemblyVersionAttribute"] = assemblyVersion != null ? assemblyVersion.ToString() : string.Empty + }); + } + + private ITaskItem[] FormatToAttributes(IDictionary AssemblyAttributesNameByFieldInFileVersionInfo) + { + if (AssemblyAttributesNameByFieldInFileVersionInfo == null) + { + AssemblyAttributesNameByFieldInFileVersionInfo = new Dictionary(); + } + + return AssemblyAttributesNameByFieldInFileVersionInfo + .Where(kv => !string.IsNullOrEmpty(kv.Value)) + .Select(kv => + { + var item = new TaskItem(kv.Key); + item.SetMetadata("_Parameter1", kv.Value); + return item; + }) + .ToArray(); + } + } +} 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 1c59ae0c2a40..840baa6a87b1 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 @@ -400,8 +400,10 @@ Copyright (c) .NET Foundation. All rights reserved. + + @@ -414,7 +416,6 @@ Copyright (c) .NET Foundation. All rights reserved. - <_Parameter1>%(_SatelliteAssemblyResourceInputs.Culture) @@ -445,6 +446,17 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + + + + + + + + $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) $([MSBuild]::EnsureTrailingSlash(%(LinkBase))) - %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) + %(LinkBase)%(RecursiveDir)%(Filename)%(Extension) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithSharedProject.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithSharedProject.cs new file mode 100644 index 000000000000..cd07c55577c8 --- /dev/null +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithSharedProject.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Text; +using FluentAssertions; +using Xunit; +using Xunit.Abstractions; +using Microsoft.NET.TestFramework; +using Microsoft.NET.TestFramework.Assertions; +using Microsoft.NET.TestFramework.Commands; +using System.IO; +using System.Linq; + +namespace Microsoft.NET.Build.Tests +{ + public class GivenThatWeWantToBuildAnAppWithSharedProject : SdkTest + { + public GivenThatWeWantToBuildAnAppWithSharedProject(ITestOutputHelper log) : base(log) + { + } + + [Fact] + public void It_does_not_assign_link_metadata_to_items_from_shared_project() + { + var testAsset = _testAssetsManager + .CopyTestAsset("AppWithSharedProject") + .WithSource() + .Restore(Log, "TestApp"); + + var command = new MSBuildCommand(Log, "WriteItems", testAsset.TestRoot, "TestApp"); + + command.Execute() + .Should() + .Pass(); + + string intermediateOutputPath = Path.Combine(command.GetBaseIntermediateDirectory().FullName, "Debug", "netcoreapp2.0"); + string itemsFile = Path.Combine(intermediateOutputPath, "Items.txt"); + + var items = File.ReadAllLines(itemsFile) + .Select(l => l.Split('\t')) + .Select(f => (itemType: f[0], fullPath: f[1], link: f[2])) + .ToList(); + + var itemDict = items.GroupBy(i => i.itemType) + .ToDictionary(g => g.Key, g => g.Select(i => (fullPath: i.fullPath, link: i.link)).ToList()); + + // Compile item in shared project should not have link metadata assigned automatically + itemDict["Compile"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "SharedProject", "Class1.cs"), link: "")); + + // Compile item that is included via main project should have link metadata assigned + itemDict["Compile"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "Linked", "LinkedClass.cs"), link: "LinkedClass.cs")); + + // Content item from shared project should have Link metadata set relative to the shared project (via the AssignLinkMetadata target) + itemDict["Content"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "SharedProject", "MyFolder", "TextFile1.txt"), + link: Path.Combine("MyFolder", "TextFile1.txt"))); + } + + [Fact] + public void It_copies_items_from_shared_project_to_correct_output_folder() + { + var testAsset = _testAssetsManager + .CopyTestAsset("AppWithSharedProject") + .WithSource() + .Restore(Log, "TestApp"); + + var buildCommand = new BuildCommand(Log, testAsset.TestRoot, "TestApp"); + + buildCommand.Execute() + .Should() + .Pass(); + + var outputPath = buildCommand.GetOutputDirectory("netcoreapp2.0"); + + outputPath.Should().NotHaveFile("TextFile1.txt"); + + outputPath.Sub("MyFolder").Should().HaveFile("TextFile1.txt"); + } + } +} From 878d7435a83d46f7612ed602909a9e5363828366 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Thu, 20 Jul 2017 14:52:36 -0700 Subject: [PATCH 19/22] Simplify design time test code --- ...antToBuildADesktopExeWtihNetStandardLib.cs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs index c4a1c7145d6b..7b8c17a8e245 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs @@ -176,21 +176,10 @@ public void It_includes_netstandard_in_design_time_builds() // Verify that netstandard.dll was passed to compiler var references = getCommandLineCommand.GetValues() - .Where(arg => arg.StartsWith("/reference:")) - .Select(arg => arg.Substring("/reference:".Length)) - // Strip quotes if there are any - .Select(r => - { - if (r.StartsWith('"') && r.EndsWith('"')) - { - return r.Substring(1, r.Length - 2); - } - else - { - return r; - } - }) - .ToList(); + .Where(arg => arg.StartsWith("/reference:")) + .Select(arg => arg.Substring("/reference:".Length)) + .Select(r => r.Trim('"')) + .ToList(); references.Select(r => Path.GetFileName(r)) .Should().Contain("netstandard.dll"); From a4f9223da16af0f5fe6b1cac8eb97eef5f7dec50 Mon Sep 17 00:00:00 2001 From: William Li Date: Fri, 21 Jul 2017 10:37:25 -0700 Subject: [PATCH 20/22] Move GetAssemblyAttributes to right dll --- .../GetAssemblyAttributes.cs | 0 .../Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.targets | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/Tasks/{Microsoft.NET.Build.Extensions.Tasks => Microsoft.NET.Build.Tasks}/GetAssemblyAttributes.cs (100%) diff --git a/src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GetAssemblyAttributes.cs similarity index 100% rename from src/Tasks/Microsoft.NET.Build.Extensions.Tasks/GetAssemblyAttributes.cs rename to src/Tasks/Microsoft.NET.Build.Tasks/GetAssemblyAttributes.cs 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 840baa6a87b1..6af9308ebb5a 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 @@ -400,7 +400,7 @@ Copyright (c) .NET Foundation. All rights reserved. - + Date: Fri, 21 Jul 2017 12:17:06 -0700 Subject: [PATCH 21/22] Compare the bitness of runtime identifier and platform target and error out if they don't match. --- .gitignore | 3 + .../Common/Resources/Strings.Designer.cs | 475 +++++------------- src/Tasks/Common/Resources/Strings.resx | 3 + src/Tasks/Common/Resources/xlf/Strings.cs.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.de.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.es.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.fr.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.it.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.ja.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.ko.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.pl.xlf | 5 + .../Common/Resources/xlf/Strings.pt-BR.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.ru.xlf | 5 + src/Tasks/Common/Resources/xlf/Strings.tr.xlf | 5 + .../Common/Resources/xlf/Strings.zh-Hans.xlf | 5 + .../Common/Resources/xlf/Strings.zh-Hant.xlf | 5 + ...oft.NET.RuntimeIdentifierInference.targets | 9 + ...GivenThatWeWantToBuildASelfContainedApp.cs | 62 +++ 18 files changed, 278 insertions(+), 339 deletions(-) diff --git a/.gitignore b/.gitignore index 507aef8d07fd..822a912f1eaf 100644 --- a/.gitignore +++ b/.gitignore @@ -186,3 +186,6 @@ Project.vbproj # VS Code .vscode/ + +# VS for mac +*.userprefs diff --git a/src/Tasks/Common/Resources/Strings.Designer.cs b/src/Tasks/Common/Resources/Strings.Designer.cs index 8377cb9805d9..8ce8e9b328f4 100644 --- a/src/Tasks/Common/Resources/Strings.Designer.cs +++ b/src/Tasks/Common/Resources/Strings.Designer.cs @@ -13,46 +13,32 @@ namespace Microsoft.NET.Build.Tasks { using System.Reflection; - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { - private static global::System.Resources.ResourceManager resourceMan; + private static System.Resources.ResourceManager resourceMan; - private static global::System.Globalization.CultureInfo resourceCulture; + private static System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.NET.Build.Tasks.Resources.Strings", typeof(Strings).GetTypeInfo().Assembly); + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Microsoft.NET.Build.Tasks.Resources.Strings", typeof(Strings).GetTypeInfo().Assembly); resourceMan = temp; } return resourceMan; } } - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -61,588 +47,399 @@ internal Strings() { } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string AppHostHasBeenModified { - get { - return ResourceManager.GetString("AppHostHasBeenModified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Asset preprocessor must be configured before assets are processed.. - /// - internal static string AssetPreprocessorMustBeConfigured { + internal static string AtLeastOneTargetFrameworkMustBeSpecified { get { - return ResourceManager.GetString("AssetPreprocessorMustBeConfigured", resourceCulture); + return ResourceManager.GetString("AtLeastOneTargetFrameworkMustBeSpecified", 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. You may also need to include '{3}' in your project's RuntimeIdentifiers.. - /// - internal static string AssetsFileMissingRuntimeIdentifier { + internal static string NoCompatibleTargetFramework { get { - return ResourceManager.GetString("AssetsFileMissingRuntimeIdentifier", resourceCulture); + return ResourceManager.GetString("NoCompatibleTargetFramework", 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 { + internal static string InvalidFrameworkName { get { - return ResourceManager.GetString("AssetsFileMissingTarget", resourceCulture); + return ResourceManager.GetString("InvalidFrameworkName", resourceCulture); } } - /// - /// Looks up a localized string similar to Assets file '{0}' not found. Run a NuGet package restore to generate this file.. - /// internal static string AssetsFileNotFound { get { return ResourceManager.GetString("AssetsFileNotFound", resourceCulture); } } - /// - /// Looks up a localized string similar to Assets file path '{0}' is not rooted. Only full paths are supported.. - /// - internal static string AssetsFilePathNotRooted { + internal static string AssetsFileMissingTarget { get { - return ResourceManager.GetString("AssetsFilePathNotRooted", resourceCulture); + return ResourceManager.GetString("AssetsFileMissingTarget", resourceCulture); } } - /// - /// Looks up a localized string similar to At least one possible target framework must be specified.. - /// - internal static string AtLeastOneTargetFrameworkMustBeSpecified { + internal static string AssetsFilePathNotRooted { get { - return ResourceManager.GetString("AtLeastOneTargetFrameworkMustBeSpecified", resourceCulture); + return ResourceManager.GetString("AssetsFilePathNotRooted", resourceCulture); } } - /// - /// Looks up a localized string similar to Cannot find project info for '{0}'. This can indicate a missing project reference.. - /// internal static string CannotFindProjectInfo { get { return ResourceManager.GetString("CannotFindProjectInfo", resourceCulture); } } - /// - /// Looks up a localized string similar to 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.. - /// - internal static string CannotHaveSelfContainedWithoutRuntimeIdentifier { + internal static string ContentFileDoesNotContainExpectedParentPackageInformation { get { - return ResourceManager.GetString("CannotHaveSelfContainedWithoutRuntimeIdentifier", resourceCulture); + return ResourceManager.GetString("ContentFileDoesNotContainExpectedParentPackageInformation", resourceCulture); } } - /// - /// 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 { + internal static string MissingItemMetadata { get { - return ResourceManager.GetString("CannotInferTargetFrameworkIdentiferAndVersion", resourceCulture); + return ResourceManager.GetString("MissingItemMetadata", resourceCulture); } } - /// - /// Looks up a localized string similar to Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'.. - /// - internal static string ChoosingAssemblyVersion { + internal static string UnrecognizedPreprocessorToken { get { - return ResourceManager.GetString("ChoosingAssemblyVersion", resourceCulture); + return ResourceManager.GetString("UnrecognizedPreprocessorToken", resourceCulture); } } - /// - /// Looks up a localized string similar to Choosing '{0}' because file version '{1}' is greater than '{2}'.. - /// - internal static string ChoosingFileVersion { + internal static string ContentPreproccessorParameterRequired { get { - return ResourceManager.GetString("ChoosingFileVersion", resourceCulture); + return ResourceManager.GetString("ContentPreproccessorParameterRequired", resourceCulture); } } - /// - /// Looks up a localized string similar to Choosing '{0}' because it is a platform item.. - /// - internal static string ChoosingPlatformItem { + internal static string ProjectAssetsConsumedWithoutMSBuildProjectPath { get { - return ResourceManager.GetString("ChoosingPlatformItem", resourceCulture); + return ResourceManager.GetString("ProjectAssetsConsumedWithoutMSBuildProjectPath", resourceCulture); } } - /// - /// Looks up a localized string similar to Choosing '{0}' because it comes from a package that is preferred.. - /// - internal static string ChoosingPreferredPackage { + internal static string UnexpectedFileType { get { - return ResourceManager.GetString("ChoosingPreferredPackage", resourceCulture); + return ResourceManager.GetString("UnexpectedFileType", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not determine winner due to equal file and assembly versions.. - /// - internal static string ConflictCouldNotDetermineWinner { + internal static string CannotInferTargetFrameworkIdentiferAndVersion { get { - return ResourceManager.GetString("ConflictCouldNotDetermineWinner", resourceCulture); + return ResourceManager.GetString("CannotInferTargetFrameworkIdentiferAndVersion", resourceCulture); } } - /// - /// Looks up a localized string similar to Content file '{0}' does not contain expected parent package information.. - /// - internal static string ContentFileDoesNotContainExpectedParentPackageInformation { + internal static string ContentItemDoesNotProvideOutputPath { get { - return ResourceManager.GetString("ContentFileDoesNotContainExpectedParentPackageInformation", resourceCulture); + return ResourceManager.GetString("ContentItemDoesNotProvideOutputPath", resourceCulture); } } - /// - /// Looks up a localized string similar to Content item for '{0}' sets '{1}', but does not provide '{2}' or '{3}'.. - /// - internal static string ContentItemDoesNotProvideOutputPath { + internal static string DuplicatePreprocessorToken { get { - return ResourceManager.GetString("ContentItemDoesNotProvideOutputPath", resourceCulture); + return ResourceManager.GetString("DuplicatePreprocessorToken", resourceCulture); } } - /// - /// Looks up a localized string similar to The '{0}' task must be given a value for parameter '{1}' in order to consume preprocessed content.. - /// - internal static string ContentPreproccessorParameterRequired { + internal static string ErrorsOccurredWhenEmittingSatelliteAssembly { get { - return ResourceManager.GetString("ContentPreproccessorParameterRequired", resourceCulture); + return ResourceManager.GetString("ErrorsOccurredWhenEmittingSatelliteAssembly", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not determine winner because '{0}' does not exist.. - /// - internal static string CouldNotDetermineWinner_DoesntExist { + internal static string UnableToFindResolvedPath { get { - return ResourceManager.GetString("CouldNotDetermineWinner_DoesntExist", resourceCulture); + return ResourceManager.GetString("UnableToFindResolvedPath", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not determine a winner because '{0}' has no file version.. - /// - internal static string CouldNotDetermineWinner_FileVersion { + internal static string UnexpectedDependencyWithNoVersionNumber { get { - return ResourceManager.GetString("CouldNotDetermineWinner_FileVersion", resourceCulture); + return ResourceManager.GetString("UnexpectedDependencyWithNoVersionNumber", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not determine a winner because '{0}' is not an assembly.. - /// - internal static string CouldNotDetermineWinner_NotAnAssembly { + internal static string AssetPreprocessorMustBeConfigured { get { - return ResourceManager.GetString("CouldNotDetermineWinner_NotAnAssembly", resourceCulture); + return ResourceManager.GetString("AssetPreprocessorMustBeConfigured", resourceCulture); } } - /// - /// Looks up a localized string similar to Could not load PlatformManifest from '{0}' because it did not exist.. - /// - internal static string CouldNotLoadPlatformManifest { + internal static string InvalidNuGetVersionString { get { - return ResourceManager.GetString("CouldNotLoadPlatformManifest", resourceCulture); + return ResourceManager.GetString("InvalidNuGetVersionString", resourceCulture); } } - /// - /// Looks up a localized string similar to Framework not installed: {0} in {1}. - /// internal static string DOTNET1011 { get { return ResourceManager.GetString("DOTNET1011", resourceCulture); } } - /// - /// Looks up a localized string similar to The reference assemblies directory was not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.. - /// internal static string DOTNET1012 { get { return ResourceManager.GetString("DOTNET1012", resourceCulture); } } - /// - /// Looks up a localized string similar to The following dependencies are marked with type 'platform', however only one dependency can have this type: {0}. - /// internal static string DOTNET1013 { get { return ResourceManager.GetString("DOTNET1013", resourceCulture); } } - /// - /// Looks up a localized string similar to Failed to read lock file. - /// internal static string DOTNET1014 { get { return ResourceManager.GetString("DOTNET1014", resourceCulture); } } - /// - /// Looks up a localized string similar to Project file does not exist '{0}'.. - /// internal static string DOTNET1017 { get { return ResourceManager.GetString("DOTNET1017", resourceCulture); } } - /// - /// Looks up a localized string similar to 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}. - /// - internal static string DuplicateItemsError { + internal static string NU1001 { get { - return ResourceManager.GetString("DuplicateItemsError", resourceCulture); + return ResourceManager.GetString("NU1001", resourceCulture); } } - /// - /// Looks up a localized string similar to The preprocessor token '{0}' has been given more than one value. Choosing '{1}' as the value.. - /// - internal static string DuplicatePreprocessorToken { + internal static string NU1002 { get { - return ResourceManager.GetString("DuplicatePreprocessorToken", resourceCulture); + return ResourceManager.GetString("NU1002", resourceCulture); } } - /// - /// Looks up a localized string similar to Encountered conflict between '{0}' and '{1}'.. - /// - internal static string EncounteredConflict { + internal static string NU1006 { get { - return ResourceManager.GetString("EncounteredConflict", resourceCulture); + return ResourceManager.GetString("NU1006", resourceCulture); } } - /// - /// Looks up a localized string similar to Error parsing PlatformManifest from '{0}' line {1}. Lines must have the format {2}.. - /// - internal static string ErrorParsingPlatformManifest { + internal static string NU1007 { get { - return ResourceManager.GetString("ErrorParsingPlatformManifest", resourceCulture); + return ResourceManager.GetString("NU1007", resourceCulture); } } - /// - /// Looks up a localized string similar to Error parsing PlatformManifest from '{0}' line {1}. {2} '{3}' was invalid.. - /// - internal static string ErrorParsingPlatformManifestInvalidValue { + internal static string NU1008 { get { - return ResourceManager.GetString("ErrorParsingPlatformManifestInvalidValue", resourceCulture); + return ResourceManager.GetString("NU1008", resourceCulture); } } - /// - /// Looks up a localized string similar to Errors occured when emitting satellite assembly '{0}'.. - /// - internal static string ErrorsOccurredWhenEmittingSatelliteAssembly { + internal static string NU1009 { get { - return ResourceManager.GetString("ErrorsOccurredWhenEmittingSatelliteAssembly", resourceCulture); + return ResourceManager.GetString("NU1009", resourceCulture); } } - /// - /// Looks up a localized string similar to Given file name '{0}' is longer than 1024 bytes. - /// - internal static string FileNameIsTooLong { + internal static string NU1010 { get { - return ResourceManager.GetString("FileNameIsTooLong", resourceCulture); + return ResourceManager.GetString("NU1010", resourceCulture); } } - /// - /// Looks up a localized string similar to Folder '{0}' already exists either delete it or provide a different ComposeWorkingDir. - /// - internal static string FolderAlreadyExists { + internal static string NU1011 { get { - return ResourceManager.GetString("FolderAlreadyExists", resourceCulture); + return ResourceManager.GetString("NU1011", resourceCulture); } } - /// - /// Looks up a localized string similar to Resolved file has a bad image, no metadata, or is otherwise inaccessible. {0}. - /// - internal static string GetDependsOnNETStandardFailedWithException { + internal static string NU1012 { get { - return ResourceManager.GetString("GetDependsOnNETStandardFailedWithException", resourceCulture); + return ResourceManager.GetString("NU1012", resourceCulture); } } - /// - /// Looks up a localized string similar to Package Root {0} was incorrectly given for Resolved library {1}. - /// internal static string IncorrectPackageRoot { get { return ResourceManager.GetString("IncorrectPackageRoot", resourceCulture); } } - /// - /// Looks up a localized string similar to The target manifest {0} provided is of not the correct format. - /// - internal static string IncorrectTargetFormat { + internal static string MultipleFilesResolved { get { - return ResourceManager.GetString("IncorrectTargetFormat", resourceCulture); + return ResourceManager.GetString("MultipleFilesResolved", resourceCulture); } } - /// - /// Looks up a localized string similar to Invalid framework name: '{0}'.. - /// - internal static string InvalidFrameworkName { + internal static string DuplicateItemsError { get { - return ResourceManager.GetString("InvalidFrameworkName", resourceCulture); + return ResourceManager.GetString("DuplicateItemsError", resourceCulture); } } - /// - /// Looks up a localized string similar to Invalid NuGet version string: '{0}'.. - /// - internal static string InvalidNuGetVersionString { + internal static string PackageReferenceOverrideWarning { get { - return ResourceManager.GetString("InvalidNuGetVersionString", resourceCulture); + return ResourceManager.GetString("PackageReferenceOverrideWarning", resourceCulture); } } - /// - /// Looks up a localized string similar to Missing '{0}' metadata on '{1}' item '{2}'.. - /// - internal static string MissingItemMetadata { + internal static string FolderAlreadyExists { get { - return ResourceManager.GetString("MissingItemMetadata", resourceCulture); + return ResourceManager.GetString("FolderAlreadyExists", resourceCulture); } } - /// - /// Looks up a localized string similar to More than one file found for {0}. - /// - internal static string MultipleFilesResolved { + internal static string IncorrectTargetFormat { get { - return ResourceManager.GetString("MultipleFilesResolved", resourceCulture); + return ResourceManager.GetString("IncorrectTargetFormat", resourceCulture); } } - /// - /// Looks up a localized string similar to Project '{0}' targets '{2}'. It cannot be referenced by a project that targets '{1}'.. - /// - internal static string NoCompatibleTargetFramework { + internal static string ParsingFiles { get { - return ResourceManager.GetString("NoCompatibleTargetFramework", resourceCulture); + return ResourceManager.GetString("ParsingFiles", resourceCulture); } } - /// - /// Looks up a localized string similar to The dependency '{0}' could not be resolved.. - /// - internal static string NU1001 { + internal static string PackageInfoLog { get { - return ResourceManager.GetString("NU1001", resourceCulture); + return ResourceManager.GetString("PackageInfoLog", resourceCulture); } } - /// - /// Looks up a localized string similar to The dependency '{0}' in project '{1}' does not support framework '{2}'.. - /// - internal static string NU1002 { + internal static string RuntimeIdentifierWasNotSpecified { get { - return ResourceManager.GetString("NU1002", resourceCulture); + return ResourceManager.GetString("RuntimeIdentifierWasNotSpecified", resourceCulture); } } - /// - /// Looks up a localized string similar to {0}. Please run 'dotnet restore' to generate a new asset file.. - /// - internal static string NU1006 { + internal static string AppHostHasBeenModified { get { - return ResourceManager.GetString("NU1006", resourceCulture); + return ResourceManager.GetString("AppHostHasBeenModified", resourceCulture); } } - /// - /// Looks up a localized string similar to Dependency specified was '{0}' but ended up with '{1}'.. - /// - internal static string NU1007 { + internal static string FileNameIsTooLong { get { - return ResourceManager.GetString("NU1007", resourceCulture); + return ResourceManager.GetString("FileNameIsTooLong", resourceCulture); } } - /// - /// Looks up a localized string similar to {0} is an unsupported framework.. - /// - internal static string NU1008 { + internal static string CannotHaveSelfContainedWithoutRuntimeIdentifier { get { - return ResourceManager.GetString("NU1008", resourceCulture); + return ResourceManager.GetString("CannotHaveSelfContainedWithoutRuntimeIdentifier", resourceCulture); } } - /// - /// Looks up a localized string similar to The expected asset file does not exist. Please run 'dotnet restore' to generate a new asset file.. - /// - internal static string NU1009 { + internal static string CannotHaveRuntimeIdentifierPlatformMismatchPlatformTarget { get { - return ResourceManager.GetString("NU1009", resourceCulture); + return ResourceManager.GetString("CannotHaveRuntimeIdentifierPlatformMismatchPlatformTarget", resourceCulture); } } - /// - /// Looks up a localized string similar to The dependency type was changed. - /// - internal static string NU1010 { + internal static string ChoosingAssemblyVersion { get { - return ResourceManager.GetString("NU1010", resourceCulture); + return ResourceManager.GetString("ChoosingAssemblyVersion", resourceCulture); } } - /// - /// Looks up a localized string similar to The dependency target '{0}' is unsupported.. - /// - internal static string NU1011 { + internal static string ChoosingFileVersion { get { - return ResourceManager.GetString("NU1011", resourceCulture); + return ResourceManager.GetString("ChoosingFileVersion", resourceCulture); } } - /// - /// Looks up a localized string similar to Dependency conflict. '{0}' expected '{1}' but received '{2}'. - /// - internal static string NU1012 { + internal static string ChoosingPlatformItem { get { - return ResourceManager.GetString("NU1012", resourceCulture); + return ResourceManager.GetString("ChoosingPlatformItem", resourceCulture); } } - /// - /// Looks up a localized string similar to Package Name='{0}', Version='{1}' was parsed. - /// - internal static string PackageInfoLog { + internal static string ChoosingPreferredPackage { get { - return ResourceManager.GetString("PackageInfoLog", resourceCulture); + return ResourceManager.GetString("ChoosingPreferredPackage", resourceCulture); } } - /// - /// Looks up a localized string similar to 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}. - /// - internal static string PackageReferenceOverrideWarning { + internal static string ConflictCouldNotDetermineWinner { get { - return ResourceManager.GetString("PackageReferenceOverrideWarning", resourceCulture); + return ResourceManager.GetString("ConflictCouldNotDetermineWinner", resourceCulture); } } - /// - /// Looks up a localized string similar to Parsing the Files : '{0}'. - /// - internal static string ParsingFiles { + internal static string CouldNotDetermineWinner_DoesntExist { get { - return ResourceManager.GetString("ParsingFiles", resourceCulture); + return ResourceManager.GetString("CouldNotDetermineWinner_DoesntExist", resourceCulture); } } - /// - /// Looks up a localized string similar to Assets are consumed from project '{0}', but no corresponding MSBuild project path was found in '{1}'.. - /// - internal static string ProjectAssetsConsumedWithoutMSBuildProjectPath { + internal static string CouldNotDetermineWinner_FileVersion { get { - return ResourceManager.GetString("ProjectAssetsConsumedWithoutMSBuildProjectPath", resourceCulture); + return ResourceManager.GetString("CouldNotDetermineWinner_FileVersion", resourceCulture); } } - /// - /// Looks up a localized string similar to Specify a RuntimeIdentifier. - /// - internal static string RuntimeIdentifierWasNotSpecified { + internal static string CouldNotDetermineWinner_NotAnAssembly { get { - return ResourceManager.GetString("RuntimeIdentifierWasNotSpecified", resourceCulture); + return ResourceManager.GetString("CouldNotDetermineWinner_NotAnAssembly", resourceCulture); } } - /// - /// Looks up a localized string similar to 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles, but are being skipped because 'RuntimeConfigDevPath' is empty.. - /// - internal static string SkippingAdditionalProbingPaths { + internal static string EncounteredConflict { get { - return ResourceManager.GetString("SkippingAdditionalProbingPaths", resourceCulture); + return ResourceManager.GetString("EncounteredConflict", 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 { + internal static string CouldNotLoadPlatformManifest { get { - return ResourceManager.GetString("TargetFrameworkWithSemicolon", resourceCulture); + return ResourceManager.GetString("CouldNotLoadPlatformManifest", resourceCulture); } } - /// - /// Looks up a localized string similar to Unable to find resolved path for '{0}'.. - /// - internal static string UnableToFindResolvedPath { + internal static string ErrorParsingPlatformManifest { get { - return ResourceManager.GetString("UnableToFindResolvedPath", resourceCulture); + return ResourceManager.GetString("ErrorParsingPlatformManifest", resourceCulture); } } - /// - /// Looks up a localized string similar to Unexpected dependency '{0}' with no version number.. - /// - internal static string UnexpectedDependencyWithNoVersionNumber { + internal static string ErrorParsingPlatformManifestInvalidValue { get { - return ResourceManager.GetString("UnexpectedDependencyWithNoVersionNumber", resourceCulture); + return ResourceManager.GetString("ErrorParsingPlatformManifestInvalidValue", resourceCulture); } } - /// - /// Looks up a localized string similar to Unexpected file type for '{0}'. Type is both '{1}' and '{2}'.. - /// - internal static string UnexpectedFileType { + internal static string UnsupportedTargetFrameworkVersion { get { - return ResourceManager.GetString("UnexpectedFileType", resourceCulture); + return ResourceManager.GetString("UnsupportedTargetFrameworkVersion", resourceCulture); } } - /// - /// Looks up a localized string similar to Unrecognized preprocessor token '{0}' in '{1}'.. - /// - internal static string UnrecognizedPreprocessorToken { + internal static string TargetFrameworkWithSemicolon { get { - return ResourceManager.GetString("UnrecognizedPreprocessorToken", resourceCulture); + return ResourceManager.GetString("TargetFrameworkWithSemicolon", resourceCulture); } } - /// - /// 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 { + internal static string AssetsFileMissingRuntimeIdentifier { get { - return ResourceManager.GetString("UnsupportedSDKVersionForNetStandard20", resourceCulture); + return ResourceManager.GetString("AssetsFileMissingRuntimeIdentifier", 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}.. - /// - internal static string UnsupportedTargetFrameworkVersion { + internal static string SkippingAdditionalProbingPaths { get { - return ResourceManager.GetString("UnsupportedTargetFrameworkVersion", resourceCulture); + return ResourceManager.GetString("SkippingAdditionalProbingPaths", resourceCulture); + } + } + + internal static string GetDependsOnNETStandardFailedWithException { + get { + return ResourceManager.GetString("GetDependsOnNETStandardFailedWithException", resourceCulture); + } + } + + internal static string UnsupportedSDKVersionForNetStandard20 { + get { + return ResourceManager.GetString("UnsupportedSDKVersionForNetStandard20", resourceCulture); } } } diff --git a/src/Tasks/Common/Resources/Strings.resx b/src/Tasks/Common/Resources/Strings.resx index 78cc0a545876..fcea8d0426c8 100644 --- a/src/Tasks/Common/Resources/Strings.resx +++ b/src/Tasks/Common/Resources/Strings.resx @@ -258,6 +258,9 @@ 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. + + The RuntimeIdentifier platform and the PlatformTarget must match. + Choosing '{0}' because AssemblyVersion '{1}' is greater than '{2}'. diff --git a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf index 7fbd14ad70cb..31db50aa987b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.cs.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.cs.xlf @@ -327,6 +327,11 @@ Cesty AdditionalProbingPaths byly zadány pro GenerateRuntimeConfigurationFiles, ale vynechávají se, protože RuntimeConfigDevPath je prázdné. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.de.xlf b/src/Tasks/Common/Resources/xlf/Strings.de.xlf index 035e548ccbe0..b73d67fd9608 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.de.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.de.xlf @@ -327,6 +327,11 @@ Die von diesem Projekt verwendete Microsoft.NET.Sdk-Version ist für die Unterstützung von .NET Standard 2.0 nicht ausreichend, was für die Verweise dieses Projekts jedoch erforderlich ist. Installieren Sie Version 2.0 oder höher des .NET Core SDK. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.es.xlf b/src/Tasks/Common/Resources/xlf/Strings.es.xlf index ba4392aa6df5..c553ec3ea6ac 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.es.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.es.xlf @@ -327,6 +327,11 @@ La versión de Microsoft.NET.Sdk que se usa en este proyecto no es suficiente para admitir .NET Standard 2.0, que es necesario para las referencias de este proyecto. Instale la versión 2.0 o superior del SDK de .NET Core. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf index a8f41102a854..1ee4331348cf 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.fr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.fr.xlf @@ -327,6 +327,11 @@ La version de Microsoft.NET.Sdk utilisée par ce projet ne permet pas de prendre en charge .NET Standard 2.0, lequel est nécessaire aux références de ce projet. Installez la version 2.0 ou une version ultérieure du kit .NET Core SDK. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.it.xlf b/src/Tasks/Common/Resources/xlf/Strings.it.xlf index e5c24e410553..87773b90c023 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.it.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.it.xlf @@ -327,6 +327,11 @@ La versione di Microsoft.NET.Sdk usata da questo progetto non è sufficiente per supportare .NET Standard 2.0 che è richiesto dai riferimenti di questo progetto. Installare la versione 2.0 o successiva di .NET Core SDK. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf index e02ddb804ed2..9527767bbbc7 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ja.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ja.xlf @@ -327,6 +327,11 @@ このプロジェクトで使用される Microsoft.NET.Sdk のバージョンは、このプロジェクトの参照で必要な .NET Standard 2.0 をサポートするには不十分です。.NET Core SDK のバージョン 2.0 以降をインストールしてください。 + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf index c8c54a665ec7..670749f8cf46 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ko.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ko.xlf @@ -327,6 +327,11 @@ 이 프로젝트에서 사용하는 Microsoft.NET.Sdk 버전이 이 프로젝트의 참조에서 필요로 하는 .NET 표준 2.0을 지원할 수 없습니다. .NET Core SDK 버전 2.0 이상을 설치하세요. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf index 7761eb130f7f..824c247c044c 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pl.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pl.xlf @@ -327,6 +327,11 @@ Używana przez ten projekt wersja zestawu Microsoft.NET.Sdk jest niewystarczająca do zapewnienia obsługi środowiska .NET Standard 2.0 wymaganego przez odwołania występujące w tym projekcie. Zainstaluj zestaw .NET Core SDK w wersji co najmniej 2.0. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf index 8d7f9eb5241d..33091776c313 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf @@ -327,6 +327,11 @@ A versão do Microsoft.NET.Sdk usado por este projeto é insuficiente para dar suporte ao .NET Standard 2.0, que é exigido pelas referências deste projeto. Instale a versão 2.0 ou superior do SDK .NET Core. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf index a5b9aaad2a6f..6c04529f019d 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.ru.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.ru.xlf @@ -327,6 +327,11 @@ Используемая для этого проекта версия Microsoft.NET.SDK недостаточна для поддержки версии .NET Standard 2.0, необходимой согласно документам по этому проекту. Установите пакет SDK для .NET Core версии 2.0 или более поздней. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf index 44870e120dae..ab2d29d1d9fe 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.tr.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.tr.xlf @@ -327,6 +327,11 @@ Bu proje tarafından kullanılan Microsoft.NET.Sdk, proje başvurularının gerektirdiği .NET Standard 2.0’ı desteklemek için yeterli değil. Lütfen .NET Core SDK 2.0 veya sonraki bir sürümü yükleyin. + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf index c5b3648078b2..df5475e205c8 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -327,6 +327,11 @@ 该项目使用的 Microsoft.NET.Sdk 版本不足以支持项目引用所需的 .NET Standard 2.0。请安装 2.0 版本或更高版本的 .NET Core SDK。 + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf index f35b7f812487..8ec038d56b3b 100644 --- a/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/Tasks/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -327,6 +327,11 @@ 此專案所使用的 Microsoft.NET.Sdk 版本,不足以支援此專案參考所需的 .NET Standard 2.0。請安裝 NET Core SDK 2.0 版或更高版本。 + + The RuntimeIdentifier platform and the PlatformTarget must match. + The RuntimeIdentifier platform and the PlatformTarget must match. + + \ No newline at end of file diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.RuntimeIdentifierInference.targets index f5341c7c4398..ffbaa2b78e96 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.RuntimeIdentifierInference.targets @@ -118,6 +118,15 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + + + true diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs index 6dbfdd3b4d2a..7fe2293c6b74 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs @@ -69,5 +69,67 @@ public void It_builds_a_runnable_output() .And .HaveStdOutContaining("Hello World!"); } + + [Fact] + public void It_errors_out_when_RuntimeIdentifier_architecture_and_PlatformTarget_do_no_match() + { + var testAsset = _testAssetsManager + .CopyTestAsset("HelloWorld") + .WithSource() + .WithProjectChanges(project => + { + var ns = project.Root.Name.Namespace; + var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First(); + propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", "win10-x64")); + propertyGroup.Add(new XElement(ns + "PlatformTarget", "x86")); + }) + .Restore(Log); + + var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot)); + + buildCommand + .Execute() + .Should() + .Fail(); + } + + [Fact] + public void It_does_not_error_out_when_RuntimeIdentifier_architecture_and_PlatformTarget_do_no_match_but_PlatformTarget_is_AnyCPU() + { + var targetFramework = "netcoreapp1.1"; + var runtimeIdentifier = EnvironmentInfo.GetCompatibleRid(targetFramework); + var testAsset = _testAssetsManager + .CopyTestAsset("HelloWorld") + .WithSource() + .WithProjectChanges(project => + { + var ns = project.Root.Name.Namespace; + var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First(); + propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier)); + propertyGroup.Add(new XElement(ns + "PlatformTarget", "AnyCPU")); + }) + .Restore(Log); + + var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot)); + + buildCommand + .Execute() + .Should() + .Pass(); + + var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: runtimeIdentifier); + var selfContainedExecutable = $"HelloWorld{Constants.ExeSuffix}"; + + string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); + + Command.Create(selfContainedExecutableFullPath, new string[] { }) + .EnsureExecutable() + .CaptureStdOut() + .Execute() + .Should() + .Pass() + .And + .HaveStdOutContaining("Hello World!"); + } } } From f0a997267a1b312cf52bfd5a6346cdcff4c6a489 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Fri, 21 Jul 2017 13:19:39 -0700 Subject: [PATCH 22/22] Shortening test names because of windows path limitations. --- .../GivenThatWeWantToBuildASelfContainedApp.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs index 7fe2293c6b74..eaf7c78f3e84 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs @@ -71,7 +71,7 @@ public void It_builds_a_runnable_output() } [Fact] - public void It_errors_out_when_RuntimeIdentifier_architecture_and_PlatformTarget_do_no_match() + public void It_errors_out_when_RuntimeIdentifier_architecture_and_PlatformTarget_do_not_match() { var testAsset = _testAssetsManager .CopyTestAsset("HelloWorld") @@ -94,7 +94,7 @@ public void It_errors_out_when_RuntimeIdentifier_architecture_and_PlatformTarget } [Fact] - public void It_does_not_error_out_when_RuntimeIdentifier_architecture_and_PlatformTarget_do_no_match_but_PlatformTarget_is_AnyCPU() + public void It_succeeds_when_RuntimeIdentifier_and_PlatformTarget_mismatch_but_PT_is_AnyCPU() { var targetFramework = "netcoreapp1.1"; var runtimeIdentifier = EnvironmentInfo.GetCompatibleRid(targetFramework);