Visual Studio 2015 error "Object reference not installed in object instance" after installing ASP.NET and web tools 2015 (RC1 Update 1)

After installing ASP.NET and web tools 2015 (RC1 update 1) I get the following error in ASP.NET MVC 4 projects when opening *.cshtml files:

Object reference not set to object instance

Enter image description here

I get the same error message even if I start a new ASP.NET MVC 4 project and try to open the *.cshtml file there.

+117
c # visual-studio visual-studio-2015 razor asp.net-mvc-4
Dec 04 '15 at 8:37
source share
18 answers

Maybe this will help:

  1. Delete the contents from the following folders:
    1. C: \ Users \% USERPROFILE% \ AppData \ Local \ Microsoft \ VisualStudio
    2. C: \ Users \% USERPROFILE% \ AppData \ Local \ Microsoft \ VSCommon
  2. Sometimes you need to go to:
    1. [x64] C: \ Program Files (x86) \ Microsoft Visual Studio 14.0 \ Common7 \ IDE
    2. [x86] C: \ Program Files \ Microsoft Visual Studio 14.0 \ Common7 \ IDE

and run devenv/resetuserdata .

Expect all of your user preferences, such as a Visual Studio layout, linked Microsoft account, or start page, to disappear.

+184
Dec 04 '15 at 9:50
source share

Delete %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache .

Alternatively, use the Clear MEF Component Cache extension.

+61
Jun 07 '16 at 19:44
source share

For me

  • I finished the process in the Windows task manager: VsHub.exe .
  • Reboot Visual Studio.

After that, everything works like a charm again!

+15
Jan 27 '16 at 21:34
source share

I decided to do it

 run devenv /resetuserdata 

