OpenTextSummarizer icon indicating copy to clipboard operation
OpenTextSummarizer copied to clipboard

App cannot find dics folder If I publish with produce single file option (.net Core)

Open HolyOne opened this issue 3 years ago • 0 comments

The reason is in the Dictionary.cs file, locating app path with this way breaks

Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase).Substring(6)

The correct way is Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName)

So the full line should be

string dictionaryFile = string.Format(@"{1}\dics\{0}.xml", DictionaryLanguage, Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));

HolyOne avatar Oct 22 '22 04:10 HolyOne