The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Visual Studio and tools’ Category

Solution for TFS2005/2010 and VS2005/2010: Add/New Work Item menu still loading (try again in a moment)…

Posted by jpluimers on 2012/03/13

Sometimes when creating new Team work items in Visual Studio 2010 connected to Team Foundation System 2010, you get a sub menu like this:

New Work Item menu still loading... (try again in a moment)

“New Work Item menu still loading… (try again in a moment)”

There are not many results in the new work item menu still loading “try again in a moment” site:microsoft.com query, but luckily the first one shows a similar issue in Visual Studio 2005 with Team Foundation System 2005: the “Add Work Item menu still loading… (try again in a moment)”.

The solution is also very simple:

  1. Quit Visual Studio 2010
  2. Delete this registry key
    HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\WorkItemTracking\TeamMenu\AddWorkItemMru
  3. Start Visual Studio 2010
  4. Retry (can take more than a minute, but it usually works)
The only difference between the Visual Studio 2010 (version 10.0) and Visual Studio 2005 (version 8.0) is the version number:
  • HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\WorkItemTracking\TeamMenu\AddWorkItemMru

Not sure if this can fail in Visual Studio 2008 too, but if it does, just apply this fix with version number to 9.0, and if it happens with the Visual Studio 11 developer preview, change the version number to 11.0.

–jeroen

via: Add Work Item menu still loading….

Posted in .NET, Development, Software Development, Visual Studio 2005, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

“Cannot navigate to definition” annoyance in Visual Studio 2010 – (did it implement the mouse equivalent to Delphi code browsing? No, it didn’t)

Posted by jpluimers on 2012/03/08

This use case drove me nuts in Visual Studio 2010 for a while, but can be solved.

Use cases:

  1. Cannot navigate to definition.double click on a word to select it
  2. press Ctrl-C to copy the selected text
  3. result is either of these two dialogs:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Cannot navigate to definition.
    ---------------------------
    OK
    ---------------------------

    Cannot navigate to definition. The cursor is not on a symbol.or

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    Cannot navigate to definition. The cursor is not on a symbol.
    ---------------------------
    OK
    ---------------------------

The reason is that Visual Studio 2010 still thinks I am clicking the identifier (which I’m not, I just released the mouse button) while pressing the Ctrl key. Read the rest of this entry »

Posted in .NET, Delphi, Development, Keyboards and Keyboard Shortcuts, Power User, Software Development, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Windows 8 Consumer Preview ISO formats: Microsoft, please do this the same for Visual Studio 11 (#VS11 #W8)

Posted by jpluimers on 2012/03/02

Hopefully they will add Visual Studio 2011 ISOs (no, not the current ones that still download the prerequisites in the background) like they did with the Windows 8 Consumer Preview ISOs:

English

64-bit (x64) Download (3.3 GB) Sha 1 hash — 1288519C5035BCAC83CBFA23A33038CCF5522749
32-bit (x86) Download (2.5 GB) Sha 1 hash — E91ED665B01A46F4344C36D9D88C8BF78E9A1B39
Product Key DNJXJ-7XBW8-2378T-X22TX-BKG7J

–jeroen

via: Windows 8 Consumer Preview ISO formats.

Posted in .NET, Development, Power User, Software Development, Visual Studio 11, Visual Studio and tools, Windows, Windows 8 | 2 Comments »

.NET/C#: Using IDisposable to restore temporary settrings example: TemporaryCursor class

Posted by jpluimers on 2012/01/26

This is WinForms code from a long time ago, but the concept of using an IDisposable interface to do resource cleanup and restore a temporary setting is very valid.

You use the code below like this:

        private void myMethod()
        {
            // set busy cursor
            using (IDisposable waitCursor = new TemporaryCursor(this, System.Windows.Forms.Cursors.WaitCursor))
            {
                // logic that takes a long while
            }
        }

The code below implements the TemporaryCursor class; you can assign any System.Windows.Forms.Cursors item you want.

It restores the cursor upon these three “events”:

Most often the IDispose pattern is being used to make sure that resources get cleaned up. If you think of a wait cursor as a temporary resource, this example becomes much easier to remember.

Of course this is not limited to the System.Windows.Forms realm, you can just as well use this for non-visual temporaries, and other kinds of UIs like ASP.NET, WPF or SilverLight.

using System.Windows.Forms;

namespace bo.Windows.Forms
{
    public class TemporaryCursor : IDisposable
    {
        private Control targetControl;
        private Cursor savedCursor;
        private Cursor temporaryCursor;
        private bool disposed = false;

        public TemporaryCursor(Control targetControl, Cursor temporaryCursor)
        {
            if (null == targetControl)
                throw new ArgumentNullException("targetControl");
            if (null == temporaryCursor)
                throw new ArgumentNullException("temporaryCursor");
            this.targetControl = targetControl;
            this.temporaryCursor = temporaryCursor;
            savedCursor = targetControl.Cursor;
            targetControl.Cursor = temporaryCursor;
            targetControl.HandleDestroyed += new EventHandler(targetControl_HandleDestroyed);
        }

        void targetControl_HandleDestroyed(object sender, EventArgs e)
        {
            if (null != targetControl)
                if (!targetControl.RecreatingHandle)
                    targetControl = null;
        }

        // public so you can call it on the class instance as well as through IDisposable
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (null != targetControl)
                {
                    targetControl.HandleDestroyed -= new EventHandler(targetControl_HandleDestroyed);
                    if (temporaryCursor == targetControl.Cursor)
                        targetControl.Cursor = savedCursor;
                    targetControl = null;
                }
                disposed = true;
            }
        }

        // Finalizer
        ~TemporaryCursor()
        {
            Dispose(false);
        }
    }
}

