title: ClickOnce WPF application not running on Windows 7 64-bit
body: <p>I have a <a href="http://en.wikipedia.org/wiki/ClickOnce" rel="nofollow noreferrer">ClickOnce</a> (C#, WPF, .NET 4.5) application, it runs and works fine under Windows&nbsp;7 32-bit. It is compiled as <em>Any CPU</em>.</p>
  
  <p>Under Windows&nbsp;7 64-bit I see the ClickOnce start screen, and then nothing happens (no errors, nothing obvious).</p>
  
  <p>In order to debug, I have copied the EXE file and all relevant DLL files into one directory. I started from there: Again same situation, it runs under Windows&nbsp;7 32-bit, but nothing happens under Windows&nbsp;7 64-bit. I have crosschecked with a "clean" Windows&nbsp;7 32-bit, and it is fine there as well.</p>
  
  <p>.NET 4.5 was / is installed on any machine I have tested with.</p>
  
  <p>How can I overcome / debug the application? What do I need to do make it run under 64-bit?</p>
  
  <p>Event log under APPLICATIONS shows:</p>
  
  <pre><code>Faulting application name: MyApp.exe, version: 0.8.1.13, time stamp: 0x50e807c5
  Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b8479b
  Exception code: 0xe0434352
  Fault offset: 0x0000000000009e5d
  Faulting process id: 0x1138
  Faulting application start time: 0x01cdeeab375b90da
  Faulting application path: B:\Debug\MyApp.exe
  Faulting module path: C:\Windows\system32\KERNELBASE.dll
  Report Id: 761e9cba-5a9e-11e2-a573-406186f45b4a
  </code></pre>
  
  <p>According to <a href="http://davidstechtips.com/2010/06/force-net-application-to-run-in-32-bit-process-on-64-bit-windows/" rel="nofollow noreferrer">here</a>, I could force building as a <a href="http://en.wikipedia.org/wiki/Windows_API" rel="nofollow noreferrer">Win32</a> application, but is this the right way to go? The application is pretty simple, so I doubt this should be required.</p>
  
  <p>Follow up, about the remote debugging: <em><a href="https://stackoverflow.com/questions/14247537">Visual Studio 2012: Can I start a .NET 4.5 application in a remote debugger (and not only attach)?</a></em></p>
  
  <p>The first thing I did was updating the two external (Syncfusion) DLL files to their recent version. It was still crashing, but now I got an additional .NET event in the event viewer. I thought it might be "Syncfusion"-related, but the whole trace does not show any Syncfusion libraries.</p>
  
  <pre><code>Application: MyApp.exe
  Framework Version: v4.0.30319
  Description: The process was terminated due to an unhandled exception.
  Exception Info: System.TypeInitializationException
  Stack:
     at System.Windows.Automation.Peers.AutomationPeer.ListenerExists(System.Windows.Automation.Peers.AutomationEvents)
     at System.Windows.Controls.TabControl.OnSelectionChanged(System.Windows.Controls.SelectionChangedEventArgs)
     at System.Windows.Controls.Primitives.Selector+SelectionChanger.End()
     at System.Windows.Controls.Primitives.Selector+SelectionChanger.SelectJustThisItem(ItemInfo, Boolean)
     at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged
  </code></pre>
  
  <p>Next thing, in the Visual&nbsp;Studio&nbsp;2012 build, I checked <em>Prefer 32-bit</em>, <strong>this compiled exe runs</strong> on Windows&nbsp;7 64-bit. So it is partly a success.</p>
  
  <p><img src="https://i.stack.imgur.com/fC3Co.png" alt="Prefer 32-bit"></p>