Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 17, 2025

Problem

Event properties with unsigned integer types (UInt16, UInt32, UInt64) were being displayed as their signed equivalents (short, int, long) in the event viewer. This caused issues when viewing events with large unsigned values, which would appear as negative numbers.

For example, a ulong value like

Original prompt

This section details on the original issue you should resolve

<issue_title>ulong event property is displayed as long in event viewer.</issue_title>
<issue_description>I have a method to write ulong event in my event source:

    [NonEvent]
    private unsafe void WriteEvent(int eventId, ulong arg1)
    {
        if (IsEnabled())
        {
            EventData* descrs = stackalloc EventData[1];
            descrs[0] = new EventData { DataPointer = (IntPtr)(&arg1), Size = 8 };
            WriteEventCore(eventId, 1, descrs);
        }
    }

Yet it is still displayed as a long value inside the events grid view.

Image

Is this expected behavior or fixable?</issue_description>

Comments on the Issue (you are @copilot in this section)

@brianrob I am not surprised at this. Looking at the code - at a minimum, this is coming from the `PayloadFetch` struct, which converts incoming signed and unsigned types into their signed .NET equivalents.

I am not sure how easy this is to fix, but I would hope relatively simple. Let's start with copilot trying to update PayloadFetch to differentiate between signed and unsigned types and see if that solves the problem.

Copilot: Please focus specifically on changing the handling of UInt16, UInt32, and UInt64. Don't touch UInt8. You should be able to update the switch statement to set the .NET type to be the unsigned type that matches the input type, rather than translating to the signed .NET type.</comment_new>
<comment_new>@brianrob
@tomuxmon would you mind testing #2315 and see if that fixes your issue?</comment_new>

Fixes #2309


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix ulong event property display in event viewer Fix unsigned integer types (UInt16, UInt32, UInt64) display in event viewer Oct 17, 2025
Copilot AI requested a review from brianrob October 17, 2025 18:43
Copilot finished work on behalf of brianrob October 17, 2025 18:43
@brianrob
Copy link
Member

Closed in favor of #2315.

@brianrob brianrob closed this Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ulong event property is displayed as long in event viewer.

2 participants