Mpdreamz / shellprogressbar

ShellProgressBar - display progress in your console application
MIT License
1.43k stars 134 forks source link

Fix TypeLoadException on non-Windows platforms #26

Closed dlech closed 5 years ago

dlech commented 5 years ago

If you attempt to use the TaskbarProgress class on non-Windows platforms, it will throw a TypeLoadException stating that "COM is not supported". This is presumably because of the use of the [ComImport] attribute in TaskbarProgress.

This modifies the EnableTaskBarProgress property to throw an exception if we try to set it to true on non-Windows platforms.

It also fixes the demo to conditionally set this property based on the runtime platform.

Mpdreamz commented 5 years ago

LGTM! thank you for submitting this PR @dlech 👍

Mpdreamz commented 5 years ago

https://www.nuget.org/packages/ShellProgressBar/4.1.1 is out with these fixes 💯