简体   繁体   English

Xamarin-forms Visual Studio 2015-无法调试应用

[英]Xamarin-forms Visual Studio 2015 - Failing to debug app

I'm new to Xamarin. 我是Xamarin的新手。 I am trying to debug my first Cross platform application but I keep getting the error in Visual Studio 2015 我正在尝试调试我的第一个跨平台应用程序,但我在Visual Studio 2015中不断收到错误消息

"A project with the Output Type Class Library cannot be started directly. “带有输出类型类库的项目无法直接启动。

In order to debug this project, add an executable solution to this solution which references the library project. 为了调试该项目,请向该解决方案添加可执行解决方案,该解决方案引用库项目。 Set the executable project as the start up project. 将可执行项目设置为启动项目。 "

Any help on how to fix this? 任何有关如何解决此问题的帮助?

In Visual Studio go to your Solution Explorer. 在Visual Studio中,转到解决方案资源管理器。 Notice how one project is printed in bold and the other ones are not. 请注意,一个项目是如何以粗体打印的,而其他项目则不是。

粗体印刷项目

This means that this project is te one that is going to be ran when you hit the debug button. 这意味着该项目是您在单击调试按钮时将要运行的项目。 In your case, a project which produces a DLL is selected as startup project. 在您的情况下,选择一个生成DLL的项目作为启动项目。 As you may know, a DLL cannot run by itself. 您可能知道,DLL不能单独运行。 Right-click the project you want to debug (so either your iOS, Droid or Windows project) and choose 'Set as startup project' from the menu. 右键单击要调试的项目(因此是iOS,Droid或Windows项目),然后从菜单中选择“设置为启动项目”。

设置为启动项目

You can also do this from the toolbar in the upperside of the screen. 您也可以从屏幕上方的工具栏中执行此操作。 Next to the configuration dropdowns, you can also select which project should be the startup project. 在配置下拉菜单旁边,您还可以选择哪个项目应该是启动项目。

Additionaly; 额外的; if you right-click the solution file, you can select multiple startup projects at once. 如果右键单击解决方案文件,则可以一次选择多个启动项目。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM