Skip to content

Commit c97a9a7

Browse files
authored
Setting ReferenceOutputAssembly to falso on references to esproj (#9201)
Setting ReferenceOutputAssembly to falso on references to esproj Esprojs may be referenced by ASP.Net projects (or others). When this happens, the .net project will have to not reference output assembly on the esproj, because there is no output assembly. This targets provides that behavior. There was an argument for putting this in this file instead of in the sdk. The discussion can be found here: dotnet/sdk#34983
1 parent 862ba5e commit c97a9a7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Tasks/Microsoft.Common.CurrentVersion.targets

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,24 @@ Copyright (C) Microsoft Corporation. All rights reserved.
15111511
============================================================
15121512
-->
15131513
<Target Name="AfterResolveReferences"/>
1514+
1515+
<!--
1516+
============================================================
1517+
IgnoreJavaScriptOutputAssembly
1518+
1519+
esproj are JavaScript or TypeScript Projects that never produce an assembly.
1520+
Set ReferenceOutputAssembly to false in any reference to an esproj.
1521+
============================================================
1522+
-->
1523+
<Target Name="IgnoreJavaScriptOutputAssembly"
1524+
BeforeTargets="AssignProjectConfiguration"
1525+
Condition="$([MSBuild]::AreFeaturesEnabled('17.8'))">
1526+
<ItemGroup>
1527+
<ProjectReference Condition="'%(ProjectReference.Extension)' == '.esproj' and '%(ProjectReference.ReferenceOutputAssembly)' == ''">
1528+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
1529+
</ProjectReference>
1530+
</ItemGroup>
1531+
</Target>
15141532

15151533
<!--
15161534
============================================================

0 commit comments

Comments
 (0)