-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
long restore time when node_modules in project folder #2453
Comments
I turned out that node_modules is causing this. If I remove the folder, it is a lot faster. Is this a bug? |
This may be an instance of #2392. @r03 you mentioned on SO that you're including a This has caused issues before (https://github.com/dotnet/cli/issues/5656) and has been "fixed" so that excluding |
Can you share your project and where the |
Also, which version of the |
Here is my project file:
I only have a single webapi project with these subfolders:
dotnet version:
|
So the node_modules folder is in This is weird, it should be excluded from the build by the glob pattern defined here: https://github.com/aspnet/websdk/blob/1fd3e2add57478aa29f99cbae06c8bf44c095588/src/ProjectSystem/Microsoft.NET.Sdk.Web.ProjectSystem.Targets/netstandard1.0/Microsoft.NET.Sdk.Web.ProjectSystem.props#L15 |
This is probably the more-specific #2000, where it's excluded but we still walk the whole directory. Can you try adding this to the project? <PropertyGroup>
<DefaultExcludesInProjectFolder>$(DefaultExcludesInProjectFolder);ClientApp\node_modules\**</DefaultExcludesInProjectFolder>
</PropertyGroup> |
I wonder if it is "safe" if NuGet passed sth like |
Without the exclude: (old situation)
After the exclude:
The project file:
After
|
@rainersigwald is the order of the excludes important? since this comes from an SDK props file, the project will only append to the patterns |
If that is true, @r03 you could try this instead: <PropertyGroup>
<DefaultItemExcludes>ClientApp\node_modules\**;$(DefaultItemExcludes)</DefaultItemExcludes>
</PropertyGroup> |
yes, that works.
|
I didn't think order was important there. Boo! Since it worked once it was in a good order, I'm going to close this as a duplicate of #2000. |
I asked the question first on StackOverflow but it was suggested that I should make an issue.
I noticed that building in dotnet core 2 seemed a lot slower.
But the timing after the build always showed 'only' 15 seconds.
I couldn't believe that so I timed it with
time
.That seemed more correct. Almost a minute.
I then tried without restore and it was a lot faster:
But dotnet also shows 15 seconds.
Could it be that only building is counted in the timings?
Not sure why a restore is always slow when everything is already restored.
(I'm using osx, my environment is set to development)
I prefer to use
dotnet watch run
but that seems even slower.Running
dotnet watch
to view the parameters is taking 12 seconds.Is this only on my system?
Here is the result from dotnet restore /clp:PerformanceSummary
The text was updated successfully, but these errors were encountered: