# VS Code won't run Swift on Windows

**URL:** <https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721>\
**Category:** Windows\
**Created:** [June 24, 2024, 9:16pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721 "2024-06-24T21:16:05Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 15, 2024, 5:27pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/21 "2024-07-15T17:27:11Z")

</div>

It happens when I right click in the VSCode gutter and choose to debug the tests. It offers to open the launch.json file. I don't fully understand what should go in those so it's just whatever it put in there by default.

The launch.json file has:

```swift
{
    "version": "0.2.0",
    "configurations": [
     {
      "type": "lldb",
      "request": "launch",
      "name: "Debug",
      "program": "${workspaceFolder}/<executable file>",
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]   
}

```

(typed in by hand on my Mac by looking at file on Windows computer)

If I choose to to debug from the VSCode Run menu, then it says no executable in the root path of my project directory.

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 15, 2024, 6:43pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/22 "2024-07-15T18:43:54Z")

</div>

@dave256 can you go to the VSCode output pane and in the dropdown there should be a Swift entry. Select it. And then cut and paste the contents of the output here.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 15, 2024, 7:10pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/23 "2024-07-15T19:10:51Z")

</div>

@adam-fowler  
Here's the output when I right-click on the test in the gutter and choose debug:

```swift
14:54:35: Exec Task: swift build --build-tests -Xlinker -debug:dwarf -Xswiftc -diagnostic-style=llvm
14:54:52: Error: "Debugger not started"

```

Using the Run menu and selecting "Start Debugging" doesn't seem to put anything there - just the dialog about showing launch.json.

As far as Swift 6 vs. Swift 5 I don't have a strong preference for what we'll be using it for this fall, but since I couldn't get Swift 5 to work and Swift 6 has something built-in for using in VSCode, I tried it. I have gotten farther with Swift 6 than 5, but maybe if I go back to Swift 5 with what I know now, I might get this far. If things go well this fall, I may use it a bit in our operating systems/parallel computing course in January so having the full Swift concurrency features might be useful then but of course by then Swift 6 will be out. The backstory is we did a little bit in our computer graphics course this past January-May semester on their iPads using the Swift Playgrounds app and the students wanted to do more with Swift. We mainly use Python and C++ in our curriculum with a little Java and I teach an elective iOS development app. Not surprisingly the students liked Swift over C++ and I do want to teach them about modern concurrency techniques (async/await, etc.) in the parallel computing course. This fall is a software design course so I was going to have them write some model code in Swift packages with me writing the SwiftUI code that will use it. So I'd like them to be able to write a package and tests and then we can move the model code to their iPads to run in Swift Playgrounds with the SwiftUI code I'll write that uses the model. I don't see any way to run tests in the iPad Swift playgrounds app (other than manually writing your own main function to just execute code and print out messages if there are errors) plus there's no debugger in Swift Playgrounds.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 15, 2024, 7:14pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/24 "2024-07-15T19:14:10Z")

</div>

@compnerd and yes the XCTest.dll files do exist in the directory structure but the error message definitely says .exe. See full reply above.

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 16, 2024, 8:05am UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/25 "2024-07-16T08:05:19Z")

</div>

If you run the command `Swift: Capture VS Code Swift Diagnostic Bundle` and create an issue in the vscode-swift repository with the files the command created we can have a closer look there.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 16, 2024, 2:12pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/26 "2024-07-16T14:12:29Z")

</div>

@adam-fowler I'm happy to create an issue there but I'm not certain I know what you're asking me to do. In the Swift extension settings, I checked "Output additional diagnostics to the Swift Output View".

When I right click in the gutter of a test and choose debug, this is what shows up in the output view:

```swift
09:51:56: SourceKit-LSP setup
09:51:57: Failed to find "C:\Users\roger\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\lldb-dap.exe"
09:52:18: NewPlayingCards: add: c:\Users\roger\Desktop\NewPlayingCards
09:52:18: NewPlayingCards: Resolving Dependencies: starting ... 
09:52:18: Exec Task: (NewPlayingCards) swift package resolve
09:52:18: NewPlayingCards: focus: c:\Users\roger\Desktop\NewPlayingCards
09:52:23: NewPlayingCards: Resolving Dependencies: ... done.
10:06:39: Exec Task: swift build --build-tests -Xlinker -debug:dwarf -Xswiftc -diagnostic-style=llvm
10:06:44: NewPlayingCards: XCTest Debug Config: {"type":"lldb","request":"launch","sourceLanguages":["swift"],"name":"XCTest: Test NewPlayingCards","cwd":"c:\\Users\\roger\\Desktop\\NewPlayingCards","args":["-XCTest","NewPlayingCardsTests.RankXCTests","c:\\Users\\roger\\Desktop\\NewPlayingCards\\.build\\debug\\NewPlayingCardsPackageTests.xctest"],"preLaunchTask":null,"terminal":"console","program":"C:\\Users\\roger\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\bin64\\xctest","env":{"SWIFT_TESTING_ENABLED":"0"},"testType":"XCTest"}
10:06:47: Error: "Debugger not started"

```

If I use the Run -\> Start Debugging menu, this is what shows up:

```swift
09:51:56: SourceKit-LSP setup
09:51:57: Failed to find "C:\Users\roger\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\lldb-dap.exe"
09:52:18: NewPlayingCards: add: c:\Users\roger\Desktop\NewPlayingCards
09:52:18: NewPlayingCards: Resolving Dependencies: starting ... 
09:52:18: Exec Task: (NewPlayingCards) swift package resolve
09:52:18: NewPlayingCards: focus: c:\Users\roger\Desktop\NewPlayingCards
09:52:23: NewPlayingCards: Resolving Dependencies: ... done.

```

That is the path to the lldb-dap.exe file - it's there (546KB). If this is what you want, I'll open an issue here: [GitHub - swiftlang/vscode-swift: Visual Studio Code Extension for Swift](https://github.com/swiftlang/vscode-swift)  
with this information.

If it's not can you either tell me explicitly what you want me to do or point me to online documentation explaining what you want me to do.

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![xwu](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@xwu](https://forums.swift.org/u/xwu)\
**Post date:** [July 16, 2024, 5:39pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/27 "2024-07-16T17:39:42Z")

</div>

In Visual Studio Code, select View \> Command Palette (or press the corresponding keyboard shortcut to achieve the same result).

In the box (palette) that pops up, start typing in `Swift: Capture VS Code Swift Diagnostic Bundle`, select that option when it appears (assuming the plugin is installed of course), and the program will save a bunch of files and notify you about it.

---

<div class="post-metadata">

**Author:** ![compnerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/compnerd/32/2165_2.png) [@compnerd](https://forums.swift.org/u/compnerd)\
**Post date:** [July 16, 2024, 5:59pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/28 "2024-07-16T17:59:46Z")

</div>

Hmm, something is wrong .. if you look at:

```swift
10:06:44: NewPlayingCards: XCTest Debug Config: {"type":"lldb","request":"launch","sourceLanguages":["swift"],"name":"XCTest: Test NewPlayingCards","cwd":"c:\\Users\\roger\\Desktop\\NewPlayingCards","args":["-XCTest","NewPlayingCardsTests.RankXCTests","c:\\Users\\roger\\Desktop\\NewPlayingCards\\.build\\debug\\NewPlayingCardsPackageTests.xctest"],"preLaunchTask":null,"terminal":"console","program":"C:\\Users\\roger\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\bin64\\xctest","env":{"SWIFT_TESTING_ENABLED":"0"},"testType":"XCTest"}

```

The args contains `-XCTest ...` which implies that it is misconfigured. I suspect that you may have checked in a launch configuration file which you should remove and never commit and require that the user re-create it each time. This is configured for a macOS debug environment rather than Windows and they are incompatible due to the ObjC XCTest vs Swift XCTest implementations being different.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 16, 2024, 7:41pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/29 "2024-07-16T19:41:10Z")

</div>

I don't think I did anything to specify -XCTest. I just did all of the following on the Windows 11 computer (no Mac involved).

Opened its shell/terminal app and in a directory ran:

```swift
cd Desktop
mkdir Version3
swift package init

```

This created a directory with the files I expected:  
Package.swift  
Sources/Version3/Version3.swift  
Tests/Version3Tests/Version3Tests.swift  
.gitignore

I then opened that Version3 directory with VSCode.

There is no launch.json file but the Version3Tests.swift contains an XCTestCase subclass.

I put a simple `func sqr(_ x: Double) -> Double { x * x }`  
in the Version3.swift file  
and in the test file, put this inside a test function:  
`XCTestAssertEqual(sqr(3.0), 9.0)`

As I've said before, right-clicking in the test gutter and choosing to run, works (no launch.json file is created).

Right-clicking and choosing to debug complains about the missing xctest.exe file I mentioned earlier. It gives me the option to open a launch.json file which it generates and contains (same as from my earlier message):

```swift
{
    "version": "0.2.0",
    "configurations": [
     {
      "type": "lldb",
      "request": "launch",
      "name: "Debug",
      "program": "${workspaceFolder}/<executable file>",
      "args": [],
      "cwd": "${workspaceFolder}"
    }
  ]   
}

```

Is there something else I should put in this launch.json file or is something else wrong?

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 17, 2024, 10:09am UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/30 "2024-07-17T10:09:37Z")

</div>

-XCTest is a valid argument. It is how tests are filtered when running XCTest executables directly.

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 17, 2024, 10:16am UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/31 "2024-07-17T10:16:55Z")

</div>

For some reason it is not finding the lldb-dap.exe. Are you certain it is available on your file system? And yes can we move this to an issue in the vscode-swift repo with the log details.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 17, 2024, 12:52pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/32 "2024-07-17T12:52:19Z")

</div>

@adam-fowler yes, I'm certain the lldb-ldap.exe exists in the path it shows.

I've created an issue here:

> <https://github.com/swiftlang/vscode-swift/issues/970>
>
> The discussion of this issue started here:
> https://forums.swift.org/t/vs-code-w…ont-run-swift-on-windows/72721/22
> 
> If you create a package on Windows 11 with
> \`\`\`
> swift package init
> \`\`\`
> 
> and then use VSCode to open the directory containing the package, you can run the package, but you can't debug the package.
> 
> I've tried this with the Swift 6 Toolchain (from the July 2nd build available on swift.org) but I also believe it doesn't work with Swift 5.10 release on swift.org. 
> 
> If I right click in the gutter and choose to Debug the test, a Windows dialog pops up complaining "unable to find executable in the Swift\\Platforms\\...\\xctest.exe"
> 
> I turned on the Swift extension setting to "Output additional diagnostics to the Swift Output View" and this is what appears there when I right click in the gutter for the XCTestCase subclass and choose to debug.
> 
> \`\`\`
> 09:51:56: SourceKit-LSP setup
> 09:51:57: Failed to find "C:\\Users\\roger\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\lldb-dap.exe"
> 09:52:18: NewPlayingCards: add: c:\\Users\\roger\\Desktop\\NewPlayingCards
> 09:52:18: NewPlayingCards: Resolving Dependencies: starting ... 
> 09:52:18: Exec Task: (NewPlayingCards) swift package resolve
> 09:52:18: NewPlayingCards: focus: c:\\Users\\roger\\Desktop\\NewPlayingCards
> 09:52:23: NewPlayingCards: Resolving Dependencies: ... done.
> 10:06:39: Exec Task: swift build --build-tests -Xlinker -debug:dwarf -Xswiftc -diagnostic-style=llvm
> 10:06:44: NewPlayingCards: XCTest Debug Config: {"type":"lldb","request":"launch","sourceLanguages":\["swift"\],"name":"XCTest: Test NewPlayingCards","cwd":"c:\\\\Users\\\\roger\\\\Desktop\\\\NewPlayingCards","args":\["-XCTest","NewPlayingCardsTests.RankXCTests","c:\\\\Users\\\\roger\\\\Desktop\\\\NewPlayingCards\\\\.build\\\\debug\\\\NewPlayingCardsPackageTests.xctest"\],"preLaunchTask":null,"terminal":"console","program":"C:\\\\Users\\\\roger\\\\AppData\\\\Local\\\\Programs\\\\Swift\\\\Platforms\\\\6.0.0\\\\Windows.platform\\\\Developer\\\\Library\\\\XCTest-development\\\\usr\\\\bin64\\\\xctest","env":{"SWIFT\_TESTING\_ENABLED":"0"},"testType":"XCTest"}
> 10:06:47: Error: "Debugger not started"
> \`\`\`
> 
> Note the file
> 
> C:\\Users\\roger\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\lldb-dap.exe
> 
> does actually exist despite the error saying it failed to find it.
> 
> Choosing the Run menu's Start Debugging has me then choose lldb and then it complains and creates a launch.json file.
> 
> \`\`\`
> {
> "version": "0.2.0",
> "configurations": \[
> {
> "type": "lldb",
> "request": "launch",
> "name: "Debug",
> "program": "${workspaceFolder}/\<executable file\>",
> "args": \[\],
> "cwd": "${workspaceFolder}"
> }
> \]   
> }
> \`\`\`
> 
> Choosing run again doesn't work, but I assume something must be put in place of \`\<executable file\>\` for the \`program\` setting but I'm not certain what to put there.
> 
> If I make a package with
> \`\`\`
> swift package init --type executable
> \`\`\`
> 
> and then choose the menu Run -\> Start Debugging, I can debug that and it stops at breakpoints showing the values of variables, etc.
> 
> \*\*Expected behavior\*\*
> It should debug a package that is a standard library package.
> 
> \*\*Environment\*\*
> - OS: Windows 11
> - Swift version (output of \`swift --version\`): 6.0-dev (but I believe I had the same issue with 5.10)
> - Visual Studio Code version: May 2024 1.90.2
> - vscode-swift version: 1.10.4

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![compnerd](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/compnerd/32/2165_2.png) [@compnerd](https://forums.swift.org/u/compnerd)\
**Post date:** [July 17, 2024, 3:00pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/33 "2024-07-17T15:00:41Z")

</div>

Correct, but the `-XCTest` argument is for filtering tests with the XCTest runner which is part of the macOS implementation and not the generated test executor with swift-corelibs-xctest.

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 17, 2024, 4:20pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/34 "2024-07-17T16:20:18Z")

</div>

Yep you're right I can't remember all the different setups anymore

---

<div class="post-metadata">

**Author:** ![plemarquand](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/plemarquand/32/32097_2.png) [@plemarquand](https://forums.swift.org/u/plemarquand)\
**Post date:** [July 18, 2024, 4:24pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/35 "2024-07-18T16:24:53Z")

</div>

I just put up a PR to address the debugger not launching correctly on Windows: [Use correct xctest path when debugging on Windows by plemarquand · Pull Request #972 · swiftlang/vscode-swift · GitHub](https://github.com/swiftlang/vscode-swift/pull/972)

Another thing to check, once that PR goes in, is to make sure LLDB is configured correctly by running `lldb` from the command line.

I had to fixup Python in my PATH and the CodeLLDB extension doesn't seem to report an error if it can't start lldb, so it was hanging at initialization.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 18, 2024, 4:53pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/36 "2024-07-18T16:53:24Z")

</div>

@plemarquand thanks for getting to this so quickly. I'd be happy to try this now but I'm not certain what the steps are to install the extension from GitHub before a new release with this commit is made. If that's simple for someone to explain, I'll do try it or if there will be a new release in a day or two, I can obviously wait.

Also, this is what lldb showed for me when I just typed lldb and pressed return in the PowerShell:

```swift
==== LLDB swift-healthcheck log. ===
This file contains the configuration of LLDB's embedded Swift compiler to help diagnosing module import and search path issues. The swift-healthcheck command is meant to be run *after* an error has occurred.
lldb version 17.0.6
Swift version 6.0-dev (LLVM 3602748d4ec9947, Swift 09b8b0861a69528)
(lldb)

```

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![plemarquand](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/plemarquand/32/32097_2.png) [@plemarquand](https://forums.swift.org/u/plemarquand)\
**Post date:** [July 18, 2024, 6:07pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/37 "2024-07-18T18:07:22Z")

</div>

@dave256 We're aiming for a release tomorrow, but if you'd like to try it out beforehand you can check out the latest vscode-swift `main` branch and follow the steps on [Installing a pre released version](https://github.com/swiftlang/vscode-swift/blob/fb7d7411e1c90ceafa59133531777528dfad1363/CONTRIBUTING.md#installing-a-pre-released-version)

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 18, 2024, 6:26pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/38 "2024-07-18T18:26:41Z")

</div>

@plemarquand ah, I should have found that. This borrowed Windows laptop is underpowered (limited disk space and 4GB of RAM) so I'll wait until tomorrow. I've set a reminder to try it and will report back if it does indeed now work for me. Thanks again.

---

<div class="post-metadata">

**Author:** ![dave256](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dave256/32/37106_2.png) [@dave256](https://forums.swift.org/u/dave256)\
**Post date:** [July 19, 2024, 12:43pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/39 "2024-07-19T12:43:31Z")

</div>

@plemarquand @adam-fowler

I installed the new VSCode Swift extension and restarted it. I think we're making progress but it's still not working. When I right click in the gutter for an XCTestCase class and chose to debug it, a Windows dialog opens that says unknown error and offers to open launch.json (which didn't previously exist but it will create one if I say to open it).

This shows up in the Debug Console:

```swift
Console is in 'commands' mode, prefix expressions with '?'.
Launching: c:\Users\roger\Desktop\Version3\.build\debug\Version3PackageTests.xctest Version3Tests.Version3Tests

