Skip to content

Conversation

@captainsafia
Copy link
Member

Since we include a reference to the Microsoft.AspNetCore.Components.Web.JS.npmproj in the BasicTestApp, attempting to run dotnet watch run there raises the following exception because it cannot resolve the correct targets in all the referenced projects.

watch : MSBuild output from target 'GenerateWatchList':
watch : 
watch :    Build started 2/22/2021 1:33:02 PM.
watch :         1>Project "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj" on node 1 (GenerateWatchList target(s)).
watch :         1>Project "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj" (1) is building "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj" (3) on node 3 (_CollectWatchItems target(s)).
watch :         3>_CheckForInvalidConfiguration:
watch :             node -v
watch :         3>/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj : error MSB4057: The target "_CollectWatchItems" does not exist in the project.
watch :         3>Done Building Project "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj" (_CollectWatchItems target(s)) -- FAILED.
watch :         1>Done Building Project "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj" (GenerateWatchList target(s)) -- FAILED.
watch :    Build FAILED.
watch :           "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj" (GenerateWatchList target) (1) ->
watch :           "/Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj" (_CollectWatchItems target) (3) ->
watch :             /Users/captainsafia/github.com/dotnet/aspnetcore/src/Components/Web.JS/Microsoft.AspNetCore.Components.Web.JS.npmproj : error MSB4057: The target "_CollectWatchItems" does not exist in the project.
watch :        0 Warning(s)
watch :        1 Error(s)
watch :    Time Elapsed 00:00:03.93

We workaround this by adding an empty <Target Name="_CollectWatchItems" /> to the npmproj. Viola! dotnet watch run in the BasicTestApp works.

@captainsafia captainsafia requested a review from a team as a code owner February 22, 2021 21:49
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Feb 22, 2021
@ghost
Copy link

ghost commented Feb 22, 2021

Hello @captainsafia!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 60 minutes, a condition that will be fulfilled in about 48 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 3e43ddb into main Feb 22, 2021
@ghost ghost deleted the safia/fix-npm-proj branch February 22, 2021 23:10
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants