以下是环境:
- Base Library (.NET 4.5, SL4, WP 7.5, Win App Store);
- Main Library (.NET 4.5, SL4, WP 7.5, Win App Store): - Windows Azure Mobile Services v 1.0.1 Package;
当我试图在调试中运行测试项目时,会收到以下错误消息:
找不到当前平台的Windows移动服务程序集。确保当前项目同时引用Microsoft.WindowsAzure.Mobile和以下特定于平台的程序集: Microsoft.WindowsAzure.Mobile.Ext。
这种情况发生在以下几行:
private IMobileServiceClient _mobileService = new MobileServiceClient(
"TheUrl",
"TheKey"
);由于我已经在两个项目(主库,Test )上安装了这个包,我无法理解我与错误消息有什么关系,有光吗?
发布于 2015-10-13 04:50:26
是的,这个花了我一些时间才找到,但它是最明显的位置:https://components.xamarin.com/view/azure-mobile-services/
这家伙也搞定了:http://blog.csainty.com/2013/12/quick-tip-azure-mobile-services-xamarin.html
Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();。CryptographicException项目中遇到使用此组件的Xamarin.Android,请注意,只有在打开所有错误或Xamarin中的等效内容时才会发生这种情况。异常发生在mono基础结构中,并且会自动捕获和处理,不会影响您的应用程序。发布于 2014-01-28 11:17:55
在您的测试项目中,您应该创建一个IMobileServiceClient模拟,然后设置您期望的模拟操作。试着看看Rhino Mock,看看如何对接口进行测试
private IMobileServiceClient client = MockRepository.GenerateMock();发布于 2015-12-19 22:52:20
确保在您的CurrentPlatform.Init()函数中调用AppDelegate。IOS似乎是唯一需要该特定调用才能工作的平台。此外,我还得到了使用System.RunTime、System.Threading等的多个程序集引用的错误,在这些引用中,我需要消除这些引用以避免歧义。
https://stackoverflow.com/questions/18091610
复制相似问题