–jeroen

Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, Software Development, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, WinForms | 4 Comments »

Upgrading a Windows XP machine with Visual Studio 2005: KB2251481 Security Update for Microsoft Visual Studio 2005 Service – Microsoft Answers

Posted by jpluimers on 2012/01/24

Every once in a while you need to maintain really old stuff, and start update an old VM.

In case of Visual Studio 2005, the Windows Update and Microsoft Update will get you into a condition where it cannot install “Security Update for Microsoft Visual Studio 2005 Service Pack 1 XML Editor (KB2251481)“. Not even the direct download will install.

The search for “some updates were not installed” “Security Update for Microsoft Visual Studio 2005 Service Pack 1 XML Editor (KB2251481)” pointed me to the solution:

There are two versions of KB2251481 June and August. When the June version is installed, the August version refuses to install.

Uninstall the original KB2251481 from the Control Panel. Then reinstall the August version.

The KB2251481 article mentions this only for the “Microsoft Visual Studio 2005 Premier Partner Edition SP1”, but it happens with other Visual Studio 2005 editions as well.

–jeroen

via: KB2251481 Security Update for Microsoft Visual Studio 2005 Service – Microsoft Answers.

Posted in .NET, Development, Software Development, Visual Studio 2005, Visual Studio and tools | 1 Comment »

More vulnerabilities solved than just the ASP.NET hash collision DoS: Microsoft Security Bulletin MS11-100 – Critical : Vulnerabilities in .NET Framework Could Allow Elevation of Privilege (2638420)

Posted by jpluimers on 2011/12/29

In addition to the ASP.NET hash collision Denial of Service attack, Microsoft patches 3 more vulnerabilities resulting in an Aggregate Severity Rating that is Critical.

This is a summary of the vulnerabilities. Please read the full MS11-100 bulletin for more details and how to download and install the patches.

Vulnerability Severity Rating Maximum Security Impact Affected Software CVE ID
Important Denial of Service Collisions in HashTable May Cause DoS Vulnerability CVE-2011-3414
N/A or Moderate N/A or Spoofing Insecure Redirect in .NET Form Authentication Vulnerability CVE-2011-3415
Critical Elevation of Privilege ASP.Net Forms Authentication Bypass Vulnerability CVE-2011-3416
Important Elevation of Privilege ASP.NET Forms Authentication Ticket Caching Vulnerability CVE-2011-3417

The CVE-2011-3415 is N/A in .NET 1.1, and Moderate in all other .NET versions.

–jeroen

