Visual Studio 部署错误

Visual Studio 部署错误

问题描述:

无法启动应用程序进行调试.请确保设备已解锁."

"The application could not be launched for debugging. Please make sure the device is unlocked."

当我尝试在我的设备上启动应用程序进行调试时出现此错误.

I am getting this error when I try to launch the app on my device for debugging.

我尝试了以下方法:重新启动 Visual Studio,重新安装 Visual Studio,重启我的电脑,我在配置窗口中选择了调试和发布.

I have tried the following: Relaunch Visual Studio, Reinstall Visual Studio, Restart my computer, I have selected both debug and release in the configuration window.

问题是它甚至在模拟器中也没有启动.模拟器打开并从不加载应用程序,但给出相同的错误消息.我试图在 VS 上打开一个新应用程序并尝试运行默认应用程序.这也带来了同样的问题.

The problem is that its not getting launched even in the emulator. The emulator opens and never loads the app but gives the same error message. And I have tried to just open a new application on VS and tried to run the default application. That also gives the same problem.

我又打开了几个项目供参考后一切正常,突然开始出现此错误消息.

Everything was working fine after I opened a few more projects for reference, It suddenly started giving this error message.

这个答案对我有用.

在以下情况下:

Solution(Right-click) > Properties > Configuration Properties > Configuration

确保您的主项目设置为部署".

Ensure that your main project is set to 'Deploy.'