Archive

Archive for the ‘visual studio 2005’ Category

Solution: The operation could not be completed. Invalid FORMATETC structure

July 2nd, 2009 No comments

This morning I ran into a ASP.NET bug in Visual Studio. Dragging a custom server control on an aspx file was not possible since I had ‘an invalid FORMATETC structure’ (what the …. is that?!). The message box alerting me something is really really wrong is this one:

The FORMATETC bug

Trying to solve the bug, I  found the following attribute to be the problem: [ToolboxItem(true)]. Just delete the attribute, rebuild the application and the problem/bug disappears!

Good luck! Happy coding!

How to detect installed CLR versions and how they are used…

June 2nd, 2009 1 comment

It has been a while since I posted anything on my blog. Sorry for keeping you on hold ;) ! I think the blog will be filled with some information shortly, since I am still overthinking all the great stuff I saw on Tech-Ed North America a couple of weeks ago (first I had to overcome the jetlag, then the weather in The Netherlands, etc. etc. :) ). Enough nonsense for now!

While attending a session by Scott Hanselman on everything new in .NET 4.0 he showed a wonderful small tip, not only useful for the few of us already working on Visual Studio 2010: when working in the VS.NET Command Prompt, there is a small but useful command called ‘CLRVER’. It shows all .NET versions installed on your computer. Also, as an addition to this command, you can show active runtime processes using the -all switch. Nice piece of code! Enjoy!

Delete workspace from no longer existing TFS

March 27th, 2009 No comments

A week ago I started to use a new TFS server (TFS 2008). The old TFS server got phased out yesterday after moving all sources to the new TFS server. Doesn’t sound like a problem, does it? However, I forgot to remember my laptop: my old workspace was still in there, but to delete a workspace the normal way the TFS server should be available. At itself, this is still not much of a problem, however: when you would like to map your new source control folders to the old ones on disk, this is not possible since the old workspace is still mapped to that location. Arghhh!!!

Luckily, there is a tf.exe command tool switch (discussed a few minutes ago in my previous blog post) to cope with this problem: use ‘tf workspaces /remove:*’ and all cached workspaces will be gone! Problem solved!

Visual Studio 2005 and the vaporized Immediate Window

December 19th, 2008 No comments
Today I reinstalled my development virtual machine. For a couple of ‘legacy’ software packages I must have Visual Studio 2005 installed as well. Debugging one of those software packages mentioned above, I wanted to ‘hack my runtime’ using the Immediate Window. It wasn’t there!
Since I always have the Immediate Window activated, I cannot remember the shortcut for it (Ctrl+Alt+I :) ). Looking for the menu item to activate it (yes, of course, in the Debug menu) it appeared to be gone. Sadly this is a known bug. The only way to get it back into the menu is using the Tools menu, click Customize, select the Commands tab, choose for Debug commands and drag Immediate onto the toolbar.
For some kind of overview:
Visual Studio 2005 and the vaporized Immediate Window The disappeared immediate window
I simply assume nobody likes it either :)

Search and replace with Regular Expressions in Visual Studio .NET (2005)

March 10th, 2006 No comments

Today I had to search and replace a text with a little variation in it in a very large project. This text looked like ‘if<zero or more spaces>(Null.IsNull(<object name>.<variable name>))’. I had to replace it with: ‘if (!<object name>.<variable name> > 0))’. This turns out to be quite a job, especially when you are not very experienced with Microsoft’s way of dealing with regular expressions. Finally I discovered a way to do the job. The expressions used for it are the following:

Search string: if[ ]*\(Null.IsNull\({:c+.:c+}\)\)
Replacement string: if (!(\1 > 0))

Note that the Regular Expression used to search does not entirely look likea normal RegEx. Microsoft seems to use their own kind of RegEx for search and replace. Important is that {} is not used to quantify like in RegEx (for instance: zo{1} matches ‘zo’ but not ‘zoo’), but to generate a tagged expression, which can be used in the replacement string by giving in \x whereby x represents a 1-base number (1st replacement = \1 and so on).

Hope I have been of some help for anybody out there :) . Please do not be concerned about posting a comment/question. I’ll do what I can to answer you soon!

Bert