```

If I go to the Output Console and choose Swift in the right filter, this is what appears:

```swift
08:31:10: Exec Task: swift build --build-tests -Xlinker -debug:dwarf -Xswiftc -diagnostic-style=llvm
08:31:13: Version3: XCTest Debug Config: {"type":"lldb","request":"launch","sourceLanguages":["swift"],"name":"XCTest: Test Version3","cwd":"c:\\Users\\roger\\Desktop\\Version3","args":["Version3Tests.Version3Tests"],"preLaunchTask":null,"terminal":"console","program":"c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest","env":{},"testType":"XCTest"}
08:31:17: Error: "Debugger not started"

```

If I change the filter for the Output console to LLDB, this is what appears:

```swift
Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  sourceLanguages: ['swift'],
  name: 'XCTest: Test Version3',
  cwd: 'c:\\Users\\roger\\Desktop\\Version3',
  args: ['Version3Tests.Version3Tests'],
  preLaunchTask: null,
  terminal: 'console',
  program: 'c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest',
  env: {},
  testType: 'XCTest'
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  sourceLanguages: ['swift'],
  name: 'XCTest: Test Version3',
  cwd: 'c:\\Users\\roger\\Desktop\\Version3',
  args: ['Version3Tests.Version3Tests'],
  preLaunchTask: null,
  terminal: 'console',
  program: 'c:\\Users\\roger\\Desktop\\Version3\\.build\\debug\\Version3PackageTests.xctest',
  env: {},
  testType: 'XCTest',
  expressions: 'native',
  relativePathBase: 'c:\\Users\\roger\\Desktop\\Version3',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
[ERROR codelldb::debug_session] unknown error
[ERROR codelldb::debug_session] Internal debugger error: error: process 0 in state = exited, but cannot detach it in this state.
==== LLDB swift-healthcheck log. ===
This file contains the configuration of LLDB's embedded Swift compiler to help diagnosing module import and search path issues. The swift-healthcheck command is meant to be run *after* an error has occurred.
lldb version 17.0.6
Swift version 6.0-dev (LLVM 3602748d4ec9947, Swift 09b8b0861a69528)
Debug adapter exit code=0 (0x0), signal=null.

```

The Version3Tests.swift file is just:

```swift
import XCTest
@testable import Version3

final class Version3Tests: XCTestCase {
    func testSqr() {
        let x = 3.0
        let y = sqr(x)
        XCTAssertEqual(y, 9.0)
    }
}

```

And the Verstion3.swift file contains:

```swift
func sqr(_ x: Double) -> Double {
    x * x
}

```

All the other files in the directory are just the result of `swift package init` (no other files were modified).

Any other thoughts on what is wrong? Again, I'm happy to run any other diagnostics if you explain what you want me to do.

Thanks,  
Dave

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [July 19, 2024, 12:56pm UTC](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721/40 "2024-07-19T12:56:05Z")

</div>

Hi @dave256

I saw the issue as soon as I did the release. I’m sorry about this. The issue is the xctest.dll isn’t in the path. If you include the path to the xctest.dll in your own path it should work

We will do another release that fixes this soon. Unfortunately not today though.

[Previous page](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721.md?page=1)

[Next page](https://forums.swift.org/t/vs-code-wont-run-swift-on-windows/72721.md?page=3)
