Visual Studio for Mac takes over 10 minutes to load solution

A .net core 2.0 solution with 22 projects takes over 10 minutes to open. Takes a few seconds in windows. Are there any known work-arounds?

Version 7.2 (build 636)


  • DuncanWoodsDuncanWoods GBMember ✭✭

    I think its related to have a node_modules folder within a project folder. The folder is ignored within the solution itself which solves similar performance issues with Visual Studio on windows but it seems VS for Mac is processing it anyway.

  • mattwardmattward GBMember Xamurai

    The node_modules folder should be ignored by a wildcard defined by the .NET Core 2.0 sdk. If you remove/move the node_modules folder so it is outside the solution directory is the solution load still slow?

  • DuncanWoodsDuncanWoods GBMember ✭✭
    edited October 2017

    Deleting node_modules radically improves open time. For another solution I have, the time until the text editor appears and is responsive:

    with node_modules: 5 minutes 30s
    without node_modules: 20s

    7.3 Preview (build 692) (was very slow on 7.2 too)
    MacOs 10.12.6

  • mattwardmattward GBMember Xamurai

    Would you be able to show what your package.json file contains?

  • DuncanWoodsDuncanWoods GBMember ✭✭

    "dependencies": {
    "@types/axios": "^0.14.0",
    "@types/jquery": "^3.2.12",
    "@types/msgpack": "0.0.29",
    "@types/react": "^15.6.1",
    "@types/react-dom": "^15.5.4",
    "autoprefixer": "^6.7.7",
    "awesome-typescript-loader": "^3.2.3",
    "axios": "^0.16.2",
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "browserify": "^13.3.0",
    "cssnano": "^3.10.0",
    "file-saver": "latest",
    "flatbuffers": "^1.7.0",
    "jasmine-core": "^2.7.0",
    "karma": "^1.4.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.1.0",
    "less": "^2.7.2",
    "lodash": "^4.17.4",
    "msgpack-lite": "^0.1.26",
    "pixrem": "^3.0.2",
    "postcss-cli": "^2.6.0",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "source-map-loader": "^0.2.1",
    "ts-loader": "^2.3.3",
    "tsify": "^3.0.0",
    "typescript": "^2.5.3",
    "uglify-js": "^2.7.5",
    "webpack": "3.5.5"

  • mattwardmattward GBMember Xamurai

    Using your dependencies and then doing an npm install I can open an ASP.NET Core project in VS for Mac 7.2 and 7.3 and I do not see any long delay. Also 20 seconds without the node_modules folder seems a long time too. The node_modules should be ignored by VS for Mac but will confirm this. So not sure what the difference is on your machine.

  • DuncanWoodsDuncanWoods GBMember ✭✭
    edited November 2017

    So the cause of difference may be that my solution has multiple projects and the project that contains node_modules is
    Project Sdk="Microsoft.NET.Sdk"
    Project Sdk="Microsoft.NET.Sdk.Web"

    To replicate:
    1. Create new aspnet core solution
    2. Add dotnet core library project
    3. Add package.json and "npm install" in the library project, not the aspnet core project
    4. Solution is brutally slow to load + many other functions like package restore and find in files are affected

    If I change the SDK, solution loading speed improves.

  • mattwardmattward GBMember Xamurai

    Thanks. That makes more sense. When you use Microsoft.NET.Sdk.Web that includes the web specific MSBuild items which will have an exclude for the node_modules directory.



    The above is not defined when Microsoft.NET.Sdk. The node_modules folder would not be ignored in this case. That being said VS for Mac should handle this. Right now it just looks at all the files if they are not excluded. We need to look at not doing this and just look for files as the solution window is expanded.

  • DuncanWoodsDuncanWoods GBMember ✭✭

    Great, thanks good to get it identified.

    That being said VS for Mac should handle this.

    Yep. If I do a "find in files" I get a beachball for 20 minutes and can't cancel the search so have to kill the app.

Sign In or Register to comment.