Problem using vs code

Hello there
I have an annoying problem with the swift extension in vs code

when I open a swift project it errors at package resolve even with a Hello World project

here is the error I get * Executing task: C:\Library\Developer\Toolchains\unknown-Asserts-development. - Pastebin.com

I know that the Swift toolchain I have installed works fine because when I run the project using cmd it works perfectly but when I tried to run it using PowerShell I got the same issue

I tried to change the default terminal in vs code and I even removed all the other ones besides cmd but I still get the same error

Do you have any idea how to fix it?

What project are you trying to open? What does the Package.swift file look like?

I'm also using VS Code on Windows, with PowerShell.

it is a hello world the one that swift package init --type executable creates proj - Pastebin.com

hm, space in name?

I don`t think so I had another one called tt (creative I know) and it had the same problem

:frowning: too bad

I cannot reproduce this with Swift 5.9. What I did:

  • Create a directory with a space in the name
  • Executable swift package init --type executable in that directory
  • The resulting Package.swift has a space in its package name, as well as in the name of the executable target.

However, the package builds and runs just fine, both in PowerShell, as in VS Code, where I ran swift run in the integrated terminal that is set to PowerShell as well.

Are you using an older version of Swift, or the extension? Or perhaps something is wrong with your installation? I use these instructors for my students:

1 Like