none
Cannot create a new project or close the program

    Question

  • Hello everyone,

    I'm kinda new to programming, started to learn C# recently. I have been using Visual Studio 2015 with no problems. Suddenly, I can't create a new project - it pops up an error message saying "Object reference not set to an instance of an object." Also, when I try to close the program, it says "Value cannot be null. Parameter name: compositionService" I can open any project I created before.

    I have no idea why this happened, I did not change any settings, it just suddenly stops working.

    Any idea what might cause this problem? Is there a way to fix it without reinstalling the entire Visual Studio?

    Thanks for your help!

    Daniel

    Monday, May 9, 2016 8:14 AM

Answers

  • Hi Daniel,

    Thanks for your post.

    Please try the following methods:

    Please try running Visual Studio in Safe mode to Check whether some add-ins and extensions affect it(devenv /safemode).

    In addition, please reset the settings of your Visual Studio 2015(Tools->Import and Export settings->Reset all settings)

    Restore the template of your Visual Studio.

    1. Delete the ItemTemplatesCache, ProjectTemplatesCache folder (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE)

    2. In the command prompt, navigate to the location of devenv.exe. This file is located in <Visual Studio Installation Path>\Common7\IDE.

    3. Type "devenv /installvstemplates" and press Enter.

    If above suggestions still no help. I suggest you could try to repair your VS2015 or install the VS2015 Update2, the latest update of VS2015.

    Best Regards,

    Lake Xiao

    Tuesday, May 10, 2016 6:23 AM
    Moderator

All replies

  • Hi Daniel,

    Thanks for your post.

    Please try the following methods:

    Please try running Visual Studio in Safe mode to Check whether some add-ins and extensions affect it(devenv /safemode).

    In addition, please reset the settings of your Visual Studio 2015(Tools->Import and Export settings->Reset all settings)

    Restore the template of your Visual Studio.

    1. Delete the ItemTemplatesCache, ProjectTemplatesCache folder (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE)

    2. In the command prompt, navigate to the location of devenv.exe. This file is located in <Visual Studio Installation Path>\Common7\IDE.

    3. Type "devenv /installvstemplates" and press Enter.

    If above suggestions still no help. I suggest you could try to repair your VS2015 or install the VS2015 Update2, the latest update of VS2015.

    Best Regards,

    Lake Xiao

    Tuesday, May 10, 2016 6:23 AM
    Moderator
  • I know this is an old, and answered, thread, but I wanted to add my own answer to it.  I ran into that compositionService error whenever I tried to right-click and add a reference, and subfiles were not showing when I clicked on folders in the Solution Explorer. This is how I fixed it:

    1. Start an Administrator Command Prompt.
    2. Run this:  

     del %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
     

    Then re-launch Visual Studio (if you have to close it, you'd do End Task on devenv.exe in the Task Manager from the Ctrl+Alt+Del screen) using the .sln file of your Solution.  For me, it prompted me to recover my .csproj file.  I accepted.  Then my project did not load - in the Solution Explorer it said waiting on user input.  I right-clicked the Solution in the Solution Explorer and said to "Reload Project".  Bam!  Everything came up and was able to add references again.

    The answer at this page helped me:  https://stackoverflow.com/questions/33805390/visual-studio-professional-2015-and-windows-10-all-kinds-of-ide-errors





    • Edited by navyjax2 Friday, November 3, 2017 9:14 PM
    Friday, November 3, 2017 9:04 PM