Reputation: 5215
My VS 2010 solution has let's say 1 native C++ dll project and 1 c# wrapper project. What I want is a pure magic. My solution has 32 and 64 bit configurations, mostly because of native dll. I'd like to build the solution so that c# dll includes both 32bit and 64bit native dll as resources in c# dll. Then I will unpack proper bitness in runtime and use it (this is not a problem). My question is how do I configure VS solution to build both bitnesses and then put them into the C# project before it builds?
I could probably do a clever .msbuild script, but then I won't be able to build nicely from VS.
Upvotes: 1
Views: 155
Reputation: 4981
You can do the following:
</Project>
closing tag.<Target Name="BeforeBuild"> <MSBuild Projects=".\..\NativeLibrary.sln" Properties="Configuration=Release;Platform=x64"/> <MSBuild Projects=".\..\NativeLibrary.sln" Properties="Configuration=Release;Platform=Win32"/> </Target>
No, you can right-click on the project file in Solution Explorer and select Reload Project.
Also, you will need to add 32-bit and 64-bit *.dll files to resources. I have used this approach for a long time and it works perfectly. You can build your C# project from inside Visual Studio.
Upvotes: 1