Xamarin - 使用 xbuild 构建一个添加了 xamarin componenet 的项目



Xbuild [Xamarin Studio] on mac os x

我正在尝试使用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运行它。非常感谢您的时间

拉杰什

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

作为解决方法,您可以从Xamarin工作室运行MDTOOL,该工作室运行良好(有一些限制)

相关内容

  • 没有找到相关文章

最新更新