Skip to content

fix(vsix-tests): avoid CS5001 in TF_BUILD inert mode - #600

Merged
Phil Nachreiner (philnach) merged 1 commit into
mainfrom
fix/vsix-tfbuild-cs5001
Jun 17, 2026
Merged

Phil Nachreiner (philnach) merged 1 commit into
mainfrom
fix/vsix-tfbuild-cs5001

Conversation

@philnach

Copy link
Copy Markdown
Member

Summary

Fixes CI failures where VSIX test projects were built in inert TF_BUILD mode but still emitted Exe, causing CS5001 (missing Main).

Follow-up

Root Cause

Both VSIX test projects intentionally switch to an inert configuration under TF_BUILD == true:

  • retarget to net10.0
  • disable default compile items

In that inert mode, OutputType was still Exe, so C# expected an entry point and failed with:

  • CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point

Changes

Updated OutputType to be conditional in the two affected projects:

  • Exe when TF_BUILD != true (normal/local behavior unchanged)
  • Library when TF_BUILD == true (inert CI mode)

Files changed

  • src/vs-reactor/Tests/Reactor.VsExtension.Tests/Reactor.VsExtension.Tests.csproj
  • src/vs-reactor/Tests/Reactor.VsExtension.SdkTests/Reactor.VsExtension.SdkTests.csproj

Validation

Built both projects with TF_BUILD=true locally:

  • dotnet build src/vs-reactor/Tests/Reactor.VsExtension.Tests/Reactor.VsExtension.Tests.csproj -c Release -p:TF_BUILD=true
  • dotnet build src/vs-reactor/Tests/Reactor.VsExtension.SdkTests/Reactor.VsExtension.SdkTests.csproj -c Release -p:TF_BUILD=true

Both now succeed and no longer hit CS5001.

Risk / Impact

Low risk:

  • No product/runtime code changes.
  • No behavioral change for normal test runs (TF_BUILD != true still uses Exe).
  • Only affects inert CI path that previously failed due to entry-point expectations.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes CI/ADO inert TF_BUILD=true builds for the VSIX test projects by preventing C# from expecting an executable entry point when the projects intentionally disable compile items (which previously triggered CS5001).

Changes:

  • Made OutputType conditional in Reactor.VsExtension.Tests.csproj (Exe normally, Library under TF_BUILD=true).
  • Made OutputType conditional in Reactor.VsExtension.SdkTests.csproj (Exe normally, Library under TF_BUILD=true).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs-reactor/Tests/Reactor.VsExtension.Tests/Reactor.VsExtension.Tests.csproj Switches to OutputType=Library in inert TF_BUILD mode to avoid CS5001 while keeping normal behavior unchanged.
src/vs-reactor/Tests/Reactor.VsExtension.SdkTests/Reactor.VsExtension.SdkTests.csproj Same conditional OutputType change to make inert TF_BUILD builds succeed without requiring Main.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@philnach
Phil Nachreiner (philnach) merged commit 313ba4b into main Jun 17, 2026
22 checks passed
@philnach
Phil Nachreiner (philnach) deleted the fix/vsix-tfbuild-cs5001 branch June 18, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants