简体   繁体   English

如何在同一解决方案下的两个项目之间共享数据

[英]How to share data between two projects under the same solution

I have two Windows phone projects under same solution one is of the type Background Audio Streaming Agent and the other one is Blank App (windows phone silverlight) I have a situation in which I need to share some data between these two projects 在相同的解决方案下,我有两个Windows Phone项目,一个是Background Audio Streaming Agent ,另一个是Blank App (windows phone silverlight)在这种情况下,我需要在这两个项目之间共享一些数据

NB: The second project contains a reference to the first project 注意:第二个项目包含对第一个项目的引用

I have tried 我努力了

Global variables (using static class) but found that the global variables are instantiated and are becoming null when used in the other project Global variables (使用静态类),但是发现在其他项目中使用时,全局变量已实例化并变为空

IsolatedStorage , found that the two projects are using separate IsolatedStorageSettings hence the keys and values used in one project is not available in the other.. IsolatedStorage ,发现两个项目正在使用单独的IsolatedStorageSettings因此一个项目中使用的keysvalues在另一个项目中不可用。

what else can i do ? 我还可以做些什么 ?

您可以将数据保存到中央数据库。

Create a third project that contains shared operations of the two. 创建第三个项目,其中包含两者的共享操作。 Make sure the methods that you need to use are public... 确保您需要使用的方法是公开的...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在解决方案中的项目之间共享PartialView? - Share PartialView between projects in a solution? 如何在解决方案中的其他项目之间共享单元测试? - How to share unit test between other projects in the solution? 如何在一个解决方案中共享源项目之间的许多二进制文件? - How to share many binary files between source projects in one solution? 如何在一个解决方案下整合两个不同的网站项目? - How to integrate two different website projects under one solution? 同一解决方案中两个ASP.NET Core项目之间的通信 - Communication between two ASP.NET Core projects in the same solution 在同一个解决方案中发布两个项目 - publish two projects in same solution 如何在两个网站类型项目之间共享文件 - How to share files between two web site type projects 如何在SpecFlow中相同解决方案中的项目之间共享相同的步骤定义 - How to share the same step definition across projects within same solution in SpecFlow 如何在项目之间共享常量? - How to share constants between projects? 如何在一个解决方案中从 2 个项目中的同一个 txt 文件中获取数据 - How to get data from same txt file in 2 projects in one solution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM