开发者

How do I make the MSBuild task in Mono's xbuild use the .NET 3.5 framework?

I'm trying to build a MonoTouch project using xbuild (on a Mac, clearly). Here's my xbuild project:

<Project DefaultTargets="Application" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <ApplicationProjectFilePath>..\TestApp\TestApp.csproj</ApplicationProjectFilePath>    
        <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
        <MonoTouchReferencePath>/Developer/MonoTouch/usr/lib/mono/2.1/</MonoTouchReferencePath>
    </PropertyGroup>

    <Target Name="Application">
        <MSBuild Projects="$(ApplicationProjectFilePath)" Targets="Rebuild" Properties="Configuration=AdHoc;Platform=iPhone;ReferencePath=$(MonoTouchReferencePath)" ToolsVersion="3.5"/>
    </Target>
</Project>

When I run this, I get the following warning:

/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/3.5/Microsoft.Common.targets:  warning : Found a conflict between : 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' and 开发者_JS百科'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' reference.

How can I have xbuild reference v3.5 of the framework? As you'll see from the script, I've tried a number of approachs, none of which seem to be working.

[Also, I'm not sure why I have to explicitly reference the monotouch.dll library - given that it's referenced in the project file (TestApp.csproj). Any comments on that would also be appreciated.]


MonoTouch uses a superset of the Silverlight framework, not 3.5, and there are currently no xbuild targets for MonoTouch and its framework version. Implementing this will require custom targets that override framework assembly resolution, like the Silverlight and MonoDroid targets.

For now, I suggest you use the build command of MonoDevelop's commandline tool, mdtool, i.e.

/Applications/MonoDevelop.app/Contents/MacOS/mdtool build
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