Skip to content

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

Description

@HolyOne

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));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions