When I used the Add Docker Files to Workspace... utility I get an error message that says:
Cannot generate Dockerfiles for a .NET project unless version 1.23.9 or higher of the C# extension is installed.
I assume this is referring to the Microsoft C# extension for vscode. I have restarted my computer and vscode. I believe both the Docker and C# extensions are installed and updated to their most recent version however I still get this error.
Please let me know if you need me to provide you with further information.
Can you check the extensions tab and see what version of the C# extension you have?
Im facing the same issue, version is 1.23.11
Strange. Does the issue persist if you restart VSCode @pecigonzalo? Are you using a remote session?
Yes it does. I'm indeed using a remote session to WSL2, I suspect that might be the culprit, maybe some bug in checking the remote/local version?
I manually edited the file as a test, inverted the > check and it "works" now.
When I list my extensions with versions using dotnet --list-extensions --show-versions I get [email protected] for the c# tools.
I am not using a remote desktop or WSL working directly on a mac and have reproduced this on two separate mac machines.
I manually edited the file as a test, inverted the > check and it "works" now.
@pecigonzalo As in, this check? I'd be very interested in what VSCode is giving for cSharpExtension.packageJSON.version there.
🤦♂️ I realized what's wrong. That < is exactly the problem, it doesn't actually mean what you'd expect. SemVer should be using .lt(), instead. I'm guessing it's doing string comparison; considering strings, '1.23.9' is equal to '1.23.9'--so it passed our initial testing--but '1.23.11' is less than '1.23.9' (alphabetically, i.e. how strings get compared).
I manually edited the file as a test, inverted the > check and it "works" now.
@pecigonzalo As in, this check? I'd be very interested in what VSCode is giving for
cSharpExtension.packageJSON.versionthere.
Yep, exactly that one. It was in the minified JS so I just inverted the symbol, although I could have replaced with just false.
🤦♂️ I realized what's wrong. That
<is exactly the problem, it doesn't actually mean what you'd expect. SemVer should be using.lt(), instead. I'm guessing it's doing string comparison; considering strings, '1.23.9' is equal to '1.23.9'--so it passed our initial testing--but '1.23.11' is less than '1.23.9' (alphabetically, i.e. how strings get compared).
Yeah, that sounds about right. 🎉 Nice find.
@pecigonzalo @dpwdec As a workaround, you can install C# extension 1.23.9 specifically, add the Dockerfiles, and then update back to 1.23.11+.


I'm going to get a fix out ASAP.
Ok, I just released an update to the Docker extension a few seconds ago. This issue is now fixed in 1.12.1. Sorry for the headache @dpwdec, @pecigonzalo, and thanks for helping me figure it out!
No worries! Thank you for fixing it so fast. I'll install it first thing
tomorrow.
On Mon, Apr 12, 2021, 10:29 PM Brandon Waterloo [MSFT] <
@.*> wrote:
Ok, I just released an update to the Docker extension a few seconds ago.
This issue is now fixed in 1.12.1. Sorry for the headache @dpwdec
https://github.com/dpwdec, @pecigonzalo https://github.com/pecigonzalo,
and thanks for helping me figure it out!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-docker/issues/2867#issuecomment-818180020,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACLS7CMQJNXPVQIBEU3L42DTINJ2HANCNFSM42ZNAZ3Q
.
@bwateratmsft Yeah, it's working for me now as well. Thank you so much for fixing it so promptly.
Most helpful comment
🤦♂️ I realized what's wrong. That
<is exactly the problem, it doesn't actually mean what you'd expect. SemVer should be using.lt(), instead. I'm guessing it's doing string comparison; considering strings, '1.23.9' is equal to '1.23.9'--so it passed our initial testing--but '1.23.11' is less than '1.23.9' (alphabetically, i.e. how strings get compared).