You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
at System.IO.Path.Combine(String path1, String path2)
at Unosquare.WiringPi.Resources.EmbeddedResources.ExtractAll()
at Unosquare.WiringPi.BootstrapWiringPi.Bootstrap()
at Unosquare.RaspberryIO.Pi.Init[T]()
at HorseFeeder.Raspberry.InitializeService.InitializeRaspberryPi()
Since .NET 5 the
Assembly.Location
API returns an empty string when the app is deployed as single file executable.https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
This prevents the library from using with a single file deployment.
Error
The
basePath
variable will be empty.wiringpi-dotnet/src/Unosquare.WiringPi/Resources/EmbeddedResources.cs
Line 36 in 9746619
Path.Combine
later on will throw an exception.wiringpi-dotnet/src/Unosquare.WiringPi/Resources/EmbeddedResources.cs
Line 42 in 9746619
Exception
Possible solution
I'm not 100% sure but maybe it's possible to use
AppContext.BaseDirectory
to get thebasePath
.https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.basedirectory?view=net-5.0#System_AppContext_BaseDirectory
The text was updated successfully, but these errors were encountered: