Skip to content

Commit

Permalink
manual cherry-pick from #13917 (#13928)
Browse files Browse the repository at this point in the history
Co-authored-by: root <root@td-testw2019-1.localdomain>
  • Loading branch information
tejasd1990 and root authored Nov 19, 2020
1 parent cc8e4dd commit 0ebff9d
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"loc.messages.NGCommon_UnableToFindTool": "Unable to find tool %s",
"loc.messages.Warning_SessionCreationFailed": "Could not create provenance session: %s",
"loc.messages.Warning_UpdatingNuGetVersion": "Updating version of NuGet.exe to %s from %s. Behavior changes or breaking changes might occur as NuGet updates to a new version. If this is not desired, deselect the 'Check for Latest Version' option in the task.",
"loc.messages.NetCore3Update": "Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions. \nSome commonly encountered changes are: \nIf you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting",
"loc.messages.Net5Update": "Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting",
"loc.messages.Net5NugetVersionCompat": ".NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build",
"loc.messages.DeprecatedDotnet2_2_And_3_0": "Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version."
}
13 changes: 4 additions & 9 deletions Tasks/DotNetCoreCLIV2/dotnetcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import * as pushCommand from './pushcommand';
import * as restoreCommand from './restorecommand';
import * as utility from './Common/utility';

let MessagePrinted = false;

export class dotNetExe {
private command: string;
private projects: string[];
Expand Down Expand Up @@ -67,9 +65,7 @@ export class dotNetExe {
}
}
finally {
if (!MessagePrinted) {
console.log(tl.loc('NetCore3Update'));
}
console.log(tl.loc('Net5Update'));
}
}

Expand Down Expand Up @@ -131,11 +127,9 @@ export class dotNetExe {
}
}
if (failedProjects.length > 0) {
if (this.command === 'publish' && !MessagePrinted) {
tl.warning(tl.loc('NetCore3Update'));
MessagePrinted = true;
if (this.command === 'build' || this.command === 'publish' || this.command === 'run') {
tl.warning(tl.loc('Net5NugetVersionCompat'));
}

throw tl.loc("dotnetCommandFailed", failedProjects);
}
}
Expand Down Expand Up @@ -181,6 +175,7 @@ export class dotNetExe {
this.publishTestResults(resultsDirectory);
}
if (failedProjects.length > 0) {
tl.warning(tl.loc('Net5NugetVersionCompat'));
throw tl.loc('dotnetCommandFailed', failedProjects);
}
}
Expand Down
Loading

0 comments on commit 0ebff9d

Please sign in to comment.