Skip to content

UnitsNet types are not Windows Runtime Component Compatible #150

Closed
@jbienzms

Description

@jbienzms

I would like to use UnitsNet in a large Windows IoT Core Devices project I manage called Microsoft.IoT.Devices. However, when I attempt to use the types defined in UnitsNet as return values in my library I get the following error:

Severity Code Description Project File Line Suppression State
Error WME1032 Method 'Microsoft.IoT.DeviceCore.Sensors.ITemperatureReading.Temperature.get()' returns 'UnitsNet.Temperature', which is not a valid Windows Runtime type. Methods exposed to Windows Runtime must return only Windows Runtime types. Microsoft.IoT.DeviceCore C:\Users\jbienz\Code\Microsoft\IoTDevices\Lib\Microsoft.IoT.DeviceCore\Sensors\Temperature\TemperatureReading.cs 23 Active

This is due to the type restrictions on WinRT components.

Obviously UnitsNet was written as a Class Library and not a WinRT component. And obviously refactoring the library into a WinRT component may require that some features be left off. However, I still feel this would be incredibly valuable to have, especially in the IoT space.

If you would like to discuss this more please feel free to reach out to me. com dot microsoft at jbienz, or via github.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions