同一 Visual Studio 解决方案中的 Monodroid、WP7 和 WinForms
我正在使用 Android(Monodroid)、iPhone(MonoTouch)、WP7 和 Windows 开发一个跨平台应用程序,并希望使我的代码库尽可能保持一致。 iPhone 需要一台 Mac,这很好,我可以处理,但 Android 允许在 Visual Studio 中进行开发,这很棒,因为我可以在一个解决方案下管理三个项目。
现在,将新的 Android 项目添加到新的 Visual Studio 解决方案中将允许我在模拟器中正常部署。新的解决方案和新的 WP7 项目以及相应的模拟器也是如此。
我遇到的问题是,如果我先使用 WP7 项目设置一个新的解决方案,然后向该解决方案添加一个新的 Android 项目,我将无法启动 Android 项目,因为即使我将 Android 项目设置为活动状态,它也始终默认为 WP7 模拟器项目。
据我所知,我认为 VS2010 将允许解决方案使用模拟器,但不允许解决方案中的每个项目使用模拟器。有人遇到过这个吗?有没有办法通过命令行解决?一种解决方法是同时打开两个视觉工作室,但我试图尽可能避免这种情况。
问题根源已被识别并解决
在同一解决方案中,不要为不同的项目类型可执行文件提供相同的名称,因为这会导致 Visual Studio 在确定选择哪个模拟器时出现问题。我更改了解决方案中每个项目的启动应用程序的名称,一切正常。
原始:
Solution\Android\MyProject
Solution\WinPhone\MyProject
修正:
Solution\Android\MyProject1
解决方案\WinPhone\MyProject2
I am developing a cross platform application using Android(Monodroid), iPhone(MonoTouch), WP7 and Windows and would like to keep my code base as coherent as possible. The iPhone requires a Mac which is fine I can deal with that but Android allows development in Visual Studio which is great as I can manage three projects under the one solution.
Now adding an new android project to a new visual studio solution will allow me to deploy in the emulator just fine. Same goes with a new solution and new WP7 project and corresponding emulator.
The issue I have is that if I setup a new solution with a WP7 project first and then add an new android project to the solution I cannot launch the android project as it always defaults to the WP7 emulator even when I set the android project to active project.
From what I can gather I think VS2010 will allow an emulator for the solution but will not allow an emulator per project within the solution. Has anyone come across this? Is there a work around maybe via command line? One workaround would be to have two visual studios open at the same time but I am trying to avoid that if possible.
Source of the problem has been identified and solved
Within the same solution don't give different project type executables the same name as this causes Visual studio a problem when determining which emulator to select. I changed the names for my launching apps for each project within the solution and everything works fine.
Original:
Solution \ Android \ MyProject
Solution \ WinPhone \ MyProject
Fixed:
Solution \ Android \ MyProject1
Solution \ WinPhone \ MyProject2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以通过“部署”设置来控制。尝试在解决方案配置管理器中禁用 WP7 项目的部署。
This might be controlled via the "Deploy" setting. Try disabling Deploy for the WP7 project in your solution configuration manager.