gpt4 book ai didi

iphone - 是否可以使用 Microsoft 管理的 EWS 通过 MonoTouch 构建 iPhone 应用程序?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:26:30 24 4
gpt4 key购买 nike

我正在尝试使用 Microsoft EWS 托管 API 构建 iOS 应用程序。我已经从 http://www.microsoft.com/download/en/details.aspx?id=13480 下载了 msi并将DLL复制到解决方案文件夹下。在为模拟器构建时,它构建并运行良好,但在尝试以物理设备为目标时,mtouch 失败并显示:

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -v --nomanifest --nosign -dev "/Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Users/Projects/HelloMonoTouch/MyEWSApp/ThirdParty/Microsoft.Exchange.WebServices.dll" -linksdkonly -sdk "5.0" "/Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.exe"
Framework is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
Copied /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.exe to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/MyEWSApp.exe
Copied /Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/mscorlib.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/monotouch.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/System.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Security.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/Mono.Security.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/System.Core.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/System.Xml.dll
Copied /Users/Projects/HelloMonoTouch/MyEWSApp/ThirdParty/Microsoft.Exchange.WebServices.dll to /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app/Microsoft.Exchange.WebServices.dll
Linking SDK only for assembly /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.exe into /Users/Projects/HelloMonoTouch/MyEWSApp/bin/iPhone/Release/MyEWSApp.app
Could not link assemblies: System.IO.FileNotFoundException: Could not resolve: System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0
at Mono.Linker.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00000] in <filename unknown>:0
at Mono.Linker.LinkContext.Resolve (IMetadataScope scope) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.LoadReferencesStep.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0
at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
at MonoTouch.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
mtouch exited with code 1

我努力补充:

System.DirectoryServices.dll
System.Configuration.dll
System.Security.dll
System.DirectoryServices.Protocols.dll
System.EnterpriseServices.dll

随着越来越多的感觉不在正确的轨道上,但是当 mtouch 提示原生 System.EnterpriseServices.Wrapper.dll 时,我放弃了。

我尝试使用项目选项/iPhone 构建 SDK 和链接器选项。

我还尝试了 32 位和 64 位版本的 Microsoft.Exchange.WebServices.dll

附言我知道我可以在没有托管 EWS API 的情况下使用 EWS,但是编写和解析所有这些 XML 请求和响应是一件很痛苦的事情。

最佳答案

MonoTouch 的链接器和 AOT 编译器在工作时都需要存在所有依赖项。这一点,以及缺少的符号(类型、方法...),使得很难(但并非完全不可能)从另一个版本的框架中重新使用预构建的二进制文件。

它还解释了为什么这有时(没有丢失的符号)可以在模拟器上工作。默认情况下,模拟器build设置为“不链接”(无链接器)并使用JIT(无 AOT)。这使得丢失的引用/符号不会被注意到……直到(可能永远)不需要它们。

您可以关闭设备构建的链接器 - 但这对 AOT 编译器没有帮助。 OTOH 您可以尝试 满足链接器的要求,它可以 能够删除足够多的代码,让AOT 编译器正常工作。遗憾的是,当事情归结为 native 代码时,例如 System.EnterpriseServices.Wrapper.dll,您的选择变得更加有限。

关于iphone - 是否可以使用 Microsoft 管理的 EWS 通过 MonoTouch 构建 iPhone 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8232914/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com