Skip to content

Adonis.Window Crashes on startup if not launched from the base directory #63

@Swiftpaws

Description

@Swiftpaws

Describe the bug
If the application uses the AdonisWindow and is launched with anything but the base directory (where the .dll files are located) as the "Start in" location it will crash at:
AdonisUI.Controls.AdonisWindow.GetApplicationIcon()

To Reproduce
Steps to reproduce the behavior:

  1. Create App which uses the AdonisWindow (.net core 3.1)
  2. Add an icon via the project properties
  3. Compile
  4. Try to launch it via cmd from the downloads folder (cmd current dir is downloads and start it with an absolute path)

Expected behavior
No crash

Screenshots

Additional context
The icon visibility in the adonis window does not affect this behaviour

Exception + StackTrace

System.Windows.Markup.XamlParseException: 'The invocation of the constructor on type 'Okami.Views.MainWindow' that matches the specified binding constraints threw an exception.'

FileNotFoundException: Could not load file or assembly 'C:\Users\pub\Downloads\Okami.dll'. The system cannot find the file specified.

This exception was originally thrown at this call stack:
System.Drawing.Icon.ExtractAssociatedIcon(string, int)
System.Drawing.Icon.ExtractAssociatedIcon(string)
AdonisUI.Controls.AdonisWindow.GetApplicationIcon()
AdonisUI.Controls.AdonisWindow.AdonisWindow()
Okami.Views.MainWindow.MainWindow()

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions