Skip to content

CSE0003 is raised on methods which have conditional compilation  #34

@rmaclean

Description

@rmaclean

In the following code the CSE0003 warning is raised, implying it should be an expression bodied member when it cannot be because it isn't a single line. Worse is the suggested fix removes code.

private static string DeviceID()
{
#if WINDOWS_PHONE_APP
    var token = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null);
    var hardwareId = token.Id;
    var dataReader = DataReader.FromBuffer(hardwareId);

    byte[] bytes = new byte[hardwareId.Length];
    dataReader.ReadBytes(bytes);

    return BitConverter.ToString(bytes);
#endif
#if WINDOWS_UWP
    return " arrgggh Windows 10";
#endif

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions