VS 2010 loading slow - Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown
Asked Answered
L

4

11

I'm having an issue with VS 2010. It's running very slow and also crashes occasionally when compiling and packaging a xap file with the following error:

Xap packaging failed. Exception of type 'System.OutOfMemoryException' was thrown.

In the local Windows 7 temp directory \Users\usernamexxxx\AppData\Local\Temp there are thousands of files, so I removed them and now VS is much faster.

Is anyone else having similar issues?

License answered 17/2, 2011 at 20:34 Comment(10)
Just close VS, emptying the Temp folder isn't necessary.Jerald
Is there another way? I'm getting this exception 5-6 time per daysQueenqueena
How much system memory do you have?Blader
are you running windows 7 on 64bit or 32bit?Maisonette
I assume this is a Silverlight project? Does compiling actually finish and it's just the xap packaging that fails?Untouchable
This is a bug. Lots of people are getting it. Happens to me and rest of team a few times a day.Johnsen
Having this problem also, started appearing as the solution got that bit bigger. Closing and reopening VS works but is not the answer, doing this 6 or more times a day is just a pain. Its surely an issue with VS, but what is the solution??? My machine has 4 Gb of memory. Its putting me off using SL!!!Bulbar
Bought i7 desktop has 8GB Ram solved this issue :) Otherwise clean delete generated codes,restart VS2010 many times,free your RAM. It was really annoying.Psychogenesis
Davut .... don't worry you'll get back to the same stage in a while...we did the same. is VS2010...and if you have code rush is worst(devexp sorry to say this).License
Davut...how big is your app (number of proj and files?)License
L
2

Yes, I have simmilar issue. when I clear My Temp Memory It works fine but after some time Temp directory is also showing some file.

and again the message comes "Out of Memory Exception".

It is an issue in Code. Your code is leaking memory. your code is not disposing object properly.

Leffler answered 5/7, 2012 at 12:47 Comment(2)
Nitin, >>Issue in code? <<what code ? could you explain. error is at compile time.License
I was under impression that Silverlight runs under CLR. So CLR should take care of leaking memory.Altheta
R
0

I haven't had that type of error message, but the thing that always seems to slow down VS 2010 for me is the .suo (Solution User Options) file. It basically keeps track of what files you have open, and your break points, but it is an always growing file. When it get's up to 5mb, it can take 20-30 seconds for VS to respond at times when adding a file, or deleting one from the solution.

Ratel answered 30/10, 2011 at 2:18 Comment(0)
F
0

I got tired very quickly of visual studio's slowness. My solution was to build everything on the command line using msbuild. I created a batch file which calls msbuild with my preferred options.

This option is actually really nice, because if you have a multi-core machine, you can pass the /m flag to msbuild, which will allow the build projects in parallel when possible (Visual Studio currently doesn't offer this functionality, but will in VS2012)

Calling msbuild is easy. For example:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe MyApplication.sln /m

Then, if I want to debug, I just build first (on the command line), run the app, and attach the visual studio debugger manually.

Freida answered 29/2, 2012 at 16:8 Comment(0)
S
0

I'm not familiar with this error in particular, but had an nasty issue back then with OutOfMemoryException during compile time for a big solution (more than 50 projects)

We used to circumvent it by using msbuild directly but debugging was a bit cumbersome

I checked on internet then and tried to extend the virtual memory that devenv.exe was using (by default it's 2GB). Being on a 64bit Windows 7, the OS was already complying with the fact that an application could use more than 2GB.

Just had to fire up a command prompt and type :

cd\
cd "C:\Program Files (x86)\Microsoft Visual Studio 10.0"
copy Common7\IDE\devenv.exe Common7\IDE\_devenv.exe
VC\bin\editbin.exe /LARGEADDRESSAW Common7\IDE\devenv.exe

After a reboot, the compilation Exception was just a mere dream.

Note : I read afterward that Visual Studio 2010 was supposed to be Large Address Aware out of the box, so it shouldn't have "solved" my issue, but it did for me.

Shoplifter answered 3/3, 2012 at 14:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.