Skip to content

Commit 64be0a5

Browse files
Sergio0694Copilot
andcommitted
Move CsWin32RunAsBuildTask to Directory.Build.targets
Relocate the CsWin32RunAsBuildTask property from Directory.Build.props to Directory.Build.targets (after DisableRuntimeMarshalling), grouping it with the other AOT/marshalling-related build settings. Both CsWin32 consumers (UnitTest and OOPExe) target net10.0, so the targets PropertyGroup's net10.0 gate still applies and the property continues to resolve to true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 296220d commit 64be0a5

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Directory.Build.props

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@
119119
files aren't included. Once that issue is fixed, this should be restricted to published projects only.
120120
-->
121121
<GenerateDocumentationFile Condition="'$(IsPublicProject)' == 'true'">true</GenerateDocumentationFile>
122-
123-
<!--
124-
Run the CsWin32 source generator as an MSBuild build task instead of an in-process Roslyn source
125-
generator. This improves IntelliSense performance and lets CsWin32 generate trim-safe and AOT-safe
126-
interop code. It's a no-op for projects that don't reference CsWin32.
127-
-->
128-
<CsWin32RunAsBuildTask>true</CsWin32RunAsBuildTask>
129122
</PropertyGroup>
130123

131124
<!-- Set overrides to point to folder where they are built in solution -->

src/Directory.Build.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
<!-- Emit the [DisableRuntimeMarshalling] attribute (also enables the associated analyzer) -->
2020
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
2121

22+
<!--
23+
Run the CsWin32 source generator as an MSBuild build task instead of an in-process Roslyn source
24+
generator. This improves IntelliSense performance and lets CsWin32 generate trim-safe and AOT-safe
25+
interop code. It's a no-op for projects that don't reference CsWin32.
26+
-->
27+
<CsWin32RunAsBuildTask>true</CsWin32RunAsBuildTask>
28+
2229
<!--
2330
Emit the '[module: SkipLocalsInit]' attribute, to further reduce runtime overhead. This is especially useful when
2431
using 'stackalloc'. See: https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.skiplocalsinitattribute.

0 commit comments

Comments
 (0)