Skip to content

Commit f14739b

Browse files
authored
fix: windows powershell needs both unsafe 4.5.3 and 6.0.0 (#61)
* fix: windows powershell needs both unsafe 4.5.3 and 6.0.0 * chore: update changelog
1 parent 51d4246 commit f14739b

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
### Fixes
66

7-
- StackTrace parsing on Windows Powershell 5.1 ([#50](https://github.com/getsentry/sentry-powershell/pull/50))
7+
- StackTrace parsing on Windows PowerShell 5.1 ([#50](https://github.com/getsentry/sentry-powershell/pull/50))
88
- Fix out of bounds context for short scripts ([#58](https://github.com/getsentry/sentry-powershell/pull/58))
9+
- Windows PowerShell needs both unsafe 4.5.3 and 6.0.0 dll ([#61](https://github.com/getsentry/sentry-powershell/pull/61))
910

1011
### Dependencies
1112

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package = System.Runtime.CompilerServices.Unsafe
12
version = 4.5.3
23
assemblyVersion = 4.0.4.1
34
licenseFile = LICENSE.TXT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package = System.Runtime.CompilerServices.Unsafe
2+
version = 6.0.0
3+
assemblyVersion = 6.0.0.0
4+
licenseFile = LICENSE.TXT

dependencies/download.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function Download([string] $dependency, [string] $TFM, [string] $targetTFM = $nu
2727
$assemblyVersion = $props.ContainsKey('assemblyVersion') ? $props.assemblyVersion : "$($props.version).0"
2828
}
2929

30+
$package = $props.ContainsKey('package') ? $props.package : $dependency
3031
$targetLibFile = "$libDir/$targetTFM/$dependency.dll"
3132
$targetVersionFile = "$libDir/$targetTFM/$dependency.version"
3233
$targetLicenseFile = "$libDir/$targetTFM/$dependency.license"
@@ -58,7 +59,7 @@ function Download([string] $dependency, [string] $TFM, [string] $targetTFM = $nu
5859
Remove-Item $targetLicenseFile -Force
5960
}
6061

61-
$archiveName = "$($dependency.ToLower()).$($props.version).nupkg"
62+
$archiveName = "$($package.ToLower()).$($props.version).nupkg"
6263
$archiveFile = "$downloadDir/$archiveName"
6364

6465
if (Test-Path $archiveFile)
@@ -67,8 +68,8 @@ function Download([string] $dependency, [string] $TFM, [string] $targetTFM = $nu
6768
}
6869
else
6970
{
70-
Write-Output "Downloading $archiveName"
7171
$sourceUrl = "https://globalcdn.nuget.org/packages/$archiveName"
72+
Write-Output "Downloading $sourceUrl"
7273
Invoke-WebRequest $sourceUrl -OutFile $archiveFile
7374
}
7475

@@ -89,7 +90,7 @@ function Download([string] $dependency, [string] $TFM, [string] $targetTFM = $nu
8990

9091
try
9192
{
92-
extract "lib/$TFM/$dependency.dll" $targetLibFile
93+
extract "lib/$TFM/$package.dll" $targetLibFile
9394
if ($props.ContainsKey('licenseFile'))
9495
{
9596
extract $props.licenseFile $targetLicenseFile
@@ -120,7 +121,8 @@ Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Collections.Immut
120121
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Memory'
121122
Download -TFM 'net46' -TargetTFM 'net462' -Dependency 'System.Numerics.Vectors'
122123
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Reflection.Metadata'
123-
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Runtime.CompilerServices.Unsafe'
124+
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Runtime.CompilerServices.Unsafe.4'
125+
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Runtime.CompilerServices.Unsafe.6'
124126
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Text.Encodings.Web'
125127
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Text.Json'
126128
Download -TFM 'net461' -TargetTFM 'net462' -Dependency 'System.Threading.Tasks.Extensions'

0 commit comments

Comments
 (0)