/linkresource is a csc option that allows to link an assembly to its unmanaged dependencies. When the managed assembly is added to the GAC, the dependencies are placed in th
I managed to get this to work in vs2010 albeit with warnings.
1) Override CoreCompile to add LinkResources
2) Add a target to get the equivalent of Copy Local on anything added as
3) If the project containing the native libraries/file only contains those files, add a type/interface. Use this type in the project using the references. I.e. the project where you use DllImport. The prevents the compiler optimising out the project dependency.
4) Tack on Alex Yakunin's trick to copy project dependencies.
This pulls all the dependencies into my $(TargetDir) ready for debugging.
In the project files I import the magic after the regular targets files ala
And I have a CopyDependencies.targets as follows:
$(NoWarn);1701;1702
$(MsBuildToolsPath)
$(AppConfig)
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
true
true
true
true
$(CoreBuildDependsOn);
CopyDependencies;
CopyLinkedResources