Skip to content

Application which uses nanoFirmwareFlasher nuget crashes when it is published in self-contained (single-file) mode #1587

@jazzman55

Description

@jazzman55

Tool

nanoff

Description

According to the warning:
Warning IL3000: 'System.Reflection.Assembly.Location' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.
Line 19 in Utilities class should be changed.
Currently exception is thrown:
The type initializer for 'nanoFramework.Tools.FirmwareFlasher.Utilities' threw an exception.

How to reproduce

  1. Create .NET app (e.g. console app).
  2. Install nanoFramework.Tools.FirmwareFlasher nuget package.
  3. In the code instantiate EspTool class and call GetDeviceDetails.
  4. Publish the app with "Deployment mode": "Self-contained".
  5. Run the published app.

Expected behaviour

Device details to be retrieved.

Screenshots

No response

Aditional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions