When compiling the C# project Self-Contained, GdalConfiguration throws DllNotFoundException for gdal-wrap.dll. I've traced the problem to the following line in the GdalConfiguration static constructor:
string executingAssemblyFile = new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath;
The problem is that AssemblyName.CodeBase is null for Self-Contained applications. See error code IL3000.
As an alternative, Microsoft recommends using System.AppContext.BaseDirectory. Alternatively you may use Environment.ProcessPath.
When compiling the C# project Self-Contained,
GdalConfiguration
throwsDllNotFoundException
for gdal-wrap.dll. I've traced the problem to the following line in theGdalConfiguration
static constructor:The problem is that
AssemblyName.CodeBase
is null for Self-Contained applications. See error code IL3000.As an alternative, Microsoft recommends using
System.AppContext.BaseDirectory
. Alternatively you may useEnvironment.ProcessPath
.