May 102017
Howdy up and hope you are all enjoying MS BUILD 2017!!
Thought I would put out a quick share for a fix to a problem that was obvious yet solution wasn’t so much.
I was adding the latest templates for mvc and angular to my Mac (yes VS2017 working natively on the Mac without needing Parallels or VM!!!) and keep getting errors about too many files, etc. – see below Error:
Davids-MacBook-Pro:~ dgrigsby$ dotnet --version 1.0.1 Davids-MacBook-Pro:~ dgrigsby$ sudo dotnet new --install Microsoft.AspNetCore.SpaTemplates::* Password: Restoring packages for /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj... Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.reflection.extensions/index.json'. An error occurred while sending the request. Couldn't connect to server Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.reflection.extensions/index.json'. An error occurred while sending the request. Couldn't connect to server Failed to download package 'System.IO.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.io/4.1.0/system.io.4.1.0.nupkg'. An error occurred while sending the request. Couldn't connect to server Failed to download package 'System.IO.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.io/4.1.0/system.io.4.1.0.nupkg'. An error occurred while sending the request. Couldn't connect to server /usr/local/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : Failed to download package 'System.IO.4.1.0' from 'https://api.nuget.org/v3-flatcontainer/system.io/4.1.0/system.io.4.1.0.nupkg'. [/Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj] /usr/local/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : An error occurred while sending the request. [/Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj] /usr/local/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : Couldn't connect to server [/Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj] /usr/local/share/dotnet/sdk/1.0.1/NuGet.targets(97,5): error : Unable to load package 'System.IO'. [/Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj] Failed to download package 'System.Threading.Tasks.Dataflow.4.6.0' from 'https://api.nuget.org/v3-flatcontainer/system.threading.tasks.dataflow/4.6.0/system.threading.tasks.dataflow.4.6.0.nupkg'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.io.filesystem/index.json'. Too many open files Retrying 'FindPackagesByIdAsync' for source 'https://api.nuget.org/v3-flatcontainer/system.globalization/index.json'. Too many open files Templates Short Name Language Tags ---------------------------------------------------------------------- Console Application console [C#], F# Common/Console Class library classlib [C#], F# Common/Library Unit Test Project mstest [C#], F# Test/MSTest xUnit Test Project xunit [C#], F# Test/xUnit ASP.NET Core Empty web [C#] Web/Empty ASP.NET Core Web App mvc [C#], F# Web/MVC ASP.NET Core Web API webapi [C#] Web/WebAPI Solution File sln Solution Examples: dotnet new mvc --auth None --framework netcoreapp1.1 dotnet new xunit --framework netcoreapp1.1 dotnet new --help Davids-MacBook-Pro:~ dgrigsby$
Well the solution was rather simple once I found the needed setting for the Mac file limit in the issue on github https://github.com/dotnet/cli/issues/6014
- Make sure VS2017 and|or Xamarian Studio are closed via quit
- Make sure you don’t have a Dotnet CLI command window open and running an app
- From terminal run: ulimit -n 512
- From terminal run: sudo dotnet new –install “Microsoft.AspNetCore.SpaTemplates::*”
Notice the quotes, some folks like to run zsh then bash then above, however, I didn’t need too.Wonderful working result below:
Davids-MacBook-Pro:~ dgrigsby$ ulimit -n 512 Davids-MacBook-Pro:~ dgrigsby$ sudo dotnet new --install "Microsoft.AspNetCore.SpaTemplates::*" Restoring packages for /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj... Installing System.Xml.XPath 4.0.1. Installing System.Text.Encoding.CodePages 4.0.1. Installing System.Xml.XPath.XDocument 4.0.1. Installing System.Xml.XmlDocument 4.0.1. Installing System.Diagnostics.FileVersionInfo 4.0.0. Installing System.Diagnostics.StackTrace 4.0.1. Installing Microsoft.CodeAnalysis.Analyzers 1.1.0. Installing runtime.native.System.IO.Compression 4.1.0. Installing Microsoft.NETCore.DotNetHost 1.0.1. Installing Microsoft.NETCore.Targets 1.0.1. Installing Microsoft.NETCore.App 1.0.4. Installing System.Reflection.Emit.Lightweight 4.0.1. Installing Microsoft.AspNetCore.SpaTemplates 0.9.1. Installing Microsoft.CodeAnalysis.Common 1.3.0. Installing System.Security.Cryptography.Cng 4.2.0. Installing Libuv 1.9.1. Installing System.Security.Cryptography.Csp 4.0.0. Installing runtime.native.System.Net.Http 4.0.1. Installing System.Xml.ReaderWriter 4.0.11. Installing Microsoft.NETCore.Platforms 1.0.2. Installing Microsoft.NETCore.Runtime.CoreCLR 1.0.6. Installing System.ComponentModel 4.0.1. Installing System.Threading.Tasks.Extensions 4.0.0. Installing Microsoft.NETCore.DotNetHostPolicy 1.0.3. Installing System.Threading.ThreadPool 4.0.10. Installing System.Resources.Reader 4.0.0. Installing System.Buffers 4.0.0. Installing System.Diagnostics.DiagnosticSource 4.0.0. Installing System.IO.UnmanagedMemoryStream 4.0.1. Installing System.Reflection.DispatchProxy 4.0.1. Installing System.Security.Cryptography.Primitives 4.0.0. Installing System.Net.WebHeaderCollection 4.0.1. Installing System.Reflection.TypeExtensions 4.1.0. Installing System.Collections.Immutable 1.2.0. Installing System.Runtime.Loader 4.0.0. Installing System.Numerics.Vectors 4.1.1. Installing System.IO.FileSystem.Watcher 4.0.0. Installing System.IO.MemoryMappedFiles 4.0.0. Installing System.Threading.Thread 4.0.0. Installing System.Linq.Queryable 4.0.1. Installing Microsoft.CSharp 4.0.1. Installing Microsoft.VisualBasic 10.0.1. Installing System.Security.Cryptography.Algorithms 4.2.0. Installing System.Globalization.Extensions 4.0.1. Installing System.ComponentModel.Annotations 4.1.0. Installing System.IO.Compression 4.1.0. Installing System.Reflection.Metadata 1.3.0. Installing System.Dynamic.Runtime 4.0.11. Installing System.Diagnostics.Process 4.1.0. Installing System.Security.Cryptography.Encoding 4.0.0. Installing System.Threading.Tasks.Parallel 4.0.1. Installing System.Globalization.Calendars 4.0.1. Installing System.Threading.Tasks.Dataflow 4.6.0. Installing System.Net.Security 4.0.0. Installing System.Net.NameResolution 4.0.0. Installing System.Runtime.InteropServices.RuntimeInformation 4.0.0. Installing System.Net.Requests 4.0.11. Installing System.Linq.Parallel 4.0.1. Installing NETStandard.Library 1.6.0. Installing System.IO.Compression.ZipFile 4.0.1. Installing System.Net.Http 4.1.1. Installing System.Security.Cryptography.X509Certificates 4.1.0. Installing Microsoft.CodeAnalysis.CSharp 1.3.0. Installing System.Diagnostics.Tools 4.0.1. Installing Microsoft.CodeAnalysis.VisualBasic 1.3.0. Installing System.Linq.Expressions 4.1.1. Installing System.Net.Sockets 4.1.0. Installing Microsoft.NETCore.Jit 1.0.6. Installing Microsoft.NETCore.Windows.ApiSets 1.0.1. Installing System.Runtime 4.1.0. Installing System.Threading.Timer 4.0.1. Installing System.Collections 4.0.11. Installing System.Console 4.0.0. Installing System.Xml.XDocument 4.0.11. Installing System.Threading.Tasks 4.0.11. Installing Microsoft.NETCore.DotNetHostResolver 1.0.1. Installing System.Runtime.Handles 4.0.1. Installing System.Resources.ResourceManager 4.0.1. Installing System.AppContext 4.1.0. Installing System.Threading 4.0.11. Installing System.IO 4.1.0. Installing System.Text.Encoding 4.0.11. Installing System.Diagnostics.Debug 4.0.11. Installing System.Security.Principal.Windows 4.0.0. Installing System.Net.Primitives 4.0.11. Installing System.Diagnostics.Tracing 4.1.0. Installing System.IO.FileSystem.Primitives 4.0.1. Installing System.Reflection 4.1.0. Installing System.Runtime.InteropServices 4.1.0. Installing System.Linq 4.1.0. Installing System.Reflection.Primitives 4.0.1. Installing System.Security.Principal 4.0.1. Installing System.Reflection.Emit.ILGeneration 4.0.1. Installing System.Reflection.Extensions 4.0.1. Installing System.Reflection.Emit 4.0.1. Installing System.Globalization 4.0.11. Installing System.Security.Cryptography.OpenSsl 4.0.0. Installing System.Runtime.Extensions 4.1.0. Installing System.Security.Claims 4.0.1. Installing Microsoft.Win32.Primitives 4.0.1. Installing System.Threading.Overlapped 4.0.1. Installing runtime.native.System 4.0.0. Installing runtime.native.System.Net.Security 4.0.1. Installing System.IO.FileSystem 4.0.1. Installing System.ObjectModel 4.0.12. Installing System.Collections.Concurrent 4.0.12. Installing runtime.native.System.Security.Cryptography 4.0.0. Installing System.Runtime.Numerics 4.0.1. Installing System.Text.RegularExpressions 4.1.0. Installing System.Text.Encoding.Extensions 4.0.11. Installing Microsoft.Win32.Registry 4.0.0. Generating MSBuild file /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/obj/restore.csproj.nuget.g.props. Generating MSBuild file /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/obj/restore.csproj.nuget.g.targets. Writing lock file to disk. Path: /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/obj/project.assets.json Restore completed in 7.61 sec for /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj. NuGet Config files used: /Users/dgrigsby/.nuget/NuGet/NuGet.Config Feeds used: https://api.nuget.org/v3/index.json Installed: 111 package(s) to /Users/dgrigsby/.templateengine/dotnetcli/v1.0.1/scratch/restore.csproj Templates Short Name Language Tags ------------------------------------------------------------------------------------------ Console Application console [C#], F# Common/Console Class library classlib [C#], F# Common/Library Unit Test Project mstest [C#], F# Test/MSTest xUnit Test Project xunit [C#], F# Test/xUnit ASP.NET Core Empty web [C#] Web/Empty ASP.NET Core Web App mvc [C#], F# Web/MVC MVC ASP.NET Core with Angular angular [C#] Web/MVC/SPA MVC ASP.NET Core with Aurelia aurelia [C#] Web/MVC/SPA MVC ASP.NET Core with Knockout.js knockout [C#] Web/MVC/SPA MVC ASP.NET Core with React.js react [C#] Web/MVC/SPA MVC ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA MVC ASP.NET Core with Vue.js vue [C#] Web/MVC/SPA ASP.NET Core Web API webapi [C#] Web/WebAPI Solution File sln Solution Examples: dotnet new mvc --auth None --framework netcoreapp1.1 dotnet new vue dotnet new --help Davids-MacBook-Pro:~ dgrigsby$