Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jazzman55 opened this issue Jan 10, 2025 · 0 comments · Fixed by nanoframework/nanoFirmwareFlasher#311

Comments

@jazzman55
Copy link
Contributor

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

@nfbot nfbot changed the title Application which uses nanoFirmwareFlasher nuget crashes when it is published in self-contained (single-file) mode. Application which uses nanoFirmwareFlasher nuget crashes when it is published in self-contained (single-file) mode Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants