Skip to content

Fix WIX7009 error in Windows Service installer documentation #47592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 25, 2025

The WiX Toolset configuration in the Windows Service installer documentation was causing a WIX7009 error when users tried to build the installer project. The error occurred because WiX Toolset v4 introduced virtual symbols that conflict with the traditional TARGETDIR symbol.

Error details:

WIX7009	The Directory symbol 'TARGETDIR' conflicts with a virtual symbol. Use the 'override' access modifier to override the virtual symbol or use a different Id to avoid the conflict. Referenced from wixstd.wixlib

Solution:
Added the override="true" attribute to the TARGETDIR Directory element in the Package.wxs configuration:

<!-- Before -->
<Directory Id="TARGETDIR" Name="SourceDir">

<!-- After -->
<Directory Id="TARGETDIR" Name="SourceDir" override="true">

This change follows the error message's recommendation and aligns with WiX v4 best practices for handling virtual symbol conflicts. The fix is minimal and surgical, changing only the necessary attribute to resolve the compilation error.

Fixes #42363.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/core/extensions/windows-service-with-installer.md docs/core/extensions/windows-service-with-installer

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] WIX7009 The Directory symbol 'TARGETDIR' conflicts with a virtual symbol. Use the 'override' access modifier to override the virtual symbol or use a different Id to avoid the conflict. Referenced from wixstd.wixlib Fix WIX7009 error in Windows Service installer documentation Jul 26, 2025
Copilot finished work on behalf of gewarren July 26, 2025 00:02
@Copilot Copilot AI requested a review from gewarren July 26, 2025 00:02
@gewarren gewarren marked this pull request as ready for review July 27, 2025 03:12
@gewarren gewarren requested review from IEvangelist and a team as code owners July 27, 2025 03:12
@gewarren
Copy link
Contributor

@IEvangelist The fix that Copilot suggests is different to the fix in the issue that uses a different ID to avoid conflict. Do you have a preference?

Copy link
Contributor Author

Copilot AI commented Jul 27, 2025

@IEvangelist The fix that Copilot suggests is different to the fix in the issue that uses a different ID to avoid conflict. Do you have a preference?

I can implement either approach:

Current fix (commit b3f995e): Adds override="true" to TARGETDIR - follows the error message recommendation exactly.

Issue suggestion: Replace TARGETDIR/Directory structure with <StandardDirectory Id="ProgramFiles64Folder"> - uses WiX v4's modern approach and avoids the virtual symbol entirely.

Both fix the WIX7009 error. The StandardDirectory approach is more modern and future-proof. Which would you prefer @IEvangelist?

@Copilot Copilot AI requested a review from gewarren July 27, 2025 03:18
Copilot finished work on behalf of gewarren July 27, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WIX7009 The Directory symbol 'TARGETDIR' conflicts with a virtual symbol. Use the 'override' access modifier to override the virtual symbol or use a different Id to avoid the conflict. Referenced from wixstd.wixlib
2 participants