Uncategorized

Visual Studio 2008 crashes in “split view”

“Split view” is one of the new features in Visual Studio 2008 web designer: this is the possibility to have Design View and Source View of your page at the same time (see What’s New in ASP.NET and Web Development, “Visual Web Developer Enhancements” paragraph). A few days ago a customer called in to report a problem with his Visual Studio and split view: when trying to view a file (even a new one) in split view or design view the IDE either crashed or frozen.

As you can imagine we took a crash dump with adplus, but a first look at the threads, stack, exceptions etc… (the usual stuff) did not show anything interesting. Then I thought to some external process (like an antivirus, third parties add-ons etc…) that might meddle in and had a look at the list of modules loaded within the process with lmf (list loaded modules with full path). There where only a couple of odd dlls loaded, from Office 2003:

33f20000 34118000   FPCUTL     (deferred)             
    Image path: C:\Program Files\Microsoft Office\OFFICE11\FPCUTL.DLL 
    Image name: FPCUTL.DLL 
    Timestamp:        Wed Jun 06 19:44:55 2007 (4666F297) 
    CheckSum:         001EC356 
    ImageSize:        001F8000 
    File version:     11.0.8170.0 
    Product version:  11.0.8170.0 
    File flags:       0 (Mask 3F) 
    File OS:          40004 NT Win32 
    File type:        2.0 Dll 
    File date:        00000000.00000000 
    Translations:     0409.04e4 
    CompanyName:      Microsoft Corporation 
    ProductName:      Microsoft Office 2003 
    InternalName:     FP40CUTL 
    OriginalFilename: FP40CUTL.DLL 
    ProductVersion:   11.0.8170 
    FileVersion:      11.0.8170 
    FileDescription:  Microsoft Office FrontPage Client Utility Library 
    LegalCopyright:   Copyright © 1995-2003 Microsoft Corporation.  All rights reserved. 


37050000 37157000   OMFC       (deferred)             
    Image path: C:\Program Files\Microsoft Office\OFFICE11\OMFC.DLL 
    Image name: OMFC.DLL 
    Timestamp:        Fri Apr 13 21:43:21 2007 (461FDD59) 
    CheckSum:         0010A869 
    ImageSize:        00107000 
    File version:     11.0.8164.0 
    Product version:  11.0.8164.0 
    File flags:       0 (Mask 3F) 
    File OS:          40004 NT Win32 
    File type:        2.0 Dll 
    File date:        00000000.00000000 
    Translations:     0000.04e4 
    CompanyName:      Microsoft Corporation 
    ProductName:      Microsoft Office 2003 
    InternalName:     OMFC.DLL 
    OriginalFilename: OMFC.DLL 
    ProductVersion:   11.0.8164 
    FileVersion:      11.0.8164 
    FileDescription:  Microsoft Office MFC 
    LegalCopyright:   Copyright © 1993-2003 Microsoft Corporation.  All rights reserved.

That rang a bell, especially about fpcutl.dll… This dll comes with both Visual Studio and Office 2003 but the two versions are incompatible: Visual Studio in this case was loading the wrong one. Why?

Well, it happens that Visual Studio looks at the system PATH to load this (and other) component, while Office doesn’t… Here is the PATH value from the dump (use !procinfo and then check the path value):

C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;
C:\PROGRA~1\MICROS~2\OFFICE11

The Office 11 entry is the last one… but there is something wrong anyway, who spots it? ?

We have an entry for Visual Studio 8 (Visual Studio 2005), but where is the entry for Visual Studio 9 (VS 2008)? ?

For some reason the PATH value has not been updated (or maybe it has modified after the setup) and we don’t know exactly why; the point is that we need to fix it. A quick search on the machine found three copies of fpcutl.dll:

fpcutl.dll
fpcutl.dll
path environment variable
path environment variable

We added the missing folders at the beginning of the PATH string which now reads as:

C:\Program Files\Microsoft Web Designer Tools\VWD;
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;
C:\Windows\Microsoft.NET\Framework\v3.5;
C:\Windows\Microsoft.NET\Framework\v2.0.50727;
C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\Program Files\Microsoft SQL Server\90\Tools\binn\;
C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;
C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;
C:\PROGRA~1\MICROS~2\OFFICE11

The most important one on this case is “C:\Program Files\Microsoft Web Designer Tools\VWD”: Visual Studio will look into this folder to load the right version of fpcutl.dll (PATH is a first in – first serve list of folders, the first match will be the one we use) and Office continues working happily anyway. ?

Carlo

Quote of the day:

Any sufficiently advanced technology is indistinguishable from magic. – Arthur C. Clarke

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.