dotnet / dotnet/vscode-dotnet-runtime
When downloading `dotnet-install.ps1` is blocked by Cloudflare the raw html of the url is downloaded instead
- Dominant language
- TypeScript
- Stars
- 209
- Forks
- 455
- PR merge metrics
- No merged PRs in 30d
Description
Please attach the log file located at c:\Users\marley.powell\AppData\Roaming\Code\logs\20230608T080953\window2\exthost\ms-dotnettools.vscode-dotnet-runtime\DotNetAcquisition-ms-dotnettools.vscode-dotnet-runtime-1686208396614.txt. Note that this file may contain personal data.
This log file was empty.
**Actual**
When the extension fails to download `dotnet-install.ps1` due to being blocked by Cloudflare the raw html is copied to the ps1 script instead of the expected powershell. This would probably happen with any other corporate network blocking.
**Expected**
If the powershell script can't be downloaded for whatever reason then a fallback script that errors accordingly would be nicer than the raw html.
Also I already have dotnet installed in the default location so it would be nice if the extension could detect that rather than me having to specify:
```
{
"dotnetAcquisitionExtension.existingDotnetPath": [
{
"extensionId": "ms-dotnettools.vscode-dotnet-runtime-1.6.0",
"path": "C:/Program Files/dotnet/dotnet.exe"
}
]
}
```
**Error**
```
**Repro steps:**
1.
**Extension Version:** 1.0.0
**Error Message:** .NET Acquisition Failed: Installation failed: At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:8 char:15
+ @import url("https://fonts.googleapis.com/css?family=Roboto&dis ...
+ ~~~
Unexpected token 'url' in expression or statement.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:107 char:78
+ ... c = backgroundColor.match(/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/);
+ ~
Unexpected token '\' in expression or statement.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:107 char:78
+ ... c = backgroundColor.match(/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/);
+ ~
Missing closing ')' in expression.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:106 char:51
+ const shouldShowDark = (backgroundColor) => {
+ ~
Missing closing '}' in statement block or type definition.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:107 char:81
+ ... c = backgroundColor.match(/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/);
+ ~
Unexpected token ')' in expression or statement.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:109 char:7
+ }
+ ~
Unexpected token '}' in expression or statement.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:111 char:32
+ window.onload = function() {
+ ~
An expression was expected after '('.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:121 char:49
+
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At C:\Users\marley.powell\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install
scripts\dotnet-install.ps1:132 char:49
+
Contributor guide
Assessment
This issue has not been assessed yet.