[wix-users] Debugging managed BA

Phill Hogland phill.hogland at rimage.com
Tue Dec 6 10:20:01 PST 2016


OK on not using the pdbs to step into the Burn/wix code, if you are not doing that.


Is "E:\My Solution\MyProject.Bootstrapper\bin\Debug\ApplicationName.exe" pointing ay your bundle.exe?  , which then loads your MyProject.Bootstrapper.UI managed DLL library?  If so then yes in the MyProject.Bootstrapper.UI project Properties, on the Debug tab, you would pass the -burn.clean.room= switch pointed at the same bundle.exe path.


The reason for this is that to resolve the DLL Hijacking Security vulnerability, since the change in wix v3.10.2  (and you should certainly use v3.10.3 or later) when a user launches your bundle.exe it then copies itself to a 'clean room' and re-launches itself in the 'clean room' to protect against 'drive-by' malicious code being injected into your bundle.  So when debugging you now need to also pass the -burn.clean.room path to the bundle which you are launching within your VS debug session, but only when you need to debug it.


Eeach time after I change the -burn.clean.room= in my UI project (which I use with many different bundle.exe executables) I compile the UI project and then compile the bundle project before hitting F5 in VS on the UI project, which launches my UI project in a debug session of VS.


I'm not sure why you are having issues, but I hope this explanation helps.  (Of course when I do this my UI project in the Properties Build tab, Advanced has Debug Info set to Full, but these .Net debugging details are needed in any case and are not related to the v3.10.2 change.)


Another more complex approach which I used to use was to:

1) Add System.Diagnostics.Debugger.Launch(); to the Run() method of my startup class in my mba UI DLL project (and set a break point below it).

2) Compile that UI project and then Compile the bundle.exe which imports the UI dll.

3) Then open an additional instance of your VS Solution (so that you have two VS IDEs open for the same projects (bundle and UI project).)

4) In one VS IDE hit F5 to launch the Start up project (the bundle) related to UI dll.

5) .Net will hit the above code and ask you to attache a debugger, giving you a list of VS IDE instances.  Select the other VS IDE instance which you already opened, and use the Debug 'Attach to Process' to attach that instance, and then proceed to debug it.  (Prior to making any changes to your project, close the extra IDE session and open it again after saving the changes and prior to repeating the above steps.)


But using the -burn.clean.room is simpler than trying to manage to instances of the same Solution in separate VS IDE sessions.

________________________________
From: Goran Malovic <malovicg at yahoo.com>
Sent: Tuesday, December 6, 2016 11:21:37 AM
To: Phill Hogland; wix-users at lists.wixtoolset.org
Subject: Re: [wix-users] Debugging managed BA

Hi Phill,

I am not quite sure where to put this switch. Here is how my scenario looks like:

I have MyProject.Bootstrapper and MyProject.Bootstrapper.UI projects. In the properties of MyProject.BootStrapper.UI I, under the Debug option I have set Start action to Start external program and pointed to E:\My Solution\MyProject.Bootstrapper\bin\Debug\ApplicationName.exe

I have tried pasting below switch into command line arguments of the Bootstrapper.UI, but that did not help.

-burn.clean.room="E:\My Solution\MyProject.Bootstrapper\bin\Debug\ApplicationName.exe"

I did not have to provide any pdbs previously, since I did not require the option to debug through the burn code.

Where exactly should I add the switch you are talking about?



On Monday, December 5, 2016, 3:29:47 PM GMT+1, Phill Hogland <phill.hogland at rimage.com> wrote:
When you say that debugging used to work about a year ago and now you cannot debug, I think you are referring to the 'breaking change' which was documented in the 10.3.2

http://lists.wixtoolset.org/pipermail/wix-users-wixtoolset.org/2016-January/001251.html


There are several possible solutions, but I think the preferred solution is that when you want to debug, add the following switch to your bundle (or rather to your 'start external program' settings for your mba.dll project).

-burn.clean.room=<path to the external bundle to debug your mba>\bundle.exe


With this change you do not need to make any other changes to your bundle authoring or to the approach used to debug your mba.  Presumably if you were able to debug previously you already had VS configured to find the pdbs, etc, otherwise the steps you did previously to configure VS are still relevant.

________________________________

From: wix-users <wix-users-bounces at lists.wixtoolset.org<mailto:wix-users-bounces at lists.wixtoolset.org>> on behalf of Goran Malovic <malovicg at yahoo.com<mailto:malovicg at yahoo.com>>
Sent: Saturday, December 3, 2016 11:07:26 AM
To: wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>
Subject: [wix-users] Debugging managed BA

Hi,
I have a problem with debugging managed BA. It used to work without problems, but i haven't been using it for the last year, and don't know when it was broken.
So, I have been using suggestion from Rob on SO, and that stopped working. I have ensured that all is built, I run the app, I place breakpoint on BootstrapperApplication.Run() method (and on lots of other different places), but it is not hit. However, the placed breakpoint itself is red, so it is givining an impression that it is "active and loaded". After the F5 Setup.exe is started and shown on screen, which is correct, but I cannot step through the managed BA code.
My BA is built on .NET framework 3.5 Client Profile. I am using VS 2015, and Wix 3.10.3 Here is BootstrapperCore.config:
  <configSections>
    <sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
      <section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v2.0.50727" />
    <supportedRuntime version="v4.0" />
  </startup>
  <wix.bootstrapper>
    <host assemblyName="Project.Bootstrapper.UI">
      <supportedFramework version="v3.5" />
      <supportedFramework version="v4\Client" />
      <supportedFramework version="v4\Full" />
    </host>
  </wix.bootstrapper>
</configuration>
Any ideas?
Thanks,Goran





____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/




More information about the wix-users mailing list