in this way:

 [x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE 

I assume that in x86 it works this way:

 [x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE 
+7
Jun 09 '16 at 6:40
source share

It is recommended that you try any or all of the following:

  • Restart Visual Studio

  • Try to run as administrator (right-click Visual Studio and select "Run as administrator")

  • Check for updates for Visual Studio (download and install them, if any)

  • Try to open another solution / project.

If the problems persist, you can try the following options:

  • Restart the local machine

  • Trying to reset Visual Studio to system defaults (this can be done from the options in Visual Studio)

  • Attempting to restore the installation of Visual Studio

+4
Dec 04 '15 at 9:43
source share

ASP.NET 5 is not required for me yet, I uninstalled the update and reinstalled ASP.NET 4.5. This is a bit complicated:

  • Removed from the control panel "Microsoft ASP.NET 5 RC1 Update1". After that, you will no longer open ASP.NET MVC projects.
  • Then I changed the installation of "Microsoft Visual Studio Professional 2015", clicked "Change" and selected "Microsoft Web Developer Tools"

No more update notification in Visual Studio 2015 !!!

+3
Dec 23 '15 at 9:53
source share

In the hope that this could narrow the case / help someone, I took an investigative approach. For me, I first moved the folder to the C: \ Users \ {user} \ AppData \ Local \ Microsoft \ VisualStudio folder in My Documents and allowed Visual Studio to recreate it by restarting it. This fixed the bugs. So I moved everything back one by one and restarted Visual Studio each time until I found the criminals. These folders were in order to go back:

  • 1033 (overwriting the auto-generated copy with the old one)
  • Designer (was in my old copy, not originally re-created when VS was restarted, copied it back)
  • Extensions (overwritten the auto-generated copy with the old one)
  • ImageLibrary (automatically generated copy is overwritten with the old one)
  • Notifications (overwriting an automatically generated copy with the old one)
  • STemplate (was in my old copy, but was not originally created when VS was restarted, copied it back)
  • VTC (was in my old copy, not originally re-created when VS was restarted, copied it back)

These files were good to return to / overwrite automatically generated:

  • ApplicationPrivateSettings (was in my old copy, but was not originally created when VS was restarted)
  • ApplicationPrivateSettings.lock (overwrites the auto-generated copy with the old one)
  • vspdmc.lock (automatically generated copy is overwritten with the old one)

These files were in order to go back. Each of them was in my old copy and was not originally created when VS was restarted:

  • .NETFramework, Version = v4.0, Set = Framework, Hash = C958D412.dat
  • .NETFramework, Version = v4.0, Set = RecentAssemblies, Hash = 0.dat
  • .NETFramework, Version = v4.5, Set = Extensions, Hash = 75EAE334.dat
  • .NETFramework, Version = v4.5, Set = Extensions, Hash = 497525A2.dat
  • .NETFramework, Version = v4.5, Set = Framework, Hash = 5AE9A175.dat
  • .NETFramework, Version = v4.5.2, Set = Extensions, Hash = 24CEEB0D.dat
  • .NETFramework, Version = v4.5.2, Set = Extensions, Hash = 72AE305.dat
  • .NETFramework, Version = v4.5.2, Set = Extensions, Hash = ADF899D7.dat
  • .NETFramework, Version = v4.5.2, Set = Framework, Hash = D8E943A2.dat

This caused problems - delete these files and restart VS so that they can recreate them:

  • ComponentModelCache - when I rewrote the contents of this folder with my old ones (4 files: MS.VS.Default.cache, .catalogs, .err, .external), it gave me all the errors that I received earlier about not being able to download packages at boot time of my project and the error "reference to an object not installed on an instance of the object" when trying to close VS.
  • devenv.exe.config - same as ComponentModelCache
  • .NETFramework, Version = v4.0, Set = Extensions, Hash = 6D09DECC.dat - causes an error from the JavaScript language service, complaining about the lack of js files
  • .NETFramework, Version = v4.0, Set = Extensions, Hash = 9951BC03.dat - causes an error from the JavaScript language service complaining about missing js files.
  • .NETFramework, Version = v4.5.2, Set = RecentAssemblies, Hash = 0.dat - causes an error from the JavaScript language service complaining about missing js files

These are errors from the latest .NETFramework files (which I don’t get unless I add them back):

 01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\libhelp.js' not found. 01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\sitetypesWeb.js' not found. 01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\domWeb.js' not found. 01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\underscorefilter.js' not found. 01:10:11.7550: Referenced file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\JavaScript\References\showPlainComments.js' not found. 

I just need to reinstall / restore the JavaScript Language Service plugin, so it may not be related. But definitely devenv.exe.config and ComponentModelCache need to fix the error "object reference not installed on the object instance".

+3
Jul 14 '16 at 17:58
source share

In my case (not necessarily for you, but may be useful for someone), the solution was:

  1. Go to Tools → Extensions and Updates

  2. Select the Online tab in the right pane.

  3. Find the words web tools , and then select Microsoft ASP.NET and Web Tools and install them.

In my case, this was not on my computer due to the large number of Visual Studio recovery operations.

+2
May 17 '16 at 6:40
source share

I got an exception every time I tried to create a “new” project.

My solution was:

  • Go to Tools → Extensions and Updates

  • Check the "Updates" link ... An update has appeared for Microsoft ASP.NET and web tools. Install it.

This fixed it for me.

+2
Nov 07 '16 at 21:47
source share

After trying the top answer, I found that you should also restart the computer. The error may be part of the git problem when the computer reboot is reset.

+2
Aug 24 '18 at 15:15
source share

I got this exception every time I created a “new” project.

My solution was:

  • Go to the "Tools" menu? Extensions and Updates
  • Do not check the "Updates" link ... look for "asp.net". This was an upgrade to Microsoft ASP.NET and web tools. Get it as AspNetWebFrameworksTools2015_KB3137909.exe and install it.

This fixed it for me.




Unfortunately, I came across another exception:

"Exception selected by call target"

I disabled the FIPS Enabled DWORD parameter to zero.

 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy] Enabled=dword:00000000 And All fixed. 
+1
Dec 09 '16 at 10:09
source share

I struggled with this all weekend. But it is quite easy to do. What I did was click on the repair, not delete. After the repair, I immediately clicked on the reboot. After that, everything works fine. You should try this, maybe it can work for you too.

0
Jul 04 '16 at 12:21
source share

When I tried to save the Windows Forms form, I had the error "Object reference not installed." A simple solution for me was to close the constructor for the form, open the constructor again, and click Save.

0
Aug 2 '16 at 18:59
source share

Restarting Visual Studio did this for me. In the next run, he displayed "Scanning for new and updated MEF components ..." and then it performed normally.

Something seems like a Windows update, although I have no evidence.

0
Oct 27 '16 at 14:14
source share

Delete the bin and obj folders in all projects of this solution.

It looks like these folders had old files generated by some older version of Visual Studio that were incompatible with the new version of Visual Studio.

0
May 31 '18 at 15:20
source share

Go to windows + R, type% temp% and press enter. delete the temporary folder and files, and then try to open the same

0
Jan 18 '19 at 6:37
source share

The solution to the problem, when I had it earlier today, was that at the end of my Web.config an additional set of tags was attached. After the remote functionality has returned.

0
May 18 '19 at 17:23
source share

Problem: My VS 2015 throws an error after I installed SSDT. Whenever I clicked on Tools >> Extensions and Updates, it threw an error "The reference to the object is not installed on the object instance." When I tried to open the solution, he threw some provider that was not installed correctly.

Solution: After many hours of research, having tested all the previously mentioned solutions, my problem has not been solved. Each time a pop-up error message indicated to check the ActivityLog.xml. But I ignored it. After several hours of disappointment, I decided to carefully read the error, looked in ActivitLog.xml and found that it was looking for “Failed to load the file or assembly“ System.Collections.Immutable, Version = 1.1.37.0 . So I just started looking for this assembly and stumbled on this link https://sergeytihon.com/2015/12/01/how-to-restore-viual-studio-2015-after-update-1-dependency-dance/ and followed the steps there that fixed my problem .

Go to% LOCALAPPDATA% / Local \ Microsoft \ VisualStudio \ 14.0 \ devenv.exe.config, find "System.Collections.Immutable" and change the new version from 1.1.36.0 to 1.1.37.0.

The final config should look like this

 <dependentAssembly> <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="1.0.27.0-1.1.65535.65535" newVersion="1.1.37.0"/> </dependentAssembly> 
-one
Feb 08
source share



All Articles