-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
NativeAOT publish fails to statically link WmiLight when it is packaged in a dependent library #14
Comments
Hi @danielo-unity3d, this does not work, because the It hink you have the following options:
|
@danielo-unity3d Do you still need help? |
Martin, thanks for taking a look. |
If the application is trimmed (
|
It works in my case. I do not get any exception. Can you please check my test project and tell me the difference? |
oh, you mean without NativeAOT? |
We will follow this bug at #15 |
@danielo-unity3d Please try to enable the Please give me some feedback. |
Just adding
Sorry, that's with Now, I'm seeing:
And this is issue #11 If I add the |
@danielo-unity3d I think i have found a way to fully remove the COM stuff. But I have to be carefull to don't change any return type. Therefore it will take some time. |
@danielo-unity3d Please give Version 6.0.0 a try. This version should work in all deployment cases. |
... rather than when used directly in the main program.
Note: I am using dotnet 8.0.202
Actually, the only reason I was eventually able to get a simple WmiLight program to work, was by setting
PublishWmiLightStaticallyLinked
to true in the main project.Unfortunately, I don't seem to be able to get this to work when the WMI code is in a dependent library (setting the attribute either in the main project or library project has no discernable impact).
Steps:
dotnet new globaljson --sdk-version 8.0.202 --force
dotnet new console -n Main
dotnet new classlib -n Lib
dotnet add Main reference Lib
dotnet add Lib package WmiLight
We set
IsAotCompatible
(or justIsTrimmable
) in bothMain
andLib
, but we setPublishAot
in theMain
project alone (I don't think the latter have any effect if set in the library).Sadly, setting
PublishWmiLightStaticallyLinked
in either theMain
, theLib
, or both, has no effect.The code in
Lib/ClassLib.cs
:The code in
Main/Program.cs
:The command to
publish
:and to run:
But the
WmiLight.Native.dll
is never substituted for the static library.Thanks for your help.
The text was updated successfully, but these errors were encountered: