Visual Studio 2008 designers screw up on large VB projects - vb.net

We have 3 developers all using the same version (VS 2008 SP1) and we all use large VB projects (windows forms). From time to time, the IDE will have all sorts of issues such as locking up, crashing, and even not being able to drag a form object around or it will just instantly disappear.
On the largest of our projects (which is actually 5 projects in one solution file), a couple people here can only rebuild the project for testing 2 - 3 times before they have to close the studio and reopen it.
Has anyone else experienced this? Does this happen with large C# projects?

Yes, I experience this all the time! It has gotten better in 2008, if you can believe it.
I usually find that the reason has to do with an exception in my own code. The UI might bring in a custom control that does not behave well in design mode, causing the problem.
Sometimes, I will bring up a second execution of VS2008 and attach the debugger to the first execution of VS. Then, I can debug my own code as it is being run in the designer of the first instance. Often, an exception is thrown and I can fix my code to play better in the designer.
In other circumstances, I have no idea why it happens.

I have heard of people having this issue, however, I have never had an issue at all myself.
I have heard that a number of people trace the issues back to the use of ReSharper as the primary cause.

The most common problem I've had that causes the designer to crash is when I create a form where the only constructors require parameters.
To alleviate that, when I need the form only to be instantiated with parameters, I create a private parameterless constructor that the designer can use but which the form's consumers won't see.

I have personally experienced all sorts of designer wickedness with VS2008 sp1. I uninstalled the service pack to return stability to my dev environment. This is an unfortunate answer, but give it a try.

Only thing I've had close to this is the design view crashing and bringing up an error, formerly causing me to have to recreate the form and copy and paste the code across until I learnt how to fix it.
My problem was occurring because of me using ctrl+f a lot though. If you are using big files, this might be what's happening.

Related

Slow XAMLX Designer - Visual Studio 2013 -Workflow Foundation

The VS2013 XAMLX designer is very slow with medium sized xaml workflows.
About 10 to 40 seconds for each small change we make.
We don't want to disable the designer and work in xaml directly.
This is what we have done and tried so far (without success)
Disable Resharper
SSD Drive to speed up I.O.
Make sure the machine has enough memory and cpu...
Has anyone got more ideas on how to speed this up?
UPDATE (23-11)
This is a little convoluted, though it might shed some light.
I installed VS2015, which made a huge difference, though the workflows wouldnt work in IIS. The problem was due to a windows update which caused an error. Check this link https://support.microsoft.com/en-us/kb/3118750
I was getting errors like this:
FileLoadException: A procedure imported by 'Microsoft.VisualBasic.Activities.Compiler.dll' could not be loaded
So, I am guessing that validation was turned off while the compiler had issues.
It seems like VS2010 had a setting to turn off validation, though I cant find how to do that in 2013
Does this help at all, can anyone suggest a solution?

SqlClient.SqlDataAdapter.Update() Performs Very Slowly

I am porting VB.Net 2 code (VS 2005) to VB.Net 4 (VS 2010). So far things have been going relatively smooth. However, in testing my new ported code, I came across a strange behavior.
In VS 2005 (.Net 2), I have a DataTable filled with data. I then use a DataAdapter to send updates back to the SQL Server. When I perform the SqlClient.SqlDataAdapter.Update() command, it execute in roughly 4 seconds. The same code, on the same table in VS 2010 (.Net 4) runs in 1 Minute 17 Seconds. This is completely unacceptable. However, I have no clue as to why it is happening. The .Update() method is an internal command, not one that I modified in any way. It does not error out, it's just painfully slow.
Anyone have any ideas?
After many months of working directly with Microsoft...a solution/answer was found.
I don't feel so bad because it took six different Microsoft programmers and almost six months of time to discover the answer. Apparently, Visual Studio 2010's IDE behaves significantly different than it's Visual Studio 2005 counterpart. When running an application in the IDE, VS2010's hook into the running executable actually hinders the applications performance considerably. There is a hidden option (not found in the menu structure) to run the application without the debugger attached. The hotkey is CTRL+F5. When the application is run in this mode, our performance issue vanished. It's such a silly and simple answer...but the two things that make me feel better is that VS2005 did not have this issue, the "run w/o debugger" options isn't listed in the menu at all, and it took six Microsoft programmers to determine this was the issue.
So for anyone else that seems to have this same issue...try CTRL+F5. :-)

Visual Studio Conversion Wizard: Why put it in if it is broken? Whats the point?

