Skip to content

Commit 6b83efb

Browse files
committed
Fix for issue #27
Pass the platform from uninstall.ps1 to remove_config function, and use the same rules to delete the ExceptionlessModule from system.web/httpModules and system.webServer/modules as were used to insert
1 parent 366ecd8 commit 6b83efb

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Source/Platforms/Mvc/NuGet/tools/uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Import-Module (Join-Path $toolsPath exceptionless.psm1)
55
$configPath = find_config $project
66

77
if ($configPath -ne $null) {
8-
remove_config $configPath
8+
remove_config $configPath 'Mvc'
99
}

Source/Platforms/Web/NuGet/tools/uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Import-Module (Join-Path $toolsPath exceptionless.psm1)
55
$configPath = find_config $project
66

77
if ($configPath -ne $null) {
8-
remove_config $configPath
8+
remove_config $configPath 'Web'
99
}

Source/Platforms/WebApi/NuGet/tools/uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Import-Module (Join-Path $toolsPath exceptionless.psm1)
55
$configPath = find_config $project
66

77
if ($configPath -ne $null) {
8-
remove_config $configPath
8+
remove_config $configPath 'WebApi'
99
}

Source/Shared/NuGet/tools/exceptionless.psm1

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function update_config($configPath, $platform) {
106106
}
107107
}
108108

109-
function remove_config($configPath) {
109+
function remove_config($configPath, $platform) {
110110
[xml] $configXml = gc $configPath
111111
$shouldSave = $false
112112

@@ -127,16 +127,18 @@ function remove_config($configPath) {
127127
}
128128
}
129129

130-
$webModule = $configXml.SelectSingleNode("configuration/system.web/httpModules/add[@name='ExceptionlessModule']")
131-
if ($webModule -ne $null) {
132-
[Void]$webModule.ParentNode.RemoveChild($webModule)
133-
$shouldSave = $true
134-
}
130+
if ($platform -ne $null -and $platform -ne 'WebApi') {
131+
$webModule = $configXml.SelectSingleNode("configuration/system.web/httpModules/add[@name='ExceptionlessModule']")
132+
if ($webModule -ne $null) {
133+
[Void]$webModule.ParentNode.RemoveChild($webModule)
134+
$shouldSave = $true
135+
}
135136

136-
$webServerModule = $configXml.SelectSingleNode("configuration/system.webServer/modules/add[@name='ExceptionlessModule']")
137-
if ($webServerModule -ne $null) {
138-
[Void]$webServerModule.ParentNode.RemoveChild($webServerModule)
139-
$shouldSave = $true
137+
$webServerModule = $configXml.SelectSingleNode("configuration/system.webServer/modules/add[@name='ExceptionlessModule']")
138+
if ($webServerModule -ne $null) {
139+
[Void]$webServerModule.ParentNode.RemoveChild($webServerModule)
140+
$shouldSave = $true
141+
}
140142
}
141143

142144

0 commit comments

Comments
 (0)