VS2005 Installs, Compiles, Doesn't run simple C# programs

I've installed VS2005. It installed fine, and if I do a new C# windows project, it will apparently compile it. If I try running that program, it does nothing.

I can do the same steps on another machine, and everything works fine. I can copy an executable built on the other machine to this machine, and it runs fine.

Here's a partial dump of the output

'WindowsApplication1.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

The thread 0xd84 has exited with code 0 (0x0).

The thread '<No Name>' (0xdb8) has exited with code 0 (0x0).

'WindowsApplication1.vshost.exe' (Managed): Loaded 'C:\Documents and Settings\rtrickey\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\bin\Debug\WindowsApplication1.exe', Symbols loaded.

The program '[2620] WindowsApplication1.vshost.exe: Managed' has exited with code -1073741819 (0xc0000005).



Answer this question

VS2005 Installs, Compiles, Doesn't run simple C# programs

  • Ken Elmy

    Thank the programming gods that I stumbled across this. I lost literally days of work trying to track this down over the last year. It doesn't seem to be a problem on Win2K, just on XP, from my experience.

    I *strongly* urge everyone to contact Kensington and push for a solution.


  • Ludo-R

    Go back to step 1 and then take great enjoyment in continuing with step 2.

    I have now added a third step to the process.

    STEP 3: Mail the pieces to Kensington support. Smile

  • ved_30

    hmm strange...

    "Module is optimized and the debugger option 'Just My Code' is enabled";

  • Tom v E

    Hello,

    this sounds somewhat similar to some problems I'm having. See thread "Some strange account specific bugs affecting various parts of the IDE" in this forum. I also having problems with things working perfect on one computer and awful on another. Furthermore, also within the same computer the behaviour is different depending on which user account you're logged in to.

    Can you try creating a new account on your computer and try running the program from there I'm just interested to see if you are having the same problems as I do.

    Best regards,

    Roger


  • Crashone

    I see in the following thread: https://forums.microsoft.com/MSDN/ShowPost.aspx PostID=240284&SiteID=1 . That mouseworks does not work with Visual Studio. I struggled with this issue for several weeks before finally seeing this post.

    Has anyone found a decent workaround other than stopping items from running I can't believe Kensington has not come up with a solution yet.

    Thanks,

    Greg


  • Alvin Kuiper

    An update to this problem. I tried disabling the Visual Studio hosting process and the program now runs . Not sure why but will keep diging.

    Shaun

  • Alex2200

    Here is the response I just received from Kensington:

    Dear Greg:

    Thank you for contacting Kensington Technical Support.

    I would forward this issue to our software development team.

    However, I cannot give any timeframe for the outcome of the resolution.

    I sincerely apologize for any inconvenience this may have caused.

    Regards,

    Navin Kumar Verma
    Kensington Technical Support

    Like the above poster. I'd strong encourage others to push Kensington to come up with a solution since it's been well over a year now.


  • Ted.

    I did the same on Friday and the problem has been resolved. It definately was the mouse driver which loaded Windows 95 style drivers. Follow the following procedure to resolve the problem

    1) UNINSTALL THE MOUSE

    2) PUT THE MOUSE ON THE FLOOR AND JUMP ON IT. (Just makes you feel good :)

    I have included the full analysis for anyone who is interest.

    Regards
    Shaun

    ******************* The message from Microsoft follows **************** Hi Shaun,
    I just received a reply from our CPR and it seems interesting. The stack as shown below:

    0:000> !clrstack
    OS Thread Id: 0x1268 (0)
    ESP EIP
    0012f2d0 00000000 [NDirectMethodFrameStandalone: 0012f2d0] System.Windows.Forms.SafeNativeMethods.ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)
    0012f2e8 7b073135 System.Windows.Forms.Control.SetVisibleCore(Boolean)
    0012f390 7b06382b System.Windows.Forms.Form.SetVisibleCore(Boolean)
    0012f3d0 7b070336 System.Windows.Forms.Control.set_Visible(Boolean)
    0012f3d4 7b08429e System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
    0012f440 7b08416b System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
    0012f470 7b0c69fe System.Windows.Forms.Application.Run(System.Windows.Forms.Form)
    0012f480 011d00a8 TestApp2.Program.Main() 0012f69c 79e88f63 [GCFrame: 0012f69c]

    So we were transitioning from managed code to the native windows API ShowWindow.

    Weird stuff happening when we do windows API stuff is not uncommonly due to low level third party stuff like mouse drivers, display drivers, hooking software, etc.

    So let's have a look and see what is loaded in the process and look out for anything out of the ordinary:

    0:000> !peb
    PEB at 7ffdd000
    InheritedAddressSpace: No
    ReadImageFileExecOptions: No
    BeingDebugged: Yes
    ImageBaseAddress: 00400000
    Ldr 00251ea0
    Ldr.Initialized: Yes
    Ldr.InInitializationOrderModuleList: 00251f58 . 00253f50
    Ldr.InLoadOrderModuleList: 00251ee0 . 00253f40
    Ldr.InMemoryOrderModuleList: 00251ee8 . 00253f48
    Base TimeStamp Module
    400000 441a8706 Mar 17 09:53:10 2006 C:\Documents and Settings\f2916479.FNBJNB01\My Documents\Visual Studio 2005\Projects\Test Projects\TestApp2\TestApp2\bin\Debug\TestApp2.exe
    7c900000 411096b4 Aug 04 08:56:36 2004 C:\WINDOWS\system32\ntdll.dll
    79000000 4333e75e Sep 23 12:30:38 2005 C:\WINDOWS\system32\mscoree.dll
    7c800000 411096b4 Aug 04 08:56:36 2004 C:\WINDOWS\system32\KERNEL32.dll
    77dd0000 411096a7 Aug 04 08:56:23 2004 C:\WINDOWS\system32\ADVAPI32.dll
    77e70000 411096ae Aug 04 08:56:30 2004 C:\WINDOWS\system32\RPCRT4.dll
    77f60000 43c2a517 Jan 09 18:01:59 2006 C:\WINDOWS\system32\SHLWAPI.dll
    77f10000 43b35225 Dec 29 03:04:05 2005 C:\WINDOWS\system32\GDI32.dll
    77d40000 422603cc Mar 02 18:19:56 2005 C:\WINDOWS\system32\USER32.dll
    77c10000 41109752 Aug 04 08:59:14 2004 C:\WINDOWS\system32\msvcrt.dll
    10000000 406785e6 Mar 29 03:11:50 2004 C:\WINDOWS\system32\AMInit.dll
    79e70000 4333e7ec Sep 23 12:33:00 2005 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
    78130000 4333a455 Sep 23 07:44:37 2005 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\MSVCR80.dll
    7c9c0000 433373f9 Sep 23 04:18:17 2005 C:\WINDOWS\system32\shell32.dll
    773d0000 4110968c Aug 04 08:55:56 2004 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    5d090000 411096af Aug 04 08:56:31 2004 C:\WINDOWS\system32\comctl32.dll
    790c0000 43ecf795 Feb 10 20:29:09 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\8133f5f3769a254c95ecd905917a49ec\mscorlib.ni.dll
    774e0000 42e5be93 Jul 26 05:39:47 2005 C:\WINDOWS\system32\ole32.dll
    5ad70000 411096bb Aug 04 08:56:43 2004 C:\WINDOWS\system32\uxtheme.dll
    74720000 411096ea Aug 04 08:57:30 2004 C:\WINDOWS\system32\MSCTF.dll
    63000000 40d08914 Jun 16 18:53:24 2004 C:\WINDOWS\system32\SynTPFcs.dll
    77c00000 411096b7 Aug 04 08:56:39 2004 C:\WINDOWS\system32\VERSION.dll
    1150000 3b993a95 Sep 07 22:22:29 2001 C:\WINDOWS\system32\SHW95DLL.DLL
    ffb0000 41107d48 Aug 04 07:08:08 2004 C:\WINDOWS\system32\WOW32.dll
    77b40000 411096b4 Aug 04 08:56:36 2004 C:\WINDOWS\system32\appHelp.dll
    f000000 41107d3e Aug 04 07:07:58 2004 C:\WINDOWS\system32\ntvdm.exe !!!!
    763b0000 411096b0 Aug 04 08:56:32 2004 C:\WINDOWS\system32\comdlg32.dll
    769c0000 411096b9 Aug 04 08:56:41 2004 C:\WINDOWS\system32\USERENV.dll
    5b430000 3b7dfec9 Aug 18 06:36:09 2001 C:\WINDOWS\system32\tsappcmp.dll
    79060000 4333e763 Sep 23 12:30:43 2005 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll
    7a440000 43ecf7a1 Feb 10 20:29:21 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\d540d95a76f853448b96ed9c5e61abef\System.ni.dll
    7ade0000 43ecf7b3 Feb 10 20:29:39 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\196a602884ec954eb72f29b06e1496c0\System.Drawing.ni.dll
    7afd0000 43ecf7b5 Feb 10 20:29:41 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\96732c1ff28cad4ebb21efbed04b21c3\System.Windows.Forms.ni.dll
    64890000 43ecf83b Feb 10 20:31:55 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Configuration\7416e654d94a8b46add48ebcd40c832a\System.Configuration.ni.dll
    69be0000 43ecf7c1 Feb 10 20:29:53 2006 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\d15db37531c8ef49ba9f6732dd411219\System.Xml.ni.dll
    4ec50000 4110968b Aug 04 08:55:55 2004 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\gdiplus.dll
    SubSystemData: 00000000
    ProcessHeap: 00150000

    To see WOW32 and NTVDM.EXE loaded in a 32 bit process is very odd to say the least!.
    So why would these be loaded

    The output from !peb typically lists modules in the order they were loaded into the process. So modules higher up the list are usually responsible for the loading of modules further down the list.

    Just before WOW32.DLL we have SHW95DLL.DLL.

    So what is that

    0:000> lmvmSHW95DLL
    start end module name
    01150000 0116f000 SHW95DLL (export symbols) SHW95DLL.DLL
    Loaded symbol image file: SHW95DLL.DLL
    Image path: C:\WINDOWS\system32\SHW95DLL.DLL
    Image name: SHW95DLL.DLL
    Timestamp: Fri Sep 07 22:22:29 2001 (3B993A95)
    CompanyName: Kensington Technology Group
    ProductName: Kensington MouseWorks Driver
    InternalName: KMOUSE
    OriginalFilename: SHW95DLL.DLL
    ProductVersion: 5.61
    FileVersion: 5.61
    FileDescription: Kensington MouseWorks Win32 Support
    LegalCopyright: Copyright )2001 ACCO Brands, Inc.
    Comments: Kensington MouseWorks

    It's a mouse driver.

    This mouse driver imports some functions from WOW32.DLL so as soon as the mouse driver is loaded in memory, WOW32.DLL and (I presume, since it is to do with the WOW layer) NTVDM.EXE.
    (You could also determine the DLL imports by using the public tool depends.exe on the DLL itself, rather than the dump)

    I think it is highly likely this 3rd party mouse driver is the cause of the customer's problems.

    I recommend they fully uninstall it from their system. Get a new mouse if necessary.

    If the problem still occurs, I would then have the customer investiage these as possible bad guys:

    0:000> lmvmSynTPFcs
    start end module name
    63000000 63014000 SynTPFcs (deferred)
    Image path: C:\WINDOWS\system32\SynTPFcs.dll
    Image name: SynTPFcs.dll
    Timestamp: Wed Jun 16 18:53:24 2004 (40D08914)
    CheckSum: 00000000
    ImageSize: 00014000
    File version: 7.5.17.12
    Product version: 7.5.17.12
    File flags: 0 (Mask 3F)
    File OS: 4 Unknown Win32
    File type: 2.0 Dll
    File date: 00000000.00000000
    Translations: 0409.04b0
    CompanyName: Synaptics, Inc.
    ProductName: Progressive Touch
    InternalName: SynTPFcs
    OriginalFilename: SynTPFcs.dll
    ProductVersion: 7.5.17.12 16Jun04
    FileVersion: 7.5.17.12 16Jun04
    FileDescription: SynTPFcs
    LegalCopyright: Copyright (C) Synaptics, Inc. 1996-2003

    0:000> lmvmAMInit
    start end module name
    10000000 10011000 AMInit (deferred)
    Image path: C:\WINDOWS\system32\AMInit.dll
    Image name: AMInit.dll
    Timestamp: Mon Mar 29 03:11:50 2004 (406785E6)
    CheckSum: 00000000
    ImageSize: 00011000
    File version: 6.0.1024.0
    Product version: 6.0.1024.0
    File flags: 0 (Mask 3F)
    File OS: 4 Unknown Win32
    File type: 2.0 Dll
    File date: 00000000.00000000
    Translations: 0409.04b0
    CompanyName: Altiris Inc.
    ProductName: Altiris eXpress Metering Agent
    InternalName: AMInit
    OriginalFilename: AMInit.DLL
    ProductVersion: 6, 0, 1024
    FileVersion: 6, 0, 1024
    PrivateBuild: 6, 0, 1024
    SpecialBuild: 6, 0, 1024
    FileDescription: Altiris App Metering Init
    LegalCopyright: Copyright (c) 1998-2002, Altiris Inc.
    LegalTrademarks: Copyright (c) 1998-2002, Altiris Inc.
    Comments: Copyright (c) 1998-2002, Altiris Inc.

    So the final recommendation for this is to change the mouse driver. If you can, please change the mouse with another mouse not from "Kensington Technology Group" to try to isolate this potential cause

  • Sarath.

    Also, I've put this in my startup program group:

    {

    using System;

    using System.Collections.Generic;

    using System.Text;

    using System.Threading;

    using System.Diagnostics;

    namespace KillKensingtonProcesses

    {

    class Program

    {

    static void Main(string[] args)

    {

    Thread.Sleep(3 * 1000 * 60); // sleep 3 minutes to allow the system to finish booting.

    Process[] procs = Process.GetProcessesByName("kmw_run");

    foreach (Process p in procs)

    {

    p.CloseMainWindow(); // ask nicely, and wait

    Thread.Sleep(3000); // 3 second for compliance

    if (!p.HasExited)

    p.Kill();

    }

    procs = Process.GetProcessesByName("kmw_show");

    foreach (Process p in procs)

    {

    p.CloseMainWindow(); // ask nicely, and wait

    Thread.Sleep(3000); // 3 second for compliance

    if (!p.HasExited)

    p.Kill();

    }

    }

    }

    }


  • Jignesh Vyas

    I have this problem with the drivers for my Kensington Expert Mouse, which I love dearly, but unfortunately Kensington's drivers are not nice to VS. I went round and round with the extremely unhelpful people at Kensington to no avail. I eventually figured out that if I kill kmw_run.exe and kmw_show.exe from the windows TaskManager that many of the mouse features continue to work (button remapping etc.. but you do lose some fun features like quickmenu) and applications will debug and run correctly in VS.

    Hopefully someone a Kensington will get a fix done for this, but until then....

    -Ben


  • Andrew Buyan

    Thanks. I had this problem for the past 5 weeks in VB application that crashes when focus changes between open or minimized and/or maximized forms.

    Note: There is a very important third step

    1) UNINSTALL THE MOUSE

    2) PUT THE MOUSE ON THE FLOOR AND JUMP ON IT. (Just makes you feel good :)

    3) Repeat step 2 until you passout or else!!!!!!!!!!!!!!!!!!!!!!!!


  • SQL2K5

    Maybe this applies to your situation.

    The exact same problem came into my life right after I installed the Kensington MouseWorks v 6.0.1 software.

    Removing Kensington using Add/Remove Programs, returns VS2005 returned back to normal.



  • chaza

    Hi, I am experiencing the same problem after doing a full installation on my new notebook. Has anyone managed to resolve this yet

    Thanks
    Shaun

  • rtaiss

    I had the same problem and after removing Kensington MouseWorks it now works fine.

    Thanks


  • VS2005 Installs, Compiles, Doesn't run simple C# programs