I have tried converting many projects from vb.net 2005 to vb.net 2008, and not a single one has ever made it. Why do you think they even bothered to include this tool if it is very clearly broken? I mean, it can convert some code okay, but I can never load Design view properly, and it'll almost never compile without error.
Whats the point in putting in a broken tool? I thought Microsoft products were always backwards-compatible? Do they have any requirements before running the wizard?
Generally projects won't compile because the compiler/language/environment has changed, not because there's anything wrong with the project files.
I typically use vspc to convert project files, but I'm usually converting them from vs2008 to vs2003, which Visual Studio cannot do.
I've never had any trouble with the conversion wizard, but I mostly use C#.
What specific errors do you get?
Also, do you mean from VB6? If so, here's the answer:
VB6 and VB .Net (any version) are quite different. The VB Upgrade Wizard will try to convert what it can, and show you exactly what still needs work.
If the conversion tool is actually broken (I've had mixed success using it in the past, with the success rate being inversely proportional to the overall complexity of the project), then one reason to include it anyway is to convince developers to start new projects using the latest version of Visual Studio, and not to start them with an older version and hope that the upgrade process will be seamless.
I'm not saying this is why Microsoft would include a broken conversion wizard, but you never know. If you'd like me to delete this answer, Mr. Ballmer, just let me know.

Telerik RadControls + JetBrains Resharper = VERY SLOW, Can anyone help?

Anyone know of a way to speed up the Visual Studio IDE when you have Telerik RadControls (either windows or web) and JetBrains ReSharper installed? If I disable ReSharper it runs rocking fast, but I love ReSharper a bit too much to drop it. I know it would perform better without the RadControls. Anyone know a way to speed it up?
I switched from DevExpress CodeRush/Refactor! to Resharper (not by choice) and found the IDE became almost unusable. I managed to persuade my boss to let me switch back (on my own personal licence) and now it's like walking back into the sunshine after months in a cold, damp cave.
I guess what I'm trying to say is that maybe you should consider switching to CodeRush and Refactor!
for me this is the same.
I'm Working with a Dell XPS 4gb Ram Quad Core Extreme Stripped disks...
And I also had that problem with telerik controls (mainly aspx - winform not so much).
Anyhow - I had to do a project using a different suite of web controls - and it was as bad as with telerik - or even worse...
What I found (maybe it helps a bit):
a.) Switching to design view slows down the things a lot
--so after doing this I restart VS
b.) Small Solutions (Projects) help also (like mika wrote) --if possible split your solution to several projects (some class libs instead of one big thing)
c.) Use as litte VS addins as possible --I used some nice tools - but at the moment most of them are turned of, because I made the expirience that the things are better the less addins I use.
d.) Run special "resharping sessions" -- what I mean is: turn resharper off, do you normal coding - and from time to time turn it on and "resharp" your code.
This problem (as well as some others) is well knwon (I guess) and I would say that neither resharper (although this tool seems to be somewhat special) nor telerik are gulty.
It is VS which makes the problems - and I did a lot of searches about solutions - but finally I found nothing which really helps.
Notice: I work on a pretty large project at the moment - and the use of respharper is almost impossible. I turned it off - instead I have a lot of nice snippets and macros which help me to do some of the common things.
Conclusion: if telerik + reshaper is to slow for you I guess you have to decide which helps you more :)
I use the telerik controls (ASPX, WPF and Silverlight) in almost every project I make. These tools fasten the things so much - I simply "need them to survive"
This is not much help, but at least the issue is not on your machine only...
Try to work with small solutions. In my machine this means solutions with less than 100k lines of code. Background compilation makes IDE sluggish with large solutions. VB has background compilation on by default, and even without add-ins it gets slower as the solution size grows.
I haven't been able to use ReSharper or CodeRush/Refactor! with VB & RadControls with over 100k line solutions, things just slow down too much. I'm using a Core 2 Duo, 2.4GHz, 4GB machine.
See also: Visual Studio performance and add-ins
Taken from Telerik`s forums:
We are incompatible with JetBrains Resharper indeed. We are competing for the same Visual Studio resources which could potentially create a ton of trouble if you run both of the add-ins together. I doubt that anybody managed to run them together but if you know somebody that did that I'd be really interested in all the details.
So you have to disable Resharper to check out on JustCode. You could always re-enable it later, however, as long as one of them is disabled they coexist happily.
Kind regards,
Tsviatko
the Telerik team
And I am pretty sure you will be way better using only JustCode

What can cause Visual Studio 2008 to hang while debugging?

I have a vb.net project which sometimes, when running in the IDE, suddenly hangs. Normally this wouldn't be a problem. Just hit 'pause', look at the currently running threads, and find the deadlock (or whatever else).
But now I'm running into a situation where not only does the program hang, but trying to pause it causes visual studio itself to hang. In order to get control back, I have to kill the program-being-debugged's process, at which point visual studio comes back to life and says it was unable to pause execution. This is frustrating, because killing the process means the program state is lost (of course), so I don't know where the hang is.
So are there any common causes for this behavior? What should I be looking for?
if your program installs global hooks (which communicate with app) - this might be the case. A hook tries to communicate with your app (which is paused by debugger) and gets locked. And debugger is unable to receive its window messages: classic deadlock between hooked debugger (with hook dll) and a hooking app.
Finding a specific fix for a Visual Studio problem can be tricky: http://social.msdn.microsoft.com/Search/en-US/?query=visual%20studio%202008%20hang&ac=3
Additionally, not all hotfixes from Microsoft get released directly to the public. Some are only given out to customers whose systems are exhibiting a specific problem. So you have to contact Microsoft to the get the fix. They do this to limit the potential downside of releasing a hotfix that may break something else. So if all else fails, give them a call.
Here are some other things that I like to do when Visual Studio starts acting up:
Delete old breakpoints and watch variables.
With visual studio not running, delete the intellisense file (.ncb)
Clean the solution and then do a rebuild of all of the code.
Check hotfixes and service packs. I've seen a bug related to .net programming and debugging hangs. (VS hangs for me when debugging C++ 32-bit apps on 64-bit os:es sometimes.)
I just had a very similiar issue (VS fails to break execution), using Debug -> Delete all breakpoints solved the issue.
I'd check the code of the program being debugged, I'm thinking there may be an infinite loop or race condition in the code you're trying to debug. This has been the case for me in the past, especially on a single-core laptop I used to have. Can you give any information about where in the program you think execution is when you try to pause?