question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NativeAOT publish for DLL does not set automatically RID

See original GitHub issue

I was have following setup. DLL project which I publish as NativeAOT. I have to publish it dotnet publish -r win-x64 --self-contained otherwise project does not pickup nor current RID of my dev machine, not the fact that application is self-contained (NativeAOT). It’s most likely issue in SDK

  • dotnet publish want me specify RID
  • dotnet publish -r win-x64 use WinForms references during build, but do not propagate them for publish to ILC
  • dotnet publish -r win-x64 --self-contained works, but self-contained switch is misleading probably and undo a lot of tooling work in recent releases around NativeAOT

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:28 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
am11commented, Jan 9, 2023

in fact it was like that during part of 7.0.100, and it broke a lot of people.

Were those people using PublishAot=true? This issue is specific to NativeAOT, where RID and SelfContained are always required during the publish regardless of OutputType. The proposed fix does not affect anything else.

1reaction
am11commented, Jan 9, 2023

If most (or all) of the PublishAot=true cases must imply SelfContained=true ignoring the project OutputType, then this should be fine: https://github.com/am11/sdk/commit/dc23244c6a5fd0bddbd24ebab895402be1bc8f0f (props are still overridable if someone really needs SelfContained=false).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Native AOT deployment overview - .NET
Publishing your app as native AOT produces an app that's self-contained and that has been ahead-of-time (AOT) compiled to native code.
Read more >
Static libraries
When Native AOT building a dynamic library, this chore is performed automatically, because the .dll (or .so or .dylib) is built by the...
Read more >
Automatic native and managed DLLs extracting from Nuget ...
The trick is to create a targets file that will handle the DLL ... 6) With only native libraries in my package, the...
Read more >
[NET 7] NativeAOT-compiled static library is not exporting ...
I am trying to compile my managed code into a static library (.lib file on win-x64), so I can link against it from...
Read more >
Dotnet build linux. The answer you're looking for is basically
Props file is never loaded. dll would be faster still, but you may need to dotnet publish and run the dll from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found