Markus Ewald schrieb:
[quoted text, click to view] > Peter Foot wrote:
>> A C# project will copy any .dll files you reference to the output
>> directory if they are not part of a known distribution package (such
>> as the .NETCF libraries themselves). If you want to add a resource
>> file or native dll add it to your project and set the BuildAction
>> property to "Content". Set the Copy to Output Directory to "Copy if
>> Newer". Now your project will deploy the native dll to the same folder
>> as your .exe
>>
>
> Thanks, that's a nice solution!
> [...]
Well, I got the Release/Debug issue solved by manually inserting a
Condition into the ItemGroup in the .csproj file. Visual Studio seems to
handle it just fine. I'm linking the files directly from the C++ DLL's
target directory, so my build process is now also free of any
Pre-/Post-Build steps =)
The only annoyance is an inconsistency in the behavior of Visual Studio
between .NETCF 2.0 and .NET 2.0 builds:
- if I add a link to MyLibrary.Native.dll into my MyLibrary.dll project
under .NET 2.0, Visual Studio will copy it to the output folder of all
depending projects (in other words, I'll find MyLibrary.Native.dll in
the output folder of MyApplication if MyApplication references MyLibrary)
- if I do the same under .NETCF 2.0, MyLibrary.Native.dll will only be
copied into the output folder of the project containing the link (so
I'll find MyLibrary.Native.dll in the output folder of MyLibrary, but
not in that of MyApplication)