aardvark.base icon indicating copy to clipboard operation
aardvark.base copied to clipboard

.net 5 single-file deployment robustness

Open haraldsteinlechner opened this issue 4 years ago • 1 comments
trafficstars

in introspection/plugin loading we heavily make use of assembly.location et al. This is no longer possible in .net 5 - https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.location?view=net-5.0#remarks

the background description can be found here: https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md

In https://github.com/aardvark-platform/aardvark.base/commit/5f67063bdc1a32e3010abac69d642922b72372e6 we took a first step towards this goal and made some bits generally more robust, e.g. got rid of those:

nhandled exception. System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at System.IO.File.GetLastWriteTimeUtc(String path)
   at Aardvark.Base.CachingProperties.GetIdentifier(Assembly asm, NamingScheme scheme)
   at Aardvark.Base.Introspection.GetQueryCacheFilename(Assembly asm, Guid queryGuid)
   at Aardvark.Base.Introspection.GetAll___[T](Assembly a, String discriminator, Func`2 decode, Func`2 createResult, Func`2 encode)
   at Aardvark.Base.Introspection.GetAllMethodsWithAttribute[T](Assembly a)
   at Aardvark.Base.Aardvark.LoadAll(IEnumerable`1 xs)
   at Aardvark.Base.Aardvark.Init()
   at Program.main(String[] argv)

What remains is to find a solution which allows us to scan for potential plugin assemblies.

There are numerous projects with similar problems. Maybe we can get some information there, e.g. https://github.com/nuke-build/nuke/issues/764

haraldsteinlechner avatar Jul 26 '21 12:07 haraldsteinlechner

just improved robustness but i could not manage to get caching working... actually seems to be net5.0 thing - similarly to https://github.com/nuke-build/nuke/issues/764

haraldsteinlechner avatar Aug 09 '21 12:08 haraldsteinlechner