Note that there are some explanatory texts on larger screens.

plurals
  1. POBuilding a (non-PCL) Monotouch or .net dll from a single .csproj
    text
    copied!<p>Code reuse across .NET and Monotouch has been addressed in many ways, but most techniques involve parallel sets of projects/solutions. </p> <p>I'd like this question to clarify whether it is possible to build, using a single csproj file, <em>either</em> a .NET or a MonoTouch version of the same assembly, based on the selected Platform and Configuration.</p> <p>Assume the following:</p> <ol> <li>The build machine runs Windows.</li> <li>Visual Studio and MSBuild are available.</li> <li>The method does not need to work on MonoDevelop, since MonoDevelop currently does not have XBuild/MSBuild turned on for MonoTouch.</li> <li>The MonoTouch binaries from a valid MonoTouch installation are available.</li> <li>Only a library needs to be built, not a full app. This library: <ol> <li>Does not contain any .xib's or plists.</li> <li>Does use platform specific code, which will be conditionally compiled.</li> <li>Does reference platform specific assemblies (necessarily), and these need to be handled by the .csproj file.</li> </ol></li> </ol> <p><strong>Question</strong>: Given these assumptions, can the library be </p> <ol> <li>Compiled for Windows .NET or </li> <li>Compiled for direct referencing by a MonoTouch app solution after the <strong>binary</strong> is copied to a Mac.</li> </ol> <p>based on the current Visual Studio Platform and Configuration?</p> <p><strong>Current Research</strong></p> <ol> <li>The fact that Portable libraries compiled on Windows can be consumed by MonoTouch solutions gives some hope that this is possible.</li> <li>The use of <code>&lt;NoStdLib&gt;true&lt;/NoStdLib&gt;</code> in the .csproj while building for MonoTouch, together with different <code>HintPath</code>s for System, System.Core, System.Xml etc seem necessary.</li> <li>Unsure about how to reference the correct version of mscorlib while building for MonoTouch.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload