37

when loading up a solution in VS2008 I get:

An error was encountered while opening associated documents the last time this solution was loaded. Document load is being skipped during this solution load in order to avoid that error.

How can I find which document is causing the problem?

Mihai Limbășan
  • 64,368
  • 4
  • 48
  • 59
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
  • 1
    I am also facing this problem and would LOVE to hear a solution. I do *not* have the Ajax Toolkit installed ... my project is an ASP.NET MVC app. – Charlie Flowers Dec 08 '09 at 23:22

8 Answers8

22

I can't say I've seen this particular error, but I'm wondering if that might be stored in the .suo file associated with your solution. The .suo is where VS tracks which files you had open previously, so maybe it tracks failed ones as well. You might try renaming or deleting that file and then reloading the solution to see if the error goes away. Unfortunately, those files aren't entirely human-readable, so if that proves to be the location, it may not be trivial to determine which file was at fault.

Pedro
  • 12,032
  • 4
  • 32
  • 45
  • Sometimes, deleting the suo does not seem to fix the problem. It seems that opening ANY view page (aspx, haven't tested aspc) will cause VS to just shut down. – Charlie Flowers Dec 15 '09 at 15:40
  • @Charlie Flowers: The original post was in regards to a message about a previous load failure (which seemed to happen infrequently.) In your case, you are having problems opening any file without VS crashing. In that scenario, I would look for a custom control or invalid data binding that might be causing the crash. – Pedro Dec 15 '09 at 23:49
  • @Pedro - Thx for the response. It does not fail opening any files. Most files are fine. But ANY aspx or ascx file will cause it to crash. I'm using MVC, so I don't have any controls. What do you mean by an "invalid data binding"? And thanks for the help! – Charlie Flowers Jan 06 '10 at 15:37
  • @Charlie Flowers: I ran into an issue with WinForms pages that would crash VS if the data bindings were invalid. Not necessarily your problem but it was the first thing I thought of. My old blog post about it: http://automaticchainsaw.blogspot.com/2007/11/invalid-data-source-crashes-visual.html – Pedro Jan 08 '10 at 17:45
  • Had this message today, don't know why. Deleted my suo file and it went away. +1 – Chris Marisic Jun 24 '11 at 16:29
  • Still happening years later with VS2012... Same fix. – Fetchez la vache Nov 12 '13 at 09:37
  • And with VS2019 – unbob Jun 19 '19 at 13:27
10

I cleaned my solution via Build->Clean Solution.

Then I rebuilded my solution. Seems to work for me.

edit: i use VS 2010

Wesley
  • 251
  • 3
  • 9
3

I've been shut down by this problem all morning, so I've been doing some forced research. here's a tidbit that may help, along with some links I've found (but IO haven't read them all yet).

First of all, the tidbit. It seems that if I can get the solution to open at all (which I can, the second time, when VS.NET skips the "Document loading" step), and then immediately do a Rebuild All, that might "fix" the problem (meaning, the problem will go away for a while and show up a few days later, but at least I can get some work done).

Of course, that may turn out to be a red herring, but it appears to hold true right now.

Next, here are some links I've found. I haven't read all of them, but they are about this problem or very similar ones, and they may help somebody.

http://social.msdn.microsoft.com/forums/en-US/vssetup/thread/cb73c8d6-077f-4220-aaf8-463039ee1d5f

Why does Visual Studio crash opening ASPX with MVC RC1

Resharper (R#) 4.5 and MVC (1.0) solutions cause Visual Studio 2008 SP1 to crash on solution load

http://www.lostechies.com/blogs/hex/archive/2009/03/02/hot-fix-available-for-visual-studio-2008-sp1-crashing-when-opening-up-aspx-files-views-on-vista-sp1-x64.aspx

http://www.chowamigo.co.uk/2009/10/fix-visual-studio-hangs-crashes-and.html

http://forums.asp.net/p/1384470/2942121.aspx#2942121

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=471570

http://blogs.msdn.com/jnak/archive/2009/02/26/fix-available-asp-net-mvc-rc-crash-in-a-windows-azure-cloud-service-project.aspx

Community
  • 1
  • 1
Charlie Flowers
  • 17,338
  • 10
  • 71
  • 88
3

I'm using VS2010 and had the same fault. I removed the 2 SUO files associated to the solution and it worked fine.

1

I had this issue as well. I deleted the *.suo file associated with the solution. When I attempted to load the solution again I was prompted with the same error except that this time Visual Studio didn't crash instantly. When I clicked "ok" on the error dialog the solution seemed to load just fine.

Richard
  • 1,219
  • 11
  • 13
1

It may not be possible to definitely determine which file is causing the issue. Similar errors have been reported with widely varying circumstances, except for the condition where there is at least 1 file that was still open for editing at the last time the solution was successfully opened and closed.

I've looked at this myself with WinDbg active, and the call stack is filled with a chain of DLLs in thread/module unload state. Most likely this is being caused by a race condition or other faulty multi-threading behavior in visual studio.

Here are other references you can view, in case others update them with additional information.

IDE Reports Error ... @ Microsoft Connect
Error Loading Solution 100% of the time ... @ Microsoft Connect
Error opening associated documents ... @ Stack Overflow

Edit:

I should add that my conclusion of this being a race condition is based upon clues gathered while trying to create a minidump of the crash in Visual Studio with WinDbg; and prior history with similar unexplained bugs in older versions of Visual Studio.

In my exploration, WinDbg consistently reports that a minidump cannot be created for this crash because ReadProcessMemory has failed. The stack trace contains a trail of DllUnloads called for various reasons. There are no reports of this bug happening when there are no document views that were open at the last time the solution was closed. In combining these clues, my guess is that there are bugs in the order of instantiation; perhaps as two views of the same type are opened, one completes ahead of the other and causes the cleanup of a resource that is shared by both actions.

It is possible that this isn't a race condition or threading bug, though the symptoms strongly suggest it. Fortunately for myself and others who have chimed in with answers, when I've encountered this bug, deleting the .SUO file (and .NCB file in older versions of Visual Studio) fixes the problem.

Community
  • 1
  • 1
meklarian
  • 6,595
  • 1
  • 23
  • 49
0

Received this "document load skipped" error, then an "object reference not set to an instance of an object" error when I tried to close VS. I fixed both by deleting:

  • C:\Users{user}\AppData\Local\Microsoft\VisualStudio\ComponentModelCache and
  • C:\Users{user}\AppData\Local\Microsoft\VisualStudio\devenv.exe.config
  • C:\Users{user}\AppData\Local\Microsoft\VisualStudio.NETFramework,Version=v4.0,Set=Extensions,Hash=6D09DECC.dat
  • C:\Users{user}\AppData\Local\Microsoft\VisualStudio.NETFramework,Version=v4.0,Set=Extensions,Hash=9951BC03.dat
  • C:\Users{user}\AppData\Local\Microsoft\VisualStudio.NETFramework,Version=v4.5.2,Set=RecentAssemblies,Hash=0.dat

I found those first two were causing other errors related to missing packages when I'd load up my project, and the "object reference not set to an instance of an object" when trying to close VS, and was receiving errors from the JavaScript Language Service, complaining of missing js files from those last .NETFramework files (which I do not get if I do not add them back in):

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 might just need to re-install/repair the JavaScript Language Service plug-in, and it's possible those were the files getting "skipped". But I would try getting rid of all of the files I listed above and restarting Visual Studio. They should get re-created, except for the .NETFramework files. If you like, you can back the .NETFramework files up, then delete them, and then paste them back in one at a time and relaunch VS between each file copy-back that you do, to narrow things down, as I did.

Posted my process I used to figure this out at Visual Studio 2015 error "Object reference not set to an instance of an object" after install of ASP.NET and Web Tools 2015 (RC1 Update 1)

Community
  • 1
  • 1
vapcguy
  • 7,097
  • 1
  • 56
  • 52
0

I received this error today in Visual Studio 2019. I solved it in 2 steps

  1. Build | Clean Solution
  2. Rebuild Solution

I'm uncertain which of the 2 steps above did the trick, but I am certain that it is fixed. I would be nothing without Stack. Thank you everyone for posting on this site.