0

In my .NET MAUI project, I need to use a native interop DLL. Following an example on the Internet, I defined the following in my .csproj file:

  <ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
     <NativeReference Include="External\MyInterop.dll" />
  </ItemGroup>

However, when I build the solution from within VS 2022, the file MyInterop.dll is not getting copied to the location where the .exe is created.

What is it that I am missing?

3
  • Does it work if you remove the Condition? It's possible that this condition would only apply during a publish, but not during a normal build. Commented Oct 2 at 6:20
  • It doesn't work even without the condition. :-( Commented Oct 2 at 16:47
  • I have never used this <NativeReference> tag, so I don't know how it works exactly. Since you're apparently running on windows, you can try to just use a post-build-step instead. Commented Oct 2 at 17:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.