Skip to content

Commit dba6bff

Browse files
committed
bug fix for preview version with extra '.'
1 parent bc12fe4 commit dba6bff

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Installer/Microsoft.Dotnet.Installation/Internal/ChannelVersionResolver.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,12 @@ public static bool IsValidChannelFormat(string channel)
107107
return true;
108108
}
109109

110+
// Strip prerelease suffix (e.g., "10.0.100-preview.1.32640" -> "10.0.100")
111+
var dashIndex = channel.IndexOf('-');
112+
var versionPart = dashIndex >= 0 ? channel.Substring(0, dashIndex) : channel;
113+
110114
// Try to parse as a version-like string
111-
var parts = channel.Split('.');
115+
var parts = versionPart.Split('.');
112116
if (parts.Length == 0 || parts.Length > 4)
113117
{
114118
return false;

src/Installer/dotnetup/Telemetry/ErrorCodeMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private static ExceptionErrorInfo MapIOException(IOException ioEx, string? stack
251251

252252
var inner = ex.InnerException;
253253
// Limit depth to prevent infinite loops and overly long strings
254-
const int maxDepth = 5;
254+
const int maxDepth = 10;
255255
var depth = 0;
256256
while (inner != null && depth < maxDepth)
257257
{

0 commit comments

Comments
 (0)