Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<!--
=====================================================================================
F# Debug VSIX Compiler Override Props File
=====================================================================================

PURPOSE:
This props file overrides FSharpCompilerPath to point to the VSIX Tools directory,
enabling use of locally-built F# compilers from the Debug VSIX.

IMPORTANT - MANUAL IMPORT REQUIRED:
This file is NOT automatically imported by MSBuild. The Microsoft.VisualStudio.MsBuildProps
asset type only deploys the file to the VSIX package - it does NOT auto-import.

To use this override, you must MANUALLY import this file in your project or
Directory.Build.props:

<Import Project="[VSIX_INSTALL_PATH]\Microsoft.FSharp.VSIX.Debug.Overrides.props"
Condition="Exists('[VSIX_INSTALL_PATH]\Microsoft.FSharp.VSIX.Debug.Overrides.props')" />

Typical VSIX install path (replace <version> and <random>):
%LOCALAPPDATA%\Microsoft\VisualStudio\<version>\Extensions\<random>\Microsoft.FSharp.VSIX.Debug.Overrides.props

VERIFICATION STEPS:
1. Build VisualFSharpDebug project in Debug configuration
2. Check artifacts\bin\VisualFSharpDebug\Debug\ for this file
3. After F5/install, find VSIX at:
%LOCALAPPDATA%\Microsoft\VisualStudio\<version>\Extensions\
4. Search for "Microsoft.FSharp.VSIX.Debug.Overrides.props" in that directory
5. Manually import in your test project's Directory.Build.props
6. Build your F# project - look for warning: "[F# Debug VSIX] Using custom F# compiler from: ..."

TROUBLESHOOTING:
- If no warning appears: props file is not imported (see above)
- If warning shows wrong path: check the VSIX install location
- To verify compiler is used: add /v:d to MSBuild and search for FSharpCompilerPath
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<!-- Calculate path from this file's location to Tools directory -->
<_FSharpDebugVsixPropsDir>$(MSBuildThisFileDirectory)</_FSharpDebugVsixPropsDir>
<_FSharpDebugVsixToolsPath>$(_FSharpDebugVsixPropsDir)Tools\</_FSharpDebugVsixToolsPath>

<!-- Override FSharpCompilerPath only if:
1. Not already set by user/project
2. The compiler actually exists in the Tools directory -->
<FSharpCompilerPath Condition="'$(FSharpCompilerPath)' == '' and Exists('$(_FSharpDebugVsixToolsPath)fscAnyCpu.exe')">$(_FSharpDebugVsixToolsPath)</FSharpCompilerPath>
</PropertyGroup>

<!-- Show a warning during build to indicate custom compiler is in use -->
<Target Name="WarnAboutDebugVsixCompiler" BeforeTargets="BeforeBuild" Condition="'$(FSharpCompilerPath)' == '$(_FSharpDebugVsixToolsPath)'">
<Warning Text="[F# Debug VSIX] Using custom F# compiler from: $(FSharpCompilerPath)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" Path="ItemTemplates" d:TargetPath="|TextFile;TemplateProjectOutputGroup|" d:ProjectName="TextFile" d:VsixSubPath="ItemTemplates" />
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" Path="ItemTemplates" d:TargetPath="|XMLFile;TemplateProjectOutputGroup|" d:ProjectName="XMLFile" d:VsixSubPath="ItemTemplates" />

<Asset Type="Microsoft.VisualStudio.MsBuildProps"
d:Source="File"
Path="Microsoft.FSharp.VSIX.Debug.Overrides.props" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[|%CurrentProject%;GetVSGeneralVersion|,)" DisplayName="Visual Studio core editor" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,13 @@
</Content>
</ItemGroup>
</Target>

<ItemGroup>
<!-- Deploy the override props file as an MSBuild asset -->
<Content Include="Microsoft.FSharp.VSIX.Debug.Overrides.props">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
<VSixSubPath>.</VSixSubPath>
</Content>
</ItemGroup>
</Project>
Loading