I experienced this while I was developing my application in Visual Studio.
It happened for no apparent reason (I didn't remember to make any signifficant changes in this application).
It was really frustrating. The thought that I may need to rething the whole application was a nightmare.
I was in panic and started to think what the problem for this sudden degradation might be.
And guess what?
It appeared to be because of a conditional breakpoint I have set in one of the complex modules.
The program flow was passing through this line of code hundreds of thousand of times so Visual Studio was kind of slow determining if the condition for the breakpoint is true or not.
So remember this for the rest of your life:
"Conditional breakpoints may slow your application considerably, before doing stupid things in case of sudden performance degradation - be sure to remove your breakpoints first (Debug Menu => Disable All Break Points), then check the performance again.".
All the stuff that bothers software developer in his everyday tasks.
Showing posts with label Visual Studio Add-Ins. Show all posts
Showing posts with label Visual Studio Add-Ins. Show all posts
Jul 14, 2011
Jun 28, 2011
Visual Studio AddIn - never put dots in a command.
I was following an article on how to create a command and add it to the Code Window context menu, it was going really well until some point.
I ran the code and Visual Studio was crying with E_INVALID_ARGS error on the
this._applicationObject.DTE.Commands.AddNamedCommand
This one is widelly used and pretty standard method so I thought the problem is somewhere in my code.
I realized that almost all the parameters I am passing to this method are pretty common as well so the problem must be at ....
Well, the command name I used was containing dots, that's why the error.
If you receive this message, please check the command name for dots (the second parameter you are passing to this method).
Since Visual Studio and other addin types seem to be working with very similar framework (the so called "extensibillity framework"), I suspect this rule is also applicable for other types of addins such as Outlook, Excel, Word, etc.
I ran the code and Visual Studio was crying with E_INVALID_ARGS error on the
this._applicationObject.DTE.Commands.AddNamedCommand
This one is widelly used and pretty standard method so I thought the problem is somewhere in my code.
I realized that almost all the parameters I am passing to this method are pretty common as well so the problem must be at ....
Well, the command name I used was containing dots, that's why the error.
If you receive this message, please check the command name for dots (the second parameter you are passing to this method).
Since Visual Studio and other addin types seem to be working with very similar framework (the so called "extensibillity framework"), I suspect this rule is also applicable for other types of addins such as Outlook, Excel, Word, etc.
Етикети:
C#,
COM,
Visual Studio,
Visual Studio Add-Ins
Subscribe to:
Posts (Atom)