Excel-DNA / Excel-DNA/ExcelDna

typeof(Functions).Assembly.Location returns empty string, yet shows proper value in debugger

Open
#460 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
292
Avg merge
20d 12h
Merged PRs (30d)
1

Description

public string GetLicenseFileName()
{
var path = Path.ChangeExtension(typeof(Functions).Assembly.Location, "lic");
return path;
}

///
/// Get key from file having name of calling assembly with extension .lic
///
///
public string GetKeyFromFile()
{
string key = null;

string path = GetLicenseFileName();

if (!File.Exists(path))
{
throw new Exception($"Unable to locate a valid license file. {path}");
}

key = File.ReadAllText(path);

return key;
}

In the code above GetLicenseFileName always returns empty string!!! Inside the Excel DNA functions!!!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.