File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed
Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0
test/TestProjects/KitchenSink Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ Copyright (c) .NET Foundation. All rights reserved.
7878 This property affects C# projects targeting 3.0 or later.
7979 -->
8080 <RazorUpToDateReloadFileTypes >.cs;.razor;.resx;.cshtml</RazorUpToDateReloadFileTypes >
81+
82+ <!--
83+ Target used by dotnet-watch to resolve additional items.
84+ -->
85+ <CustomCollectWatchItems >$(CustomCollectWatchItems);_RazorSdkCustomCollectWatchItems</CustomCollectWatchItems >
8186 </PropertyGroup >
8287
8388 <ItemGroup Condition =" '$(EnableDefaultItems)' == 'true' And '$(EnableDefaultContentItems)' == 'true'" >
Original file line number Diff line number Diff line change @@ -327,12 +327,6 @@ Copyright (c) .NET Foundation. All rights reserved.
327327 -->
328328 <UpToDateCheckBuilt Include =" @(RazorIntermediateAssembly)"
329329 Condition =" '$(RazorCompileOnBuild)'=='true' AND '@(Content->WithMetadataValue('Extension', '.cshtml'))' != ''" Set =" RazorViews" />
330-
331- <!-- Set up watchers for dotnet-watch -->
332- <Watch Include =" @(Content->WithMetadataValue('Extension', '.razor'))" />
333-
334- <Watch Include =" @(Content->WithMetadataValue('Extension', '.cshtml'))"
335- Condition =" '$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false'" />
336330 </ItemGroup >
337331
338332 <!--
@@ -870,6 +864,15 @@ Copyright (c) .NET Foundation. All rights reserved.
870864 </PropertyGroup >
871865 </Target >
872866
867+ <Target Name =" _RazorSdkCustomCollectWatchItems" >
868+ <ItemGroup >
869+ <Watch Include =" %(Content.FullPath)" Condition =" '%(Content.Extension)' == '.razor' AND '%(Content.Watch)' != 'false'" />
870+ <Watch Include =" %(Content.FullPath)" Condition =" '%(Content.Extension)' == '.razor.css' AND '%(Content.Watch)' != 'false'" />
871+ <Watch Include =" %(Content.FullPath)"
872+ Condition =" '$(_Targeting30OrNewerRazorLangVersion)' == 'true' AND '$(AddCshtmlFilesToDotNetWatchList)' != 'false' AND '%(Content.Extension)' == '.cshtml' AND '%(Content.Watch)' != 'false'" />
873+ </ItemGroup >
874+ </Target >
875+
873876 <PropertyGroup Condition =" '$(RazorDesignTimeTargets)'==''" >
874877 <RazorDesignTimeTargets >$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Razor\Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets >
875878 <RazorDesignTimeTargets Condition =" !Exists('$(RazorDesignTimeTargets)')" >$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.Razor.DesignTime.targets</RazorDesignTimeTargets >
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ Returns: @(Watch)
4141 </_CollectWatchItemsDependsOn >
4242 <_CollectWatchItemsDependsOn Condition =" '$(TargetFramework)' != '' " >
4343 _CoreCollectWatchItems;
44+ $(CustomCollectWatchItems);
4445 </_CollectWatchItemsDependsOn >
4546 </PropertyGroup >
4647
Original file line number Diff line number Diff line change 1+ .net
You can’t perform that action at this time.
0 commit comments