diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets
index e6b23f2802..e90aac13f8 100644
--- a/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets
+++ b/src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets
@@ -50,7 +50,7 @@ Copyright (c) .NET Foundation. All rights reserved.
- ResolveStaticWebAssetsInputs;
+ ResolveCurrentProjectStaticWebAssetsInputs;
$(GetCurrentProjectStaticWebAssetsDependsOn)
@@ -59,11 +59,21 @@ Copyright (c) .NET Foundation. All rights reserved.
$(AssignTargetPathsDependsOn)
-
- _ResolveStaticWebAssetsProjectReferences;
+
+ ResolveCurrentProjectStaticWebAssetsInputs;
$(ResolveStaticWebAssetsInputsDependsOn)
+
+ ResolveReferencedProjectsStaticWebAssets;
+ $(ResolveStaticWebAssetsInputsDependsOn)
+
+
+
+ ResolveReferences;
+ $(ResolveReferencedProjectsStaticWebAssetsDependsOn)
+
+
_CreateStaticWebAssetsCustomPropsCacheFile;
$(GenerateStaticWebAssetsPackTargetsDependsOn)
@@ -209,27 +219,68 @@ Copyright (c) .NET Foundation. All rights reserved.
* Assets from the referenced packages. These will be implicitly included when nuget
restores the package and includes the package props file for the package.
-->
+
+
+
+
+ DependsOnTargets="$(ResolveStaticWebAssetsInputsDependsOn)" />
-
+
-
- _content/$(PackageId)
-
+
+
+ <_StaticWebAssetsProjectReference Include="@(_MSBuildProjectReferenceExistent)" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _content/$(PackageId)
+
+
+
<_ThisProjectStaticWebAsset
- Include="$(MSBuildProjectDirectory)\wwwroot\**"
- Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
-
-
+ Include="@(Content)"
+ Condition="$([System.String]::Copy('%(Identity)').StartsWith('wwwroot'))">
+
+
+ $([System.String]::Copy('%(Identity)').Substring(8))
+
+
+
+
@@ -238,52 +289,19 @@ Copyright (c) .NET Foundation. All rights reserved.
Full path to the content root for the item:
* For packages it corresponds to %userprofile%/.nuget/packages/<>/<>/razorContent
* For referenced projects it corresponds to <>/wwwroot
- * For the current projects it corresponds to $(MSBuildThisProjectFileDirectory)wwwroot\
+ * For the current projects it corresponds to $(MSBuildProjectDirectory)wwwroot\
-->
- $(MSBuildProjectDirectory)\wwwroot\
+ $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)\wwwroot\'))
$(StaticWebAssetBasePath)
- %(RecursiveDir)%(FileName)%(Extension)
+ path to determine the final path for the file.
+ -->
+ %(RelativePath)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_StaticWebAssetsProjectReference Include="%(ReferencePath.MSBuildSourceProjectFile)" />
-
-
-
+
-
+
@@ -498,4 +518,4 @@ Copyright (c) .NET Foundation. All rights reserved.
-
\ No newline at end of file
+