Skip to content
Open
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
Expand Up @@ -65,8 +65,12 @@
<!-- The bin/ folder for each target framework. This contains the final build artifacts. -->
<OutputPath>$(Artifacts)/bin/$(Configuration)/$(AssemblyName)</OutputPath>

<!-- We put our docs in the bin/ directory as well. -->
<DocumentationFile>$(Artifacts)/doc/$(TargetFramework)/$(AssemblyName).xml</DocumentationFile>
<!--
Generate XML documentation from /// comments. The compiler places the
XML file alongside the assembly in $(OutputPath). SDK Pack then includes
this file automatically in the NuGet package under lib/<tfm>/.
-->
<GenerateDocumentationFile>true</GenerateDocumentationFile>

</PropertyGroup>

Expand All @@ -85,7 +89,10 @@
<Title>Microsoft.Data.SqlClient.Extensions.Logging</Title>
<Authors>Microsoft</Authors>
<Company>Microsoft Corporation</Company>
<Description>Microsoft.Data.SqlClient Extensions Logging - ETW EventSource for SqlClient tracing and diagnostics.</Description>
<Description>
Microsoft.Data.SqlClient Extensions Logging - ETW EventSource for SqlClient tracing
and diagnostics.
</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>sqlclient microsoft.data.sqlclient extensions logging</PackageTags>
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -115,4 +122,34 @@
</PropertyGroup>
<Import Project="$(ToolsDir)/targets/GenerateThisAssemblyCs.targets" />

</Project>
<!--
Documentation post-processing targets.

After building, we save the full (untrimmed) XML documentation to the
artifacts/doc/ directory for use by public documentation workflows, then
trim the in-place copy (removing <remarks> and <example> nodes) so that
the NuGet package ships a cleaner IntelliSense XML file.
-->
<Target Name="SaveUntrimmedDocs" AfterTargets="Build"
Condition="'$(GenerateDocumentationFile)' == 'true' AND Exists('$(DocumentationFile)')">
<MakeDir Directories="$(Artifacts)/doc/$(TargetFramework)/" />
<Copy SourceFiles="$(DocumentationFile)"
DestinationFolder="$(Artifacts)/doc/$(TargetFramework)/" />
</Target>

<!--
Select the correct PowerShell executable for the current OS so that the
TrimDocsForIntelliSense target below does not need to duplicate the command.
-->
<PropertyGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

We will want somewhere that all projects can share it, like src/Directory.Build.props.

<PowerShellCmd Condition="'$(OS)' == 'Windows_NT'">powershell.exe</PowerShellCmd>
<PowerShellCmd Condition="'$(OS)' != 'Windows_NT'">pwsh</PowerShellCmd>
</PropertyGroup>

<Target Name="TrimDocsForIntelliSense" AfterTargets="SaveUntrimmedDocs"
Condition="'$(GenerateDocumentationFile)' == 'true' AND Exists('$(DocumentationFile)')">
<Exec
Command="$(PowerShellCmd) -NonInteractive -ExecutionPolicy Unrestricted -Command &quot;$(ToolsDir)intellisense\TrimDocs.ps1 -inputFile '$(DocumentationFile)' -outputFile '$(DocumentationFile)'&quot;" />
Comment on lines +151 to +152
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The Exec command invokes TrimDocs.ps1 using an unquoted script path ($(ToolsDir)intellisense\TrimDocs.ps1) inside -Command. If the repo path (and therefore $(ToolsDir)) contains spaces, PowerShell will split the path and fail to locate/execute the script. Quote the script path (and ideally use the call operator & or -File) so the target is robust for local builds in paths with spaces.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems legit.

</Target>

</Project>
Loading
Loading