Skip to content

Commit 0ebff9d

Browse files
tejasd1990root
andauthored
manual cherry-pick from #13917 (#13928)
Co-authored-by: root <[email protected]>
1 parent cc8e4dd commit 0ebff9d

File tree

6 files changed

+113
-136
lines changed

6 files changed

+113
-136
lines changed

Tasks/DotNetCoreCLIV2/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"loc.messages.NGCommon_UnableToFindTool": "Unable to find tool %s",
135135
"loc.messages.Warning_SessionCreationFailed": "Could not create provenance session: %s",
136136
"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.",
137-
"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",
137+
"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",
138+
"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",
138139
"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."
139140
}

Tasks/DotNetCoreCLIV2/dotnetcore.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import * as pushCommand from './pushcommand';
1111
import * as restoreCommand from './restorecommand';
1212
import * as utility from './Common/utility';
1313

14-
let MessagePrinted = false;
15-
1614
export class dotNetExe {
1715
private command: string;
1816
private projects: string[];
@@ -67,9 +65,7 @@ export class dotNetExe {
6765
}
6866
}
6967
finally {
70-
if (!MessagePrinted) {
71-
console.log(tl.loc('NetCore3Update'));
72-
}
68+
console.log(tl.loc('Net5Update'));
7369
}
7470
}
7571

@@ -131,11 +127,9 @@ export class dotNetExe {
131127
}
132128
}
133129
if (failedProjects.length > 0) {
134-
if (this.command === 'publish' && !MessagePrinted) {
135-
tl.warning(tl.loc('NetCore3Update'));
136-
MessagePrinted = true;
130+
if (this.command === 'build' || this.command === 'publish' || this.command === 'run') {
131+
tl.warning(tl.loc('Net5NugetVersionCompat'));
137132
}
138-
139133
throw tl.loc("dotnetCommandFailed", failedProjects);
140134
}
141135
}
@@ -181,6 +175,7 @@ export class dotNetExe {
181175
this.publishTestResults(resultsDirectory);
182176
}
183177
if (failedProjects.length > 0) {
178+
tl.warning(tl.loc('Net5NugetVersionCompat'));
184179
throw tl.loc('dotnetCommandFailed', failedProjects);
185180
}
186181
}

0 commit comments

Comments
 (0)