1

Mac os x 上的 Xbuild [Xamarin Studio]

我正在尝试使用 xbuild 构建解决方案和(Visual Studio 项目文件)csproj。此解决方案包含一个项目 - 该项目不是启动项目,并且引用了 Newtonsoft [使用 xamarin 组件添加] 请注意该组件标记为“包含在此项目中”。

该解决方案和项目在 Xamarin 中构建良好,但是在删除整个解决方案及其文件时。现在使用团队城市下载项目,然后使用 Xbuild 构建相同的解决方案,项目都失败,并显示以下错误消息:

我已附加错误消息的快照

    [18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/EvidenceNotRequired.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/PhotoEvidence.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/TextEvidence.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/BoundedQuestion.cs(3,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/ExtendedInfoQuestion.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/InfoItem.cs(4,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/MultiResponseQuestion.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/Question.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/QuestionSet.cs(2,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

Xbuild 确实尝试验证AndroidPackage 路径,但是它找不到Newtonsoft.Json 包。

        Target _ValidateAndroidPackageProperties:

            GetAndroidPackageName Task

              ManifestFile: 

              AssemblyName: NESQuestionFramework

              PackageName: NESQuestionFramework.NESQuestionFramework

        Target _AndroidResolveAssemblyReferences:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:警告:参考'Newtonsoft.Json'未解决

            For searchpath {CandidateAssemblyFiles}

            Warning: {CandidateAssemblyFiles} not supported currently

            For searchpath {HintPathFromItem}

            Considered ../../Components/json.net-4.5.11/lib/android/Newtonsoft.Json.dll, but it does not exist.

            For searchpath {TargetFrameworkDirectory}

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.0.3, assembly named 'Newtonsoft.Json' not found.

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0, assembly named 'Newtonsoft.Json' not found.

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/, assembly named 'Newtonsoft.Json' not found.

            For searchpath {PkgConfig}

            Considered Newtonsoft.Json, but could not find in any pkg-config files.

            For searchpath {GAC}

            Considered Newtonsoft.Json, but could not find in the GAC.

            For searchpath {RawFileName}

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/Newtonsoft.Json' as a file, but the file does not exist

            For searchpath bin/Debug/

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json' as a file, but the file does not exist

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json.exe' as a file, but the file does not exist

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json.dll' as a file, but the file does not exist

解决这个问题的正确方法是什么。目前,我正在强迫开发人员登录服务器并使用 xamarin studio [我相信确实下载 Newtonsoft] 手动构建解决方案,并在以后每次使用 xbuild 运行它。非常感谢您的时间

拉杰什

4

1 回答 1

0

这有点旧,但我们使用的是 nuget 的 json.net (newtonsoft),它允许在解决方案上轻松运行 nuget restore。

作为一种解决方法,您可以从运行良好的 xamarin 工作室运行 mdtool(有一些限制)

于 2015-10-19T10:49:15.583 回答