Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] default $(AndroidUseAssemblyStore) to false for debug builds #6660

Merged

Conversation

jonathanpeppers
Copy link
Member

Context: https://github.com/xamarin/QualityAssurance/tree/master/Manual/CrossPlatformDebugging
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1430409
Fixes: #6480

A CrossPlatformDebugging sample project in the QA repo fails to
debug with:

System.InvalidProgramException
Message=Invalid IL code in Mono.SystemDependencyProvider:Initialize (): IL_002e: endfinally

The problem goes away if you do one of:

  • Turn on Fast Deployment
  • Add <AndroidUseAssemblyStore>false</AndroidUseAssemblyStore>
  • Change $(DebugType) to portable. (the project has full)

The problem appears to be:

  1. $(AndroidUseAssemblyStore) defaults to true when you turn Fast
    Deployment off.

  2. Assembly stores appear to have some issue when DebugType=full --
    that is where the crash occurs.

In this case let's address No. 1, as we don't really want the
assembly store to be used when debugging. I reordered default values
for MSBuild properties, so that $(AndroidIncludeDebugSymbols) is
taken into account.

I added parameters for a debugging test for DebugType=full, and I
updated another test that used to set AndroidUseAssemblyStore=false
that should not be needed.

…alse for debug builds

Context: https://github.com/xamarin/QualityAssurance/tree/master/Manual/CrossPlatformDebugging
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1430409
Fixes: xamarin#6480

A `CrossPlatformDebugging` sample project in the QA repo fails to
debug with:

    System.InvalidProgramException
    Message=Invalid IL code in Mono.SystemDependencyProvider:Initialize (): IL_002e: endfinally

The problem goes away if you do one of:

* Turn *on* Fast Deployment
* Add `<AndroidUseAssemblyStore>false</AndroidUseAssemblyStore>`
* Change `$(DebugType)` to `portable`. (the project has `full`)

The problem appears to be:

1. `$(AndroidUseAssemblyStore)` defaults to `true` when you turn Fast
   Deployment *off*.

2. Assembly stores appear to have some issue when `DebugType=full` --
   that is where the crash occurs.

In this case let's address No. 1, as we don't *really* want the
assembly store to be used when debugging. I reordered default values
for MSBuild properties, so that `$(AndroidIncludeDebugSymbols)` is
taken into account.

I added parameters for a debugging test for `DebugType=full`, and I
updated another test that used to set `AndroidUseAssemblyStore=false`
that should not be needed.
Copy link
Contributor

@dellis1972 dellis1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look ok to me

@jonathanpeppers
Copy link
Member Author

Some networking/SSL failures seem to be the only failures:

https://discord.com/channels/732297728826277939/732297837953679412/935538687968694402

Going to merge, I think.

@jonathanpeppers jonathanpeppers merged commit 87589c1 into xamarin:main Jan 25, 2022
@jonathanpeppers jonathanpeppers deleted the androiduseassemblystore-debug branch January 25, 2022 14:18
jonpryor pushed a commit that referenced this pull request Jan 26, 2022
…alse for debug builds (#6660)

Context: https://github.com/xamarin/QualityAssurance/tree/master/Manual/CrossPlatformDebugging
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1430409
Fixes: #6480

A `CrossPlatformDebugging` sample project in the QA repo fails to
debug with:

    System.InvalidProgramException
    Message=Invalid IL code in Mono.SystemDependencyProvider:Initialize (): IL_002e: endfinally

The problem goes away if you do one of:

* Turn *on* Fast Deployment
* Add `<AndroidUseAssemblyStore>false</AndroidUseAssemblyStore>`
* Change `$(DebugType)` to `portable`. (the project has `full`)

The problem appears to be:

1. `$(AndroidUseAssemblyStore)` defaults to `true` when you turn Fast
   Deployment *off*.

2. Assembly stores appear to have some issue when `DebugType=full` --
   that is where the crash occurs.

In this case let's address No. 1, as we don't *really* want the
assembly store to be used when debugging. I reordered default values
for MSBuild properties, so that `$(AndroidIncludeDebugSymbols)` is
taken into account.

I added parameters for a debugging test for `DebugType=full`, and I
updated another test that used to set `AndroidUseAssemblyStore=false`
that should not be needed.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't debug with VS 2022 17.1.0 Prev 1.0
3 participants