Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Using MsiBreak to gather debugging information for .NET Framework setup failures

Using MsiBreak to gather debugging information for .NET Framework setup failures

Rate This
  • Comments 26

I have been working on the .NET Framework setup since before v1.0 shipped, and in that time I've seen all sorts of bugs and setup failures.  There is one particularly tricky set of bugs that all show the same symptom but that we haven't been able to track down a common root cause for.  The error that is seen during setup is a failure to register System.EnterpriseServices.dll or a problem running RegSvcs.exe /bootstrapi, which then causes setup to stop and rollback.

Almost none of the cases I have seen where this error appears were actually caused by the file System.EnterpriseServices.dll itself.  It is a bit misleading because the registration of this file is done by a custom action during setup, and that custom action is the first time that the version of the CLR we are trying to install is used to run managed code on the computer.  So that means that if anything is wrong on the machine to cause that version of the CLR to not work properly, the error the user sees is that this DLL failed to register.

When we encounter an error like this, we typically try the following cleanup and troubleshooting steps in the order listed below.

  1. Download the .NET Framework 1.0 and 1.1 cleanup tool and run it
  2. Verify that the data in the Locale registry value located at HKEY_USERS\.Default\Control Panel\International is valid.  The Locale value should contain one of the values listed at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Nls\LocaleMapIDs
  3. Get a crash dump with Windbg on the custom action that registers System.EnterpriseServices.dll

In many cases, running the cleanup tool is sufficient, but every once in a while we run into a computer in a state that we can't diagnose and we have to try some more advanced debugging techniques like those listed in steps 2 and 3.

We use the following steps to configure the MsiBreak environment variable to cause .NET Framework setup to pause at the beginning of the custom action that registers System.EnterpriseServices.dll, attach a debugger and gather crash dump information:

  1. Download and install the Debugging Tools for Windows
  2. Right-click My Computer, and then click Properties.
  3. On the Advanced tab, click Environment Variables, and then under System Variables, click New.
    Note: You must add MsiBreak to the list of System Variables (and not to the list of User Variables).
  4. In the Variable Name field, enter "MsiBreak" (without the quotation marks).
  5. In the Variable Value field, enter the name of custom action you want to break on.  The name must match the name listed in the Action column of the CustomAction table of the MSI:
    For .NET Framework 1.0 or 1.1 setup: CA_ComregEnterpriseServices.3643236F_FC70_11D3_A536_0090278A1BB8
    For .NET Framework 2.0 setup: DD_CA_ComregEnterpriseServices_X86.3643236F_FC70_11D3_A536_0090278A1BB8
  6. Run .NET Framework setup and start installing
  7. During installation, a break message will appear stating "To debug your custom action, attach your debugger to process XXX (0xZZZ) and press OK".  Open WinDBG instead of following the instructions on the dialog that pops up.  If you are running on Windows Vista, you will need to launch WinDBG with elevated privileges.  To do that, right-click on WinDBG.exe and choose Run as administrator.
  8. From the File menu, choose Open Executable...
  9. In the File name text box, enter the following information:
    For .NET Framework 1.0 setup: %windir%\Microsoft.NET\Framework\v1.0.3705\regasm.exe
    For .NET Framework 1.1 setup: %windir%\Microsoft.NET\Framework\v1.1.4322\regsvcs.exe
    For .NET Framework 2.0 setup: %windir%\Microsoft.NET\Framework\v2.0.50215\regsvcs.exe (or change the build number depending on what build of .NET Framework 2.0 is being installed)
  10. In the Arguments text box, enter the following information:
    For .NET Framework 1.0 setup: %windir%\Microsoft.NET\Framework\v1.0.3705\System.EnterpriseServices.dll
    For .NET Framework 1.1 or 2.0 setup: /bootstrapi
  11. After entering the above information, choose Yes to save base workspace information
  12. Press g in the Windbg window to resume execution until the process crashes, then save the crash log to a file

Variations of the above steps can also be used to gather debugging information for any custom action that fails during an MSI-based setup as long as you are able to consistently reproduce the crash during setup.  You just need to substitute the appropriate custom action name in step 5 (by looking at the verbose MSI log file or looking at the MSI in Orca to get the exact name).  You also need to substitute the custom action name and command line parameters in steps 9 and 10 above.  In the case of this example, the custom actions are executable files that are installed as a part of .NET Framework setup.  If the custom action is a file streamed into the binary table of the MSI, I believe you will need to extract the file from the MSI and run it using rundll32.exe or something like that (but I haven't yet tried to do that to verify that it works like I think it will).

<update date="9/25/2006"> Added a note about running WinDBG with elevated privileges on Windows Vista </update>

 

  • When doing the above 12 steps, then I press ok to continue the .net installation, while registering system.enterpriseservices.dll, instead of giving me the usual error, it gives me an error that msiexec was closed due to a problem, then the installation gives me another error while removing files. It says that the installation is complete then, but I cannot run my software that rquires the .net framework

    I also installed .net framework 2.0 beta, but my software seems that it does not recognise it

    thanks
  • Hi, sorry for the delay replying to this post. Can you please use the steps that I list at http://blogs.msdn.com/astebner/archive/2005/03/29/403575.aspx to gather a verbose log for this failed installation and then send it to me at aaronste (at) microsoft (dot) com and I can see if I can help further?

    Also, can you explain what you mean about your software not recognizing that the .NET Framework 2.0 beta is installed? Is it giving you an error message, or is there some other failure when you run this other software? Also, what software are you referring to in this case?

  • I was contacted by a customer last week who could not get the .NET Framework 1.1 to install correctly.&amp;nbsp;...
  • I was contacted by a customer last week who could not get the .NET Framework 1.1 to install correctly.&amp;nbsp;...
  • HELP !!!
    I have problems installing .NET 1.1 on Win NT 4.0. When i debugg using MsiBreak and WinDBG i get the message: ERROR: Symbol file could not be found. Defaulted to export symbols for D:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorwks.dll - mscorwks!

    Please help me...
  • Hi Marit - there should be an option to continue and skip the error that you describe. Can you try that and see if you can still gather a stack trace?

    Also, I suggest taking a look at the language settings on your machine (described at http://blogs.msdn.com/astebner/archive/2005/07/24/442747.aspx). That post specifies Windows XP SP2, but certain language settings will also cause problems on NT4 and Windows 2000.

    Hope this helps.
  • A couple of months ago, I posted a set of debugging instructions for the .NET Framework setup that describes...
  • Hi.

    When i continue after the first error message, the message: "(11f.f4): Illegal instruction - code c000001d (first chance)" is repeated several times before this appears: "First chance exceptions are reported before any exception handling.
    This exception may be expected and handled.
    eax=000331c4 ebx=0013c6d8 ecx=0013c6d8 edx=77f973aa esi=000331c4 edi=000331d8
    eip=7920f179 esp=00032fe8 ebp=000330b0 iopl=0 nv up ei pl nz ac po nc
    cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010216
    *** ERROR: Symbol file could not be found. Defaulted to export symbols for D:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorwks.dll -
    mscorwks!GetCompileInfo+0x341c8:
    7920f179 53 push ebx"

    After this message, it stops, and i have to press "OK" in the "break-box" to continue. Then DrWatson appears, reporting an error with MsiExec.exe, and the .NET-instalation fails, and the regsvcs.exe-error appears.

    Hope you kan help me. I have several computers who need .NET. Can it be a hardware problem ? I can install .NET on some computers, but in most of the cases, i have this problem. I have tried to make an image(Symantec Ghost) of one computer where .NET can be installed, and loaded that image on a computer witch i have problems with. And it still don't work ! I still can't install .NET on that computer.... (sorry for my bad english !!)
  • Since I originally posted these instructions that describe how to gather callstack information when the...
  • Hi Marit - I can't tell for sure from the snippet of the callstack, but this sounds similar to the issue I just blogged about regarding OS images and the .NET Framework setup. Can you take a look at the item at http://blogs.msdn.com/astebner/archive/2005/08/23/455401.aspx and see if this sounds like the same scenario as you are experiencing?

  • Yes, this looks like the same scenario. I will try to reinstall NT, and see if that helps.
    Thanks....
  • I used the debugging tool and this time .Net Framework installed. But, the software that I use that relies on it is not running. Any ideas??
  • Hi Jean - can you describe the errors you see when trying to run your software that relies on the .NET Framework?

    Also, could you try to use the .NET Framework verification tool that I have posted at http://astebner.sts.winisp.net/Tools/netfx_setupverifier.zip and see if it reports any file version errors for the version of the .NET Framework that you have installed?
  • CommandLine: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegSvcs.exe /bootstrapi
    Symbol search path is: *** Invalid ***
    ****************************************************************************
    * Symbol loading may be unreliable without a symbol search path.           *
    * Use .symfix to have the debugger choose a symbol path.                   *
    * After setting your symbol path, use .reload to refresh symbol locations. *
    ****************************************************************************
    Executable search path is:
    ModLoad: 00400000 0040c000   RegSvcs.exe
    ModLoad: 7c900000 7c9b0000   ntdll.dll
    ModLoad: 79000000 79045000   C:\WINDOWS\system32\mscoree.dll
    ModLoad: 7c800000 7c8f4000   C:\WINDOWS\system32\KERNEL32.dll
    (10c0.10c4): Break instruction exception - code 80000003 (first chance)
    eax=00241eb4 ebx=7ffd7000 ecx=00000000 edx=00000001 esi=00241f48 edi=00241eb4
    eip=7c901230 esp=0012fb20 ebp=0012fc94 iopl=0         nv up ei pl nz na pe nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
    *** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll -
    ntdll!DbgBreakPoint:
    7c901230 cc               int     3


    Help, please?
  • Hi Mjc82 - Have you tried the other workaround I posted for errors with regsvcs.exe /bootstrapi in the .NET Framework 2.0?  You can find that at http://blogs.msdn.com/astebner/archive/2006/01/08/510677.aspx.

    I have also heard of cases where this command line will hang during setup, but then if you use MsiBreak to catch it in the debugger and press resume, setup will complete fine.  So you may want to try pressing resume in your debugger and see if that allows setup to proceed.

    Hope this helps!
Page 1 of 2 (26 items) 12
Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post