Skip to content

jamescrosswell/is-portable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IsPortable CodeView Issue Reproduction

This repository reproduces the issue described in Sentry .NET issue #4427 regarding the IsPortableCodeView property on CodeView directory entries in .NET 9 MAUI applications.

Issue Description

When building a .NET 9 MAUI application targeting iOS in release mode, IsPortableCodeView should be true in the CodeView debug directory entry. It appears to incorrectly return false since the MinorVersion is set to 0.

Steps to Reproduce

1. Clone this Repository

git clone <repository-url>
cd is-portable

2. Run the MAUI Application in Release Mode on a Simulator

Find the relevant device ID for your iOS simulator. You can list available simulators with:

xcrun xctrace list devices

Now run build the test app and deploy it to the simulator:

dotnet build -c Release --framework net9.0-ios /p:RuntimeIdentifier=iossimulator-arm64 /t:Run ./MauiTestApp/MauiTestApp.csproj /p:_DeviceName=:v2:udid=<DeviceId>

A side effect of this step is that various files will be generated in the bin and obj directories, including multiple MauiTestApp.dll files.

3. Run the PE Reader Application

dotnet run --project PeReaderApp

The console application will read the PE header of the various MauiTestApp.dll files and display some information from the debug directory entries, including the IsPortableCodeView property.

Expected vs Actual Behavior

Expected Behavior

  • IsPortableCodeView should be true for all of the assemblies. This should only return true for Windows PDB files (not relevant when running on iOS).

Actual Behavior (Issue)

  • IsPortableCodeView is showing as false for the PE file located at MauiTestApp/obj/Release/net9.0-ios/iossimulator-arm64/stripped/MauiTestApp.dll. This is problematic since this appears to be the assembly that is actually used when running the app on the iOS simulator (where we're also observing the issue with the IsPortableCodeView property).

Output Example

When running the PE reader, you should see output similar to:

binFile
=============================
Found 3 debug directory entries:

Type: CodeView
    IsPortableCodeView: True
    Guid:  7a75b1de-313d-1a76-d796-2e25687d73d9
    Stamp: 12ac34c1
    Age:   1

objBase
=============================
Found 3 debug directory entries:

Type: CodeView
    IsPortableCodeView: True
    Guid:  7a75b1de-313d-1a76-d796-2e25687d73d9
    Stamp: 12ac34c1
    Age:   1

objStripped
=============================
Found 1 debug directory entries:

Type: CodeView
    IsPortableCodeView: False
    Guid:  7a75b1de-313d-1a76-d796-2e25687d73d9
    Stamp: 689ab509
    Age:   1

Related Links

About

Minimal repro of issue with DebugDirectoryEntry.IsPortableCodeView in release mode on iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages