-
|
I'm doing some MSBuild & NuGet acrobatics by packaging native library binaries and build files to make the consuming project use those binaries. Until the static-linking part in NativeAOT. My idea was to add to Excerpt: <!--- Package.targets file, which should be imported via generated '*.nuget.g.targets' -->
...
<Target Name="NativeFilesToCopy"
DependsOnTargets="PrepareNativeProps"
BeforeTargets="BeforeBuild">
<ItemGroup>
<DirectPInvoke Include="package" />
<NativeLibrary Include="$(NativeFilesPath)\package.lib" />
</ItemGroup>
...The linker doesn't see the It seems like the package's build files are not used, only the project file. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
What you’re running into is a common timing/target ordering issue in MSBuild with NativeLibrary items. The key points:
Suggestion: Moving NativeLibrary inclusion out of a Target and into a statically evaluated ItemGroup (or an earlier target) is what allows the linker to find your library. |
Beta Was this translation helpful? Give feedback.
-
|
It seems either |
Beta Was this translation helpful? Give feedback.
It seems either
Publishtarget and/ordotnet publish(which I know does-restore(not target)) will not evaluate currently restored packages for additional packages (will only restore from empty).