Visual Studio 13 raises unknown error at the startup? - visual-studio

As I start visual studio 13 it raises unknown error by saying "Microsoft Visual Studio 2014 has stop working" without any further explanation.
Here's what I've tried to solve this problem;
I reinstall .Net framework
I repair, uninstall-install Visual Studio
2013
I installed another version of VS13
but still the problem persists. Do you have any further suggestion ?
I am using Windows 8.

I've run into a similar situation described here. Once i find a solution, i will post it there.
As a first attempt i would try to generate a logfile via the /log option and see if there is a problematic extension that you could disable/deinstall, e.g. NuGet.
You say you reinstalled VS2013, so the problem might be related to settings. If reverting all settings is an option for you, see this thread on how to truly really reset your settings. This involves calling your devenv.exe with special parameters (e.g. in a cmd.exe), removing files and tinkering with the registry.

I have found the solution to this or a similar problem if you are starting Visual Studio by loading a solution file.
The symptoms are that a solution that previously could be loaded with no problems, suddenly starts having the unknown error box appear for every project in the solution. Sometimes you can't see the relationship to the continuous reappearance of the error message and the project loading, because you don't have the solution explorer open, so you aren't even aware there is a correlation.
The solution to this is to use task manager to stop visual studio, confirm with visual studio that you wish to shut it down and then look for the .suo file for the solution you are trying to load. In VS2012 it appears in the same directory as the solution file and has the extension solutionname.v11.suo while in VS2015 it appears in a hidden .vs directory under the location where the solution file is found, in a folder named for the solution.
Delete this file and the problem will go away.
The .suo file contains the user preferences for the solution you are trying to load and it is perfectly safe to delete it as it is regenerated when you load the solution.
If you are getting the unknown error when you haven't tried to load any solutions, this is probably not the right answer.

Related

Visual Studio 2015 Extensions Manager Index was out of range error

Env: Visual Studio 2015 Community Edition on Windows 8
Trying to open Tools --> Extensions and Updates results in the following error in a message box:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Tried running as Admin, same result.
I've tried looking at the log but nothing mentions that error.
In the log there are 3 error entries related to extensions which could be related, they say the following:
Error loading extension: Could not find a part of the path 'C:\path\to\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\14.0\EXTENSIONS\ZW2UF5JV.JVN\extension.vsixmanifest'.
The other 2 are identical except the odd string at the end is HQ1Y5EQD.TMG and 3KWE1LJF.Z1W.
Interestingly, just before those errors in the log appear, there is a line for each saying the extension was loaded successfully but if I try to go to the path it's got listed, it doesn't exist.
I can't find any reference to those strings on my machine. I've also searched the registry but can't find any reference in there either.
I can get into the Extensions manager if I click on one of the update notifications but the original error message just displays in the main pane and I can't do anything else. I can get to the online window but as soon as I click an extension, I am prompted with the original message.
I haven't installed any extensions or VS updates for a while but my Web Compiler extension extension has stopped auto compiling JSX files which is why I started trying to look at the Extension manager. I'm guessing the issues are related.
I can still work, compiling can be done manually which is inconvenient but not the end of the world. My worry is some other extensions are also misbehaving and I just haven't noticed yet.
Don't really want to re-install VS as a) it took ages last time and b) it might not fix the issue. Is there any good advice on troubleshooting the error or anything else I can try before I re-install?
I refreshed the GitHub extension on VS 2015 and got this error. Deleting the two cache files:
extensions.en-US.cache
extensionSdks.en-US.cache
from the AppData\Local\Microsoft\VisualStudio\14.0\Extensions causes them to be rebuilt and eliminates the error.
No reinstall needed.
Problem got worse, I started getting the error message when starting Visual Studio and things like the package manager wouldn't load. Each restart seemed to yield a different combination of windows not loading, sometimes Solution Explorer, sometimes Team Explorer etc. Not good.
A repair to VS 2015 via the Control Panel took a while but didn't help, same problems.
I ended up completely uninstalling and trying to re-install. However the installer threw an index was out of range error but weirdly VS 2015 was now listed as an installed application again.
So I'm guessing the original uninstall left some problematic files lying around which messed up the next install. So I uninstalled again, renamed Microsoft Visual Studio 14.0 folder, cleared all files from AppData\Local\Microsoft\VisualStudio\14.0\Extensions and re-installed.
It installed and ran fine.
The problem I now had was that I couldn't find the SQL Server Object Explorer window anywhere. I tried repairing SQL Server Data Tools but still no luck. So I uninstalled SSDT and then re-installed. This seemed to fix it.
Now I realised I also couldn't connect to Azure through the Server Explorer window, the option was simply not appearing in the list like it used to. This time a repair to Azure Tools for Microsoft Visual Studio 2015 - v2.9 and a repair to Azure App Service Tools v2.9 - Visual Studio 2015 fixed that problem.
I confronted same issue and found this thread. I tried the above suggestions, but unfortunately, it went all unsuccessful. I even tried to uninstall/install with even worse result as Visual Studio became unable to start due to new "missing components" issue. Reinstallation was nothing better.
I finally came by a piece of magic. It was Visual Studio Uninstaller which although would remove all your installed extensions, it would perform a complete cleanup. It would save you from installing new Windows (at least it was my case.
Just go to releases and download the first zip file
This way you will be able to perform clean install of Visual Studio.

Visual Studio 2013 Search Solution Explorer fails to find files

So, I was using Visual Studio 2013, it crashed, and when I restarted it the Search Solution Explorer had stopped functioning correctly:
It fails to find any file if you type in the exact file name
It fails to find any static files e.g. HTML, CSS, JavaScript, etc.
It fails to find any configuration files e.g. Web.config
It seems to still find some files on a partial match, but not all files that you'd expect it to match e.g. if I search for Account I'd expect it to find AccountController.cs and AccountControllerTest.cs but it only finds the latter.
Some further info:
If I start VS 2013 in safe mode Search Solution Explorer works fine without any problems
If I manually disable or uninstall the extensions I'm using and start VS normally, the problem with Search Solution Explorer reappears
Has anyone come across anything similar to this, or got any suggestions of what to try to get Search Solution Explorer working again?
Update
I've had some joy running devenv /ResetSkipPkgs and devenv /ResetSettings. After a I ran those command Search Solution Explorer started working again, and works most of the time now. It still fails occasionally. Sometimes restarting Visual Studio will get it working again, but sometimes it just plain refuses to find certain files that are there.
Update 2
I installed Visual Studio 2013 Update 2, and Search Solution Explorer ran without any problems for just over a week before this problem reappeared. Restarting Visual Studio got Search Solution Explorer working again.
I was able to narrow this down to the extensions I was using, "Productivity Power Tools 2013" seems to break the search feature for me in IIS, so I've disabled it for now. I'm getting a full set of results when searching now.
I came to this conclusion by uninstalling all of my extensions and reinstalling them one by one until the problem reappeared.
A coworker also had some success with this solution, launching DevEnv.exe with /ResetSkipPkgs
http://msdn.microsoft.com/en-us/library/ms241276.aspx
Update
The problem returned for me after about 30 minutes, no specific cause noted. It was nice while it lasted. Removing all extensions gets me the same behavior as OP, only running in safe mode appears to work.
Deleting the .suo file also seems to fix the problem for a while, and then it comes back. I'm about to resort to a reinstall of vs2012 just to get this search feature back.
Please try to install VS2013 update 2 CTP before reinstalling everything and see if it fix the bug:
Weird that it works in Safe Mode, or that you manage to fix by removing extensiosn and it then re-appears...
but if some of your projects are in solution folders, then there is a known bug, fixed but not released yet apparently:
http://connect.microsoft.com/VisualStudio/feedback/details/801836/solution-explorer-doesnt-search-files-projects-inside-solution-folders
I have the same issue and confirmed it related to VS2013 Update 2 RC. Uninstall it will fixed this issue.
Wait for GM version of VS 2013 update 2.
I still had this issue both prior to and after installing VS update 3. I should note that it went away after I installed that for a while, and then came back. I suspect (but cannot confirm) that the broken behavior's return coincided with a lockup of my system which necessitated a reboot...
Anyway, I had the Productivity Power Tools installed, and after reading the answers here wondered if it might be complicit, and so I went to disable it and noticed it had a pending update. I went ahead and updated the add-on, and that resolved the issue for me (again). We'll see if it stays fixed.
This may caused by other extensions you have installed in your visual studio. I have some issue, found out Telerik JustTrace caused this issue.
Running devenv /ResetSkipPkgs will fix the problem but, as noted, it will return. For a permanent solution, add this parameter to the target in the exe's properties:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" -ResetSkipPkgs

VS2013 - Operation Could Not Be Completed

After installing Visual Studio 2013 and playing around with some of the new features, I noticed I'm unable to open a cshtml file in one of my MVC projects. If I try opening it in the default html editor, I'm receiving the following error
The operation could not be completed
Opening the file in another editor, IE: HTML (Webforms) Editor, opens the file without any issue. So it seems to be an issue with the default Html Editor.
I've followed various suggestions for how to combat this problem from previous versions of VS. If I delete all the solution's ".suo" files, and restart Visual Studio, the error changes to:
Object reference not set to an instance of an object
Once Visual Studio creates a new ".suo" file, the error message reverts back to the previous one.
I've tried doing a repair install on VS2013, however I'm still running into the same issues. Also, running VS in Safe-Mode did not work either. I tried creating a new MVC project, which failed during creation. With any of these errors, the windows event log does not contain any messages.
Has anyone else had this problem?
Just found your question here because it happened to me as well. Here's what I did and hopefully it will fix / help find the problem.
Deleted all .suo
Terminate IIS Express
Close VS2013 and re-open
Open your project and try to start it (F5)
You probably have an error on your web.config file. For me it was an <appSettings> being there twice.
Fixed the web.config file, save and boom, error is gone.
Hope it will also fix your situation.
Found a working solution here (tested with VS2015 Update 1):
https://github.com/aspnet/Tooling/issues/276#issuecomment-166650817
Close VS
Delete the content of %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Open VS
I just figured it out. In my web.config, I had the following in my
<appSettings>
<add key="webpages:Version" value="2.0.?.?" />
</appSettings>
Changing this the value to "3.0.0.0" resolved the issue. I never had a problem with this on VS2010 or VS2012. It seems there is something in the IDE that is not handling this gracefully.
That worked for me for VS 2015 (command prompt as Admin):
cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
devenv.exe /resetuserdata
Like most people here have mentioned, review your web.config file for duplicates. I was in a rush, just copied and pasted appSettings from another solutions without noticing the section existed already in the existing document. Then issue this thread relates to started to surface. I went back and consolidated the appSettings, saved, and the issue ceased to exist.
For me this error was resolved by setting the VS 2013 shortcut to "run as administrator".
Check for errors in your web.config file:
duplicate keys (app settings)
tags not closed or used multiple times
...
It is due to IIS Express not running from Visual Studio when you try to debug the aspx page.
Quick and dirty fix is to right click the your project and choose "Use Visual Studio Development Server" and then again right click and choose back to "Use IIS Express" will fix this problem. This way I will care about all the changes required in configuration file.
I also got this problem after using some Nuget package. The problem was a duplicate of appSettings. I merged them all and it worked.
There is also this thread that an MS employee has answered with possible cause:
This is a bug in the debugger. There is a race condition that happens when all of the following are true:
Script debugging is enabled in IE User is debugging IE and another process
The other process stops (hits breakpoint, step operation completes, stops at an exception, etc) at a moment when IE is not running script code
IE starts running script code at roughly the same moment that the user hits F10/F5 in Visual Studio.
The most likely
reason for this to happen is that the code from 'setTimeout' is run,
but I am not a JScript expert, so I am sure there are other possible
reasons as well.
and these workarounds:
If you hit this problem, I believe you could detach the debugger and then re-attach.
-or-
This problem happens when debugging ASP.NET and when script debugging is enabled in IE. If you disable script debugging in IE, or
toggle it on and off when switching between debugger server-side and
client-side problems, you would be able to work around the issue.
-or-
If your web application is using setTimeout, you may be able to avoid or at least reduce the problem by doing something to ensure that
script runs less often. This could mean increasing the timeout value,
or this could mean adding conditions around when setTimeout is used.
I had error in my web.config file, there was two spaces before <xml> tag. after removing it stopped showing this error.
I had the same error in VS 2015 running on Win 10. Fortunately fixed simply with a reboot. On restart it appears windows applied some updates in the previous session which broke VS somehow.
I got this error in Visual Studio 2015 but only after I installed ASP.NET 5 RC 1.
Installing Visual Studio 2015 Update 1 fixed the problem for me.
What solved my issue is this :
Type %LOCALAPPDATA% in Windows Explorer and go to Microsoft\XX.0 your version of Visual Studio then delete the folder ComponentModelCache
Restart VS and it worked like a charm!
This is due to an update made to GitHub which is reported in their forum
I was asked by a colleague to look at this problem. I tried all the proposed solutions and nothing worked. Eventually I found that they had done a project Update from svn and they had a conflict and ignored it. In one of the config files I found the conflict marked ".yours". I corrected this and all now loads without error.
In my case, the problem was due to my web.config's app settings include pointing to a file that doesn't exist:
<appSettings configSource="App_Config\MISSPELT-FILENAME.config" />

Visual Studio - Error when clicking on Solution -> Properties (Object reference not set to an instance of an object)

When i try to access my solution Properties, i get the following error:
Object reference not set to an instance of an object
I am using VS 2012. What could be the cause of this?
Some extensions may cause this.
Try disabling extensions and restarting Visual Studio.
Quite often error will be gone even if you re-enable extensions after this.
There's a bug report on Microsoft Connect (link).
It is marked there as "Closed as External", but it seems that it may occur randomly with any extension, so would be worth voting it there to bring it to Microsofts attention.
In my case, the problem was solution-specific. NuGet was causing this error, but not the extension itself but a NuGet package that generated an error on VS load. When I opened NuGet Package Manager Console I saw a big red text with a description of the error. In my case it was T4Scaffolding.Core package, which in turn is a dependency of MVCMailer.
If this is your case, you will probably see what package generates an error in PM Console.
I faced this dialog too and i'm not sure what exactly causes this as i couldn't even open the NuGet console to see detailed error messages.
Closing Visual Studio, deleting %AppData%\Microsoft\VisualStudio and restarting Visual Studio worked for me as it causes a reset of various things like window configurations.
I think if this dialog is displayed some files may be corrupt in %AppData%\Microsoft\VisualStudio and by deleting that folder Visual Studio can start normally again.
Update:
The issue arises on my machine when i start Visual Studio by using "run as administator" whereas Visual Studio has been started before without that option and %AppData%\Microsoft\VisualStudio had been created without the administator association.
Visual Studio 2013: I had this issue when I tried opening TOOLS -> Extensions and Updates.
I used #ViRuSTriNiTy idea, but only cleaned the files from:
C:\Users[myUserName]\AppData\Local\Microsoft\VisualStudio\12.0\Extensions
There are 2 cache files over there.
Deleted them and restarted VS2013 and it was fixed
The way it was happening for me might be unique to me/my setup, but I'd love to know if anyone else has this happen, and if they find out why:
If I launch an .sln file by double-clicking it, it will load VS and I can right-click the Solution and get Properties to come up no problem.
If I go to "Open Project" on the Visual Studio welcome page or from File > Open > Project/Solution, navigate to the .sln file and launch it by selecting it and clicking "Open" in the File dialog, that's when I have this issue.
I'm going to just always launch the .sln file from now on, but I'd love to know why this happens when using "Open Project" from the welcome page or from File > Open > Project/Solution! I tried going into Tools > NuGet Package Manager > General and I unchecked the options for allowing NuGet to download missing packages and Skip applying binding redirects, and under Package Sources I de-selected the checkboxes (my dev machine does not connect to the internet). Environment > Extensions and Updates: I tried it with and without "Load per user extensions when running as administrator" and running it as an Admin and without running as Admin. Also tried just deleting everything at C:\Users\me\AppData\Local\Microsoft\VisualStudio. No change from those 2 bullets above.

Document load is being skipped - what document is causing this?

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?
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.
I cleaned my solution via Build->Clean Solution.
Then I rebuilded my solution. Seems to work for me.
edit: i use VS 2010
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
I'm using VS2010 and had the same fault.
I removed the 2 SUO files associated to the solution and it worked fine.
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.
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.
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)
I received this error today in Visual Studio 2019. I solved it in 2 steps
Build | Clean Solution
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.

Resources