via Microsoft Security Bulletin MS11-100 – Critical : Vulnerabilities in .NET Framework Could Allow Elevation of Privilege (2638420).

Posted in .NET, ASP.NET, C#, Development, Software Development, VB.NET, Visual Studio and tools | Tagged: , , , , , | Leave a Comment »

Added a few links to my “Tools” page, @WordPress bug spuriously inserting div tags still present.

Posted by jpluimers on 2011/12/28

While re-designing a Visual Studio 2010 plus Delphi XE2 install for a specific client, I updated some of my Tools page links:

And found out that the WordPress still wrongly inserts div tags when you step out a list by pressing Enter twice is still present. Annoying, as it has been there for at least 2 years, so I’m still interesting in people having a workaround for it.

–jeroen

Posted in .NET, C#, Delphi, Development, Software Development, TFS (Team Foundation System), Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | 1 Comment »

WinForms UserControl and Visual Studio 2010 debugging – The process cannot access the file … because it is being used by another process – Stack Overflow

Posted by jpluimers on 2011/12/13

When doing WinForms development in Visual Studio 2010 (including SP1), be aware of a bug with UserControls that hamper debugging; sometimes you get an error like this:

Error 9 Unable to copy file "obj\x86\Debug\MyProject.exe" to "bin\Debug\MyProject.exe". The process cannot access the file 'bin\Debug\MyProject.exe' because it is being used by another process.

When using SysInternals’ Process Explorer to see which process has handles open to MyProject, you will see that devenv.exe (The Visual Studio IDE) is the culprit: sometimes it has a lot of handles open.

The workaround is simple: close all UserControls before debugging your WinForms application.

A real pity, as UserControls are a very useful feature when developing software (many platforms use the same paradigm, .NET certainly wasn’t the first to introduce it, and it is available in for instance WPF as well).

Note that there are other causes of the same error message, but for me this was the issue.

–jeroen

Via: visual studio 2010 – VisualStudio2010 Debugging – The process cannot access the file … because it is being used by another process – Stack Overflow.

Posted in .NET, C#, Development, Software Development, VB.NET, Visual Studio 2010, Visual Studio and tools | 2 Comments »

Cleanup: IntelliTrace Log ( .iTrace ) files and Visual Studio 2010 SP 1

Posted by jpluimers on 2011/09/08

While cleaning up my system, I found a while bunch of .iTrace files in “C:\Documents and Settings\All Users\Application Data\Microsoft Visual Studio\10.0\TraceDebugging” on a Windows XP system at a client that yet has to upgrade to newer Windows versions that store them under “C:\Users\All Users\Microsoft Visual Studio\10.0\TraceDebugging”.

Contrary to what IntelliTrace iTrace files and IntelliTrace Log ( .iTrace ) files and Visual Studio 2010 SP 1– Some Hidden Stuff « Abhijit’s World of .NET explains, these files are not always automatically removed.

And they are big, since Visual Studio 2010 Ultimate will automatically generate them.

So it is important to once in a while cleanup the “C:\Documents and Settings\All Users\Application Data\Microsoft Visual Studio\10.0\TraceDebugging” directory manually.

–jeroen

Posted in .NET, Development, Software Development, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Visual Studio 2010/2008/2005 – how can i check who has a specific file checked out in tfs? (via: Stack Overflow)

Posted by jpluimers on 2011/05/26

When you are using Team Foundation System (TFS) for version control, the project manager sometimes shows a file as being checked out by someone else, but it doesn’t show who that someone else is.

The reason is that the Project Manager only has generic knowledge about version control systems. However, the Source Control Explorer has specific knowledge about TFS.

So when you look in the Properties Window for the path of the file you are interested in, then you can use the Source Control Explorer to locate the file, and find out who has checked out that file.

There are other tools that can even give your more information than the Source Control Explorer:

  • the TF command-line application (on your PATH when you start the Visual Studio Command Prompt shortcut) to obtain extra information.
  • the Team Foundation Sidekicks (free; version 3.0 is for Team Foundation Server 2010; 2.4 is for Team Foundation Server 2008/2005) even produce most of that info from a GUI.
These two Stack Overflow questions were relevant in answering the above:

Posted in .NET, Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »