PCLStorage in Windows Phone 8

为君一笑 提交于 2019-12-12 10:12:46

问题


I'm using PCLStorage for a Win8/Wp8 project I'm working on. I'm using it within a PCL itself, and have it referenced in my Win8, Wp8 and PCL projects. Everything is working great in Win8.

In Wp8 however, once I hit my PCL for storage which uses PCLStorage, I'm getting a NotImpmlementedException when I call FileSystem.Current;

"This functionality is not implemented in the portable version of this assembly. You should reference the PCLStorage NuGet package from your main application project in order to reference the platform-specific implementation."

But like I said, I have the PCLStorage NuGet package referenced in my Wp8 project AND the PCL project the same way I do in my Win8 project.

Any idea what's happening?

(I should also note that PCLStorage is working fine if I use it in a new Wp8 project)


回答1:


Try uninstalling the PCLStorage NuGet package from all projects and then reinstalling it in all of them.

If it still doesn't work, try checking the references to the PCLStorage DLLs in the WP8 project and make sure they are coming from the wp8 folder in the package.

If that doesn't lead anywhere, try setting copy local to false in the references from your PCL to the PCL Storage DLLs. If you have to do that it's an issue that needs to be fixed, so please file a bug for it.

EDIT: There is a bug in VS 2013 Update 2 RC that can cause this problem. This NuGet package is supposed to fix the issue if you reference it in your Windows Phone app: SuppressPackagingPclFacades. Alternatively setting Copy Local to false for the reference from your PCL library to the PCL Storage assemblies should also fix the issue.



来源:https://stackoverflow.com/questions/22052472/pclstorage-in-windows-phone-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!