31

I installed VS 2015 version on my system. I already had Visual studio 2013 update 4 installed on my machine. But now, whenever I try to open any cshtml ( razor view) in VS 2013, I get following error:


Microsoft Visual Studio

The operation could not be completed. Invalid pointer

OK

Please suggest me its solution.

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316
  • To add to this, as a workaround I am able to open up the file using "open with" and selecting the xml editor. I can then open it up regularly so long as the XML editor is open for that file. However this does not give any intellisense for the razor view – mirhagk Dec 07 '15 at 16:04
  • 2
    It is a very low-level COM error, E_POINTER, could be anything. You'd normally put add-ins at the top of the suspect list but I don't use any and still see these non-descript COM errors a lot. Also after Update 1, VS2015 is a massive bag-o-bugs. DevDiv's new focus on agile development appears to have included firing all their test engineers, they are not agile enough. Restarting it has so far always resolved the problem, I'm keeping my fingers crossed. – Hans Passant Dec 11 '15 at 09:54

8 Answers8

78

For anyone arriving here after installing Visual Studio 2015 Update 1 and then updating some packages, here is what fixed it for me:

  1. Close Visual Studio
  2. Delete %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Re-open Visual Studio

I was getting this error message in VS2015 and the fix worked for me, so it seems to apply to 2013 and 2015.

I found the solution on another Stack Overflow question: Visual Studio 2015 Broken Razor Intellisense.

Community
  • 1
  • 1
jslatts
  • 9,307
  • 5
  • 35
  • 38
  • 1
    I'm giving this the bounty because this is probably what ended up happening through my steps, and it seems to have worked for others. – mirhagk Dec 11 '15 at 15:09
  • This was the fix for me. Worked in VS 2015 too. – atp03 Feb 02 '16 at 10:19
  • Worked for me. When you delete that folder you get these dialogues which you've probably noticed from time to time, something in there probably gets messed up: Scanning new and updated MEF components... Writing component cache... Composing MEF graph... – Nicholas Petersen Mar 17 '16 at 17:18
  • Deleting ComponentModelCache solved this issue. Why did it work though? Anyone have an explanation? – Jimmy Shaw Oct 30 '16 at 15:14
1

Installing Visual Studio 2015 Update 1 fixed this for me:

franzo
  • 1,379
  • 1
  • 15
  • 30
  • 2
    It only occurred for me after installing update 1. I think ultimately the solution is probably something to do with clearing a cache – mirhagk Dec 09 '15 at 16:48
  • This just happened to me after update 1 as well. Did you find a solution @mirhagk? – jslatts Dec 09 '15 at 18:52
  • My solution is below. I closed VS, opened up dev tools and ran `devenv /SafeMode` then opened the file successfully. Then I closed it and opened it normally – mirhagk Dec 09 '15 at 21:05
  • I tried that with no luck. Had to delete ComponentModelCache per my answer here. – jslatts Dec 10 '15 at 17:26
1

Sometimes it helps to delete Solution User Options (.Suo) File. In my case it was the evil and worked for me.

Emil
  • 6,411
  • 7
  • 62
  • 112
0

I'm not sure what ended up fixing it, but I closed Visual Studio and opened up developer tools, and ran devenv /SafeMode which starts it with no extensions installed. I then navigated and opened up the solution in the instance and it worked. It complained about source control bindings and removed those (This solution used to be in a TFS project and now it's in a git tfs project). Then after saving it and closing visual studio I was able to re-open the solution from file explorer.

I'm not sure if it was the devenv or the source control bindings that fixed it, or just restarting visual studio for the umpteenth time, but it appears to work now.

mirhagk
  • 1,255
  • 3
  • 14
  • 28
  • FWIW, I did try this (safemode) and have any complaints about bindings. Still got the pointer error in safemode as well. – jslatts Dec 11 '15 at 18:06
0

I have the same error and I have tried the following with NO SUCCES

I finally uninstalled visual studio 2015. Restarted and installed it again and then it worked.

Benjamin
  • 333
  • 1
  • 3
  • 14
0

Sometimes it is just a matter of closing Visual Studio 2015 and then open again.

I have had this happen on a few machines.

This does happen

"Have you tried to delete the "Your_Solution_FileName.suo" file?" 

Also computer crashing like e.g. power outage etc...

Tom Stickel
  • 19,633
  • 6
  • 111
  • 113
0

I managed to get rid of this error by a combination of the answers here plus some more:

  1. Close Visual Studio
  2. Delete %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
  3. Delete the .suo file
  4. Re-open Visual Studio - the same error
  5. Edit the .csproj file - >go to the ProjectExtensions/VisualStudio/FlavorProperties, delete the entire FlavorProperties element.
  6. Reload the project
IonutC
  • 607
  • 1
  • 6
  • 11
-1

try

  • reopening solution
  • renaming the solution file (.sln) to something else
  • deleting of "ProjectExtensions"
coder771
  • 368
  • 5
  • 17