# Error MSB8066 during building?

**URL:** https://discourse.itk.org/t/error-msb8066-during-building/7671
**Category:** Beginner Questions
**Created:** [November 25, 2025, 7:30pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671 "2025-11-25T19:30:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Rock](https://discourse.itk.org/user_avatar/discourse.itk.org/rock/32/4610_2.png) [@Rock](https://discourse.itk.org/u/Rock)
#### Post date: [November 25, 2025, 7:30pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/1 "2025-11-25T19:30:14Z")

</div>

Hello all,

I have been trying to get SimpleITK set up with Elastix, following the instructions on the pages for Building SimpleITK and Building SimpleITK on Windows. I am using Visual Studio 18, Python 3.14, and CMake 4.2.0. I can get through most of the process until it comes to building in Visual Studio, where I get this error:

Configuring incomplete, errors occurred!  
12\>C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for ‘D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-mkdir.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-download.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-update.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-patch.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-configure.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-build.rule;D:\SimpleITK-build\CMakeFiles\1daa201e4876001beb2745ee8c537f6f\SimpleITKExamples-install.rule;D:\SimpleITK-build\CMakeFiles\db78d2f8b7b721676568918a53364fe8\SimpleITKExamples-complete.rule;D:\SimpleITK-build\CMakeFiles\d0ae7294290e14b4b2f8e27aec435f49\SimpleITKExamples.rule;D:\SimpleITK\SuperBuild\CMakeLists.txt’ exited with code 1.  
13\>------ Skipped Build: Project: ALL\_BUILD, Configuration: Debug x64 ------  
13\>Project not selected to build for this solution configuration  
========== Build: 7 succeeded, 5 failed, 0 up-to-date, 1 skipped ==========  
========== Build completed at 8:25 PM and took 26:56.281 minutes ==========

Unfortunately, I have not been able to figure out what is causing this and how to get past it. I would be extremely grateful for any insight or advice!

Thank you!

Rock

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [November 25, 2025, 8:13pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/2 "2025-11-25T20:13:17Z")

</div>

> [@Rock](#):
>
> . I can get through most of the process until it comes to building in Visual Studio, where I get this erro

Hello Rock,

Unfortunately, the initial error is not included in your log here so this is challenging to give a solution.

You say you are using Visual Studio 18 2026. That compiler appears to have been released this month. I have not used it nor do I see it available on the Github hosted runners to easily test. @Niels_Dekker may be able to shed some light on compatibility with ITK 5.4.5 or if there are other know issues with the new compiler.

There are two components CMake uses with Visual studio the [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#manual:cmake-generators(7)), and the [toolset](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html). It needs to be determined if the error is with the VS18 generator, cmake code or a compiler error specific to this new version.

If it’s a compilation error, then an older toolset could be used by setting CMAKE\_GENERATOR\_TOOLSET to something like “v143,host=x64”.

Thank you for using and testing the latest tools with SimpleITK. If you could share a complete build log, or at least a larger one with the primary error it could help with further assistance.

Brad

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [November 27, 2025, 2:34pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/3 "2025-11-27T14:34:46Z")

</div>

ITK `main` builds fine with CMake 4.2.0 and VS2026.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [December 16, 2025, 4:21pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/4 "2025-12-16T16:21:09Z")

</div>

ITK 5.4.5 also builds fine with Visual Studio 2026 (I forgot to write this earlier).

---

<div class="post-metadata">

### Author: ![Rock](https://discourse.itk.org/user_avatar/discourse.itk.org/rock/32/4610_2.png) [@Rock](https://discourse.itk.org/u/Rock)
#### Post date: [December 16, 2025, 4:42pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/5 "2025-12-16T16:42:37Z")

</div>

Hello Brad,

So sorry for my slow reply; I had not seen that people had responded! I really appreciate the help. I have attached the complete build log here:

[SimpleITK build log.txt](https://discourse.itk.org/uploads/short-url/yPiYeTESR3jhjlVI33LoxDOV1sV.txt) (660.2 KB)

I have tried a few more times to build but keep running into the same 7 succeeded, 5 failed message. I followed the instructions for building from [Building SimpleITK — SimpleITK 2.4.0 documentation](https://simpleitk.readthedocs.io/en/master/building.html) and [Building SimpleITK on Windows — SimpleITK 2.4.0 documentation](https://simpleitk.readthedocs.io/en/master/buildingWindows.html) with the only difference being that I added “-DSimpleITK\_USE\_ELASTIX=ON” as a Cmake option.

I do not have much experience with building programs so I am not sure what information would be useful to include but will be happy to send more if you let me know.

Thank you!

Rock

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [December 16, 2025, 6:29pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/6 "2025-12-16T18:29:27Z")

</div>

Hello,

Please try checking out the git tag “v2.5.3” and building the latest stable release.

The build log appears to be building the unstable development branch of SimpleITK. The current development is towards a major version change towards a SimpleITK 3.0 release. Here are some important messages from the build:

```auto
Building SimpleITK version "3.0.0a1.post110-gc7827"

```

```auto
4> Building Custom Rule D:/SimpleITK/SuperBuild/CMakeLists.txt
3> no such file or directory
3>C:\Program Files\Microsoft Visual Studio\18\Community\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'D:\SimpleITK\SuperBuild\ExternalSource\uv_install.sh.sha512;D:\SimpleITK-build\CMakeFiles\2c092dc618b2ece4a25a57ff4bcffb9b\uv.exe.rule;D:\SimpleITK-build\CMakeFiles\7d4556eec2e21401177be744b430b57d\python.exe.rule;D:\SimpleITK-build\CMakeFiles\d0ae7294290e14b4b2f8e27aec435f49\SimpleITK_VENV.rule;D:\SimpleITK\SuperBuild\CMakeLists.txt' exited with code 1.

```

…

```auto
8> -- Found the following C# .NET versions: v4.0.30319
8> CMake Error at CMake/sitkGenerateFilterSource.cmake:23 (message):
8> SimpleITK_Python_EXECUTABLE is set to an invalid executable:
8> D:/SimpleITK-build/venv/Scripts/python.exe

```

I’ll look into them these error on the development (“main”) branch to see if a fix is needed. Please try building the stable release tag and report back if there are any issues.

---

<div class="post-metadata">

### Author: ![Rock](https://discourse.itk.org/user_avatar/discourse.itk.org/rock/32/4610_2.png) [@Rock](https://discourse.itk.org/u/Rock)
#### Post date: [December 17, 2025, 1:05pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/7 "2025-12-17T13:05:03Z")

</div>

Hello Brad,

Thank you for your advice! I used the source code for version 2.5.3 and this time got 11 successes, 0 failures. In case it would be useful, I have attached the build log for the successful build.

[SimpleITK2.5.3-build log.txt](https://discourse.itk.org/uploads/short-url/65IsQ31YGETqTXTeprqCG3TkFSO.txt) (1.8 MB)

If I can provide any information that would be helpful to look into the errors let me know. Thank you very much again for your help!

Rock

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [December 18, 2025, 6:48pm UTC](https://discourse.itk.org/t/error-msb8066-during-building/7671/8 "2025-12-18T18:48:15Z")

</div>

Hello,

I believe the source of your build error on the `main` branch was that there was no `sh` shell available to run the uv install script. A fix which adds a powershell installer for uv has been added to the development branch: [Add uv installer for powershell by blowekamp · Pull Request #2487 · SimpleITK/SimpleITK · GitHub](https://github.com/SimpleITK/SimpleITK/pull/2487)

Thank you for reporting the build issue. You have helped the community 🙂
