Visual Studio 2012 Crashing viewing aspx pages - visual-studio

VS is Crashing viewing aspx pages Visual Studio I get this exception. This is the exception from the event log:
Application: devenv.exe (Visual Studio Premium 2012)
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
at Microsoft.VisualStudio.TextManager.Interop.IVsExpansionManager.EnumerateExpansions(System.Guid, Int32, System.String[], Int32, Int32, Int32, Microsoft.VisualStudio.TextManager.Interop.IVsExpansionEnumeration ByRef)
at Microsoft.VisualStudio.Web.Snippets.SnippetListManager+SnippetCache.CacheLanguageExpansionStructs(Microsoft.VisualStudio.TextManager.Interop.IVsExpansionManager, System.Guid)
at Microsoft.VisualStudio.Web.Snippets.SnippetListManager+SnippetCache..ctor(Microsoft.VisualStudio.TextManager.Interop.IVsExpansionManager, System.Guid, SnippetCache)
at Microsoft.VisualStudio.Web.Snippets.SnippetListManager.ResetSnippetCache(System.Guid)
at Microsoft.VisualStudio.Web.Snippets.SnippetListManager.EnsureInitialized(System.Guid)
at Microsoft.VisualStudio.Web.Snippets.SnippetListManager.GetInstance(System.Guid)
at Microsoft.VisualStudio.Web.Factory.Microsoft.VisualStudio.Web.Interop.IMVWFactory.CreateSnippetListManager(System.Guid)
at Microsoft.VisualStudio.Shell.Interop.IOleInPlaceComponent.FDoIdle(UInt32)
at Microsoft.VisualStudio.Platform.WindowManagement.OleInPlaceComponentIdleManager.PassOnIdleTime(System.Collections.Generic.List`1<Microsoft.VisualStudio.Shell.Interop.IOleInPlaceComponent>, Microsoft.VisualStudio.PlatformUI.OleComponentSupport.IdleTypes)
at Microsoft.VisualStudio.Platform.WindowManagement.OleInPlaceComponentIdleManager.FDoIdleCore(UInt32)
at Microsoft.VisualStudio.PlatformUI.OleComponentSupport.OleComponent.Microsoft.VisualStudio.OLE.Interop.IOleComponent.FDoIdle(UInt32)
I have:
- Started Visual Studio in Safe Mode
- Reverted my settings to default
- Repaired
- Done a uninstall and reinstall
Anyone else have any ideas ?

It sounds like a bug in the expansion manager (an unmanaged component of Visual Studio).
It is responsible notably for Visual Studio's snippet expansion feature.
You could track the registry, for example, this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\Languages\CodeExpa‌​nsions
and check all the sub keys, see if something looks bad, the directories, or even the .XML files (containing snippet configurations) pointed at. You can also use SysInternals' ProcMon tool to monitor what's going on.
Ultimately, you could also kill all these keys and launch a repair...
It's also possible to report the bug to Microsoft here: Connect site for Visual Studio but if it's not easily reproducible, it may not be fixed in a near future.

Related

Visual Studio 2015 crashes

Visual studio that won't be repaired...
Everytime I want to compile an app on vs 2015 - it crashes. Even if I want to compile the main function or write somthing to it, there appears a window, which says
Visual Studio 2015 has stopped working
It goes same on 2013 Express version.
I have a clue why it won't work: when I open Team Explorer, an error appears:
Page '3185ed96-1cbd-4381-a439-636973542e50' not found.
I tried everything I have found in the internet and trust me - nothing worked.
I also tried some command prompt commands:
devenv.exe/ debug
devenv.exe/ resetsettings
devenv.exe/ instalvstemplates
devenv.exe/ resetskippings
devenv.exe/ resetuserdata
devenv.exe/ setup
devenv.exe/ safemode
Debug mode gave me some info about the error:
An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
Additional information: The service 'Microsoft.Internal.VisualStudio.Shell.Interop.SVsUIThreadInvokerPrivate' must be installed for this feature to work. Ensure that this service is available. HRESULT = 0x80004002
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\admin\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml".
Exception details:
System.ArgumentException: Parametr is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, UInt32 flags)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Guid& toolWindowType, Int32 id)
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
But still nothing I was able to find has worked.
I reinstalled VS and repaired it - still nothing.
Then I have downloaded some .dlls, microsoft visual c++ redistributable packages and used Ccleaner to clean registry.
I think it's a very strange error; if you could advise me on a fix please?
Uncheck [Tools->Options->Environment->Automatically adjust visual experience based on client performance]
Uncheck [Use hardware graphics acceleration if available]
You can leave [Enable rich client visual experience] checked
I was having a lot of problems anywhere from random crashes, to crashing my Intel Graphics display driver, I turned it off and I have had no problems, it actually runs better. Maybe it will work for you
I was facing the same issue for team explorer.
First of all close all instances of visual studio and then try:
devenv /resetuserdata
Run above command at the command prompt; typically something similar to "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE"
Possible fix for these type errors:
try to update device driver (Intel HD Graphics) or Run with graphic driver if u got switch based or vice versa.
main executable is located
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\devenv.exe
Also if you are getting these type error on installation exe you can fix it the same way
Visual Studio uses WPF:
From this link: "Windows Presentation Foundation (WPF) differs from prior application platforms on Windows in that it uses its own DirectX-based hardware-accelerated rendering pipeline, when available, to draw the contents of any WPF windows. Prior application platforms were typically much less dependent on display driver quality because the bulk of their rendering was done in software rather than hardware."
So, it may conflict with the display driver causing it to stop if you don't have latest display driver or the latest .NET framework. Though there might be other reasons.
There is also a registry settings(regedit) which might help:
You can add a new DWORD(for 32-bit systems) or QWORD(for 64-bit) by going to [HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Control->GraphicsDrivers]
and setting the name to "TdrDelay" and value to "8". Make sure the value's base is set to hexadecimal. TDR- Timeout Detection and Recovery.
If any of the above doesn't work. Try disabling any hardware accelerated rendering features in Visual Studio from [Tools->Options]. From your ActivityLog file, it seems that the exceptions are mostly in the graphics methods. So, my guess is it has to do with graphics rendering.
Click on Tools menu > Import and Export Settings > Reset all settings > Next > "No, just reset settings, overwriting all current settings" > Next > Finish.
i have faced problem of visual studio installation
it stop before start installation and i just go to control panel > programs >Turn windows features on or of > just uncheck all the .NETframework versions and restart your machine and then start the installation
this just how it works with me
You can also try closing VS, deleting the bin directory then attempting to debug again – it has worked for me.
It's been a while, but I'm seeing similar behavior since today.
Every time I load our solution, VS2015 crashes and restarts.
Windows Event Log shows 'out of memory exception' but there's over 2GB free at the time of the crash. the faulting module is KERNELBASE.DLL
In case this helps anyone:
Faulting application name: devenv.exe, version: 14.0.25420.1, time stamp: 0x57685d85
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23915, time stamp: 0x59b94abb
I'm suspecting a windows update, as none of my colleagues have this problem and unfortunately I'm that nerd who always installs his updates ASAP.
I found this SOF article and tried everything listed.
And I found a new caveat to this voodoo.
Mine falls under the "the dumbest reason ever" category.
My temp folder was "full". So I did a disk clean up, and that deleted the FILES. However, I had a large amount of subfolders in my temp folder and while they were empty, the folders themselves were causing GetTempFile functions to fail.
So when I ran
"C:\blah\blah\blah\IDE\devenv.exe" /log
the log entries in ActivityLog.xml were showing something like this:
System.IO.IOException: The file exists.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMargin.get_RightArrowCursor()
at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMarginProvider.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__2(IWpfTextViewMarginProvider mp)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)
In that log entry text, don't miss the text "System.IO.Path.InternalGetTempFileName"
So several places said "delete your temp files", which I did, but I still got the same issues. :(
Then I took a look at the temp directory, and I saw something weird. A large amount of (empty) subfolders.
So once I discovered I had a bunch of subfolders in my temp directory, I cleaned up these subfolders.
I found this question:
How to delete files/subfolders in a specific directory at command prompt in Windows
So I used this code:
I put this code in a .bat file
del /q "C:\Users\MYUSERNAME\AppData\Local\Temp\*"
FOR /D %%p IN ("C:\Users\MYUSERNAME\AppData\Local\Temp\*.*") DO rmdir "%%p" /s /q
And now my Visual Studio is running ok again.
Wow, go figure.
if you're using windows 10. Try installing VS2015 update 3
https://learn.microsoft.com/en-us/previous-versions/mt752379(v=vs.140)?redirectedfrom=MSDN

Visual Studio 2010 crashes on opening! I'm starting to hate everything!

Howdy, I noticed that Visual Studio crashed when I tried to open a .SQL file. Perhaps this was due to me installing SQL SERVER 2008 last week. Anyway to overcome the issue I repaired Visual Studio using the install disc. One hour later and a couple of reboots the issue remained. However now the thing crashes as soon as I select a project!
Here's what the event viewer says:
EventType clr20r3, P1 devenv.exe, P2
10.0.40219.1, P3 4d5f2a73, P4 microsoft.visualstudio.editor.implementation,
P5 10.0.0.0, P6 4d5f2b24, P7 d2, P8
9a, P9 system.nullreferenceexception,
P10 NIL.
I'm starting to lose the will to live.
With Regards to Andrei Drynov's answer / comment **
Okay, the service pack is on there, the contents of the SQL file are irrelevant as the files opened with ease previously and it happens on that file type not a specific file also the crashing happens regardless of the project/solution I select? I do agree that I am being dramatic!
After starting in safe mode **
I got the following error
"An exception was encountered while
constructing the content of this
frame. This information is also
logged by running the application with
the /log parameter on the command
line, which stores results in
"C:\Documents and
Settings\XXXXXXX\Application
Data\Microsoft\VisualStudio\10.0\ActivityLog.xml".
Exception details:
System.UnauthorizedAccessException:
Package
'Attrice.TeamFoundation.Sidekicks.VisualStudio.MainPackage,
Attrice.TeamFoundation.Sidekicks.Package.10,
Version=3.0.3.1, Culture=neutral,
PublicKeyToken=14bece0700b6dc89'
failed to load. at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32
errorCode) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
I then got the following
Microsoft Visual Studio
'C:\Dev\XXXXXX.Deploy.wdproj'
cannot be opened because its project
type (.wdproj) is not supported by
this version of the application.
To open it, please use a version that
supports this type of project.
So I'll reinstall the Visual Studio® 2010 Web Deployment Projects to see if that works? How odd.
This worked a treat!
Thank God!
Visual Studio 2010 hangs up when opening a .sql file
You are being quite dramatic )))
Please provide more information, e.g. post the SQL file contents, tell more about the project type, etc.
BTW, did you install service pack 1?
I had a VS2010 solution with two Database projects that, on and off, crashed VS2010 on opening.
After a few attempts I noticed that the .SLN file had the two projects correctly referenced BUT the TAG SccNumberOfProjects referenced 3 instead of 2.
Global\GlobalSection\SccNumberOfProjects = 3
I "text-edited" for 2 and it worked, at least for now.
As the crash was happening on and off with no apparent reason, I cannot guarantee that this was in fact THE solution; use at your own risk and of course, backup files first. ;)

Visual Studio 2010 Crashing on Solution Load

I've seen a lot of similar questions, but I don't think I'm duplicating. Here's my situation. I have three solutions that I'm working with. A works fine, but when I try to load B or C, VS 2010 crashes shortly after loading the solution, particularly after I try to open a file form my solution explorer.
What I've tried:
Disabling all add-ins and macros vis tools -> options -> add-in/Macros Security then unchecking the two relevant check boxes
Deleting my .suo file.
Rebooting my machine
Running VS 2010 as Administrator
Here's the error from my event viewer
Faulting application name: devenv.exe,
version: 10.0.30319.1, time stamp:
0x4ba1fab3 Faulting module name:
cslangsvc.dll, version: 10.0.30319.1,
time stamp: 0x4ba20c61 Exception code:
0xc0000005 Fault offset: 0x0024b651
Faulting process id: 0x1408 Faulting
application start time:
0x01cbddd78972584a Faulting
application path: c:\Program Files
(x86)\Microsoft Visual Studio
10.0\Common7\IDE\devenv.exe Faulting module path: c:\Program Files
(x86)\Microsoft Visual Studio
10.0\VC#\VCSPackages\cslangsvc.dll Report Id:
cd32c352-49ca-11e0-b3d8-0026b9c2aa7e
EDIT
This is a solution with two projects -> a win forms project, and a console project. Both in C#
RESOLUTION
It turns out there was some silly (stupid?) code in my solution that was making VS go crazy. The code should never really have been in there; it was just something I wrote playing around for no good reason.
On a related note, if you ever want to be evil to someone you don't like, insert the following code into their solution somewhere, and sit back and watch the fun:
namespace System {
public partial class Boolean { }
}
I put this code into the first solution, and watched it crash after building. I ass-umed the crash was unlreated to the code I had just written and proceeded to put it into my second solution to see if it was possible to extend Boolean without extension methods, then got angry that VS was still crashing. That code could be capable of crashing VS never crossed my mind.
Try disabling all extensions via tools -> extension manager. I've had extensions crash visual studio only in certain projects.
Alternatively try running VS in safemode: devenv.exe /SafeMode
I tried the following in the order i performed:
devenv.exe /resetsettings , devenv.exe /resetskippkgs (did not work)
devenv.exe /safemode (told me that product version cannot open .ccproj types. But no counter solution worked)
renamed the .user, .suo files (did not work)
Installed any and every service pack for VS2010 even if they were remotely related to C# development.
"Reinstalled" VS2010 using the 'repair/reinstall' option(did not work)
Uninstalled VS2010 and then installed (this was my solution even though many of them tried this and failed. Might be because this was my last resort.)
If it's a C++ project, try deleting any PDB files that are hanging around - these sometimes get corrupted and cause crashes.
I encountered a similar problem, VS2010 crashed upon loading a specific solution.
It turned out to be an incomplete line in the code that caused VS2010 to run amok. When I commented the line out, everything was ok.
The line in question was:
getCommonResourcesDirectory([out, retval] BSTR* );
A crash can also happen in Visual Studio 2010 during solution load if/when the testing tools (Test View window etc.) load a DLL that throws an exception during initialization.
My specific case was a C++/CLI test project where a global variable was throwing an exception during construction of it, that constructor being called during DLL INIT. (It was the std::tr1::regex class constructor throwing due to invalid pattern string passed to it.)
This was quite a subtle problem because you don't expect your code to run until you execute the test; but in the case of ctors of C++ globals it is being run by the IDE immediately after build and on solution load.
I suspect Visual Studio 2010 test manager component isn't wrapping the Dll load call in a try/catch block where it might.
Set the form that crashes Visual Studio as the main form to load. Then start the form in debug mod from the DEBUG menu.
I realize this is an old post, but I came up with another solution today as I was working on the same issue. In my case, VS was trying to open a source code file using the CSharp Form Editor instead of the CSharp Editor.
When that happened, the code started to run (I saw my splash screen) but an error occurred (I saw my error message about not finding some hardware) and the resulting error closed VS. Trying to reopen the project would have VS open the *.cs file again, creating a frustrating loop of crashes.
I was able to open the project after deleting the *.suo file. Then in Solution Explorer I right clicked the code file and selected Open With. In the dialog I changed the default and everything was fine, including seeing the hardware that I was not finding before.

Visual Studio 2010 crashes repeatedly

I've been running Visual Studio 2010 (the official release) for some time now. Lately, VS will crash 10+ times during my 8 hour work day. In VS2008, crashes were common when working with large Xaml files, and while I experience some of that with VS2010, crashes occur when debugging, starting the debugger, stopping the debugger, and other random times when editing code.
I've looked through the problem reports, and the one I've found that occurs most frequently is:
Description
Faulting Application Path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Problem signature
Problem Event Name: APPCRASH
Application Name: devenv.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba1fab3
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000005
Exception Offset: 0002e23e
I'm running Windows 7 (x64). Hoepfully someone has come across this problem and has found a solution. I plan on reinstalling VS2010. Hopefully that takes care of the problem.
Do you think you have installed any extra Extensions which might lead to frequent crashes?
You can try
Devenv.exe /SafeMode
to start in Safe mode. You can also try
Devenv.exe /Log
Which will log all activity. Have not tried this so don't know What activities are logged.
Visual Studio 2010 Command Line Switches
I was having a similar problem and this helped me
http://connect.microsoft.com/VisualStudio/feedback/details/618802/visual-studio-random-frequent-crash
Running this from the command prompt seemed to fix it. It hasn't crashed for the whole day today.
regsvr32 c:\Windows\System32\ole32.dll
I had similar issues with Visual Studio. The problem was the service pack which for some reason was not installed properly.
I had to reapply the SP1 using the Repair / reapply option. This kind of fixed my issue.
Also make sure to reboot the system.
Just to help people who search it: It was webex instant messenger related part, but not Cisco itself. The cause was a component in Studio Power Tools relevant to integration with messenger. Reinstall power tools but without messaging integration.
In other occasion it is almost always a corporate antivirus authentication helper thing. It required to manually remove registry entries which cause background TFS logins break the studio at random moments.
I had the "Microsoft Visual Studio 2010 has stopped working" error, imediately when Visual Studio 2010 was starting. Fault module was clr.dll in my case. Only rebooting helped sometimes.
I solved it by removing .NET completely and reinstalling it.
Be aware that if you updated to .NET 4.5 this includes .NET 4, so you have to remove and reinstall .NET 4.5
I know why it could be crashing. Code it self. Have you tried to debug the failed instance of VS2010 with Vs2010? If the xaml designer crashed anywhere in your code you should be able to see the stack trace. Also, try to load the same xaml into Blend 4 and then run the vs2010 on Blend when that crashes. I've had some good results debugging Vs2010 crashes like that.
There are so many things that can cause studio to crash.
I'd look at everything from video card drivers to whether the RAM is stable.
Note, there is a microsoft connect but on this exact issue at: http://connect.microsoft.com/VisualStudio/feedback/details/634162/devenv-exe-frequent-intermittent-crashes-fault-module-name-ntdll-dll
You might vote on it or add your own information to the report but the very first thing I'd do is update my video drivers. One place I was at had a lot of issues with 2005; it would randomly crash just displaying the design surface or when opening a few too many code files; but once we got decent video cards and the appropriate drivers installed it worked flawlessly.
I disabled “Options"-"Evnironment"-"Add-in/Micros Security"->"Allow macros to run", and fixed the problem.
I think I just solved a similar issue on my computer, but probably not the same cause. It was related to TortoiseSVN (I think visual loads the tortoise DLL because it is integrated with the explorer, even if I don't have a specific visual studio plug-in). I upgraded TortoiseSVN (from 1.7.8 to 1.7.11) and it didn't crash for a few hours (I also had a 100% repro case when closing visual studio which does not happen anymore). Maybe there is some way to check what DLLs are loaded by visual studio to troubleshoot what are the candidates for upgrading/uninstalling, but I didn't go this far.
Hope it can help someone else.
While developing C++ code, Visual Studio 2010 started crashing frequently and at random times after I enabled the Task List.
As an alternative to using the Task List, I am now simply using the Find in Files tool (Ctrl+Shift+F) and searching for the string TODO as an alternative.
i was having a similar problem. visual studio 2010 was crashing. when i attached, it said it had a read access violation in ntdll.dll
closed all my open instances (there were 5) and it stopped happening.
Today I had this error, in my case it was because Microsoft released the update (KB2858725) the FrameWork 4.5.1, which the download and installed,
However this is definitely addressed by performing the following steps:
FrameWork 4.5.1 download (KB2858728) => NDP451-KB2858728-x86-x64-ENU.exe-Allos
http://www.microsoft.com/en-us/download/details.aspx?id=40779
Install the downloaded software (KB2858728)
Try Vs, but give the same error.
Uninstall the downloaded software (KB2858728)
(this task fully cleaned upgrade giving problems (KB2858725)
Install the downloaded software (KB2858728) again
Try Vs, this time if it will work
NOTE: NEVER! install update (KB2858725)
Logging helps indeed. I have the same problem with crashes. Since there could be numerous reasons and lots of log data, I wrote this .bat (Win7 x64, VS2010 Express) to keep logs organized and easy to analyze:
#echo off
rem date and time in format YYYYMonDD_hhmmss
set year=%DATE:~-4%
set month=%DATE:~3,2%
set day=%DATE:~0,2%
IF %month%==01 set monthstr=Jan
IF %month%==02 set monthstr=Feb
IF %month%==03 set monthstr=Mar
IF %month%==04 set monthstr=Apr
IF %month%==05 set monthstr=May
IF %month%==06 set monthstr=Jun
IF %month%==07 set monthstr=Jul
IF %month%==08 set monthstr=Aug
IF %month%==09 set monthstr=Sep
IF %month%==10 set monthstr=Oct
IF %month%==11 set monthstr=Nov
IF %month%==12 set monthstr=Dec
set now=%TIME:~0,-3%
set now=%now::=%
set now=%now: =0%
set now=%year%%monthstr%%day%_%now%
start "VS2010 express" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" /Log "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSlogs\VS_log_%now%.txt"
I had the same problem. I cleared my settings. Configured environment to use C# development settings. Then i disabled all extensions against which disable button was present. I enabled them one by one while opening, running and closing solutions. I found the offending extension to be .Net reflector v 8.5.0.179 by red gate. I had VS2010, VS2012 and VS2013 all installed on my windows 8.1 enterprise 64bit. All of them had the same issue. Whenever i closed the solution VS would crash. Hope it helps.

Visual Studio 2005 - can not open form on designer

My team developed a GUI application on Visual Studio 2005, managed C++. Since some deliveries it is not possible to open the form in the designer, even if the source code and the project settings have not been changed. The designer reports this error:
Exception of type 'System.OutOfMemoryException' was thrown.
at Microsoft.VisualStudio.Design.VSDynamicTypeService.ShadowCopyAssembly(String fileName)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(String codeBase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
...
We successfully recompiled the project but we still encounter this problem.
Any idea?
This is how I used to debug these issues, Start a second instance of visual studio, load your project and attach to the first instance which also has the project loaded. Now set a breakpoint in the constructor and Page Load events and also any custom paint events that you may have in the form in the second instance and try to open the designer in the first instance, the breakpoints should get hit and you should be able to see what's going on.
I suspect that you have a Design Mode error where an infinite loop (or recursive control creation) occurs on the concerned Form.
One thing that helped me in these kinds of error on Windows Forms would be the following:
Open your Visual Studio 2005 solution for your GUI application. Don't open your form yet
Open another instance of Visual Studio 2005
In the second instance, Attach (Debug -> Attach to Process) the first instance of devenv.exe to the debugger. Make sure exceptions (Debug -> Exceptions) have all exceptions checkboxes under "Thrown" checked.
Now go to your first VS2005 instance and open the form. The second VS2005 instance will stop at the line where the error occurs.
This is a long shot, but try closing and opening the designer several times in a row. I have had the same kinds of problems with the C# Windows Forms designer (VS2005) : the form usually ended up opening correctly (after 5 tries, quite consistently).
I've run into the same issue intermittently when working with a large multi-project solution, or a project with an exceedingly large and complicated windows form.
I was able to solve the problem by enabling Visual Studio to use more than 2GB of memory. Here's the process...
(note: this assumes XP and Visual Studio 2005 - Vista and/or VS2008 will require slight changes)
Edit Boot.ini
Right-click My Computer, properties, Advanced tab. Under Startup and Recovery click Settings. Click the Edit button, and add the /3GB switch to the end of the [operating systems] line:
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /3GB
Make Visual Studio "Large Address Aware"
Run a Visual Studio Command Prompt, and change to the IDE directory:
cd %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE
Use the microsoft tool editbin to modify devenv.exe:
editbin /LARGEADDRESSAWARE devenv.exe
Now reboot, and you're done!

Resources