29

I have just upgrade my windows phone 8 to windows phone 8.1. When I connect my phone to pc and run my project it gives me

a specified communication resources(port) is already in use by another application.

I restarted my PC and Phone, removed all connected external devices but still getting same error while running my code through Visual Studio 2012.

I can see it's deployed on phone but I can't debug it. Debugger is not attaching.

Here is my screen shot:

enter image description here

user229044
  • 232,980
  • 40
  • 330
  • 338
Ajay
  • 6,418
  • 18
  • 79
  • 130
  • Yeah. But when I run app from VS2012 on windows phone 8.1 device, I can see it's deployed on phone but I can't debug it. It shows above error. – Ajay May 14 '14 at 06:29
  • yeah it run without debugger. – Ajay May 14 '14 at 08:34
  • 1
    @Romasz I didn't get **Target Windows Phone 8.1 OS Version** in Project property. – Ajay May 14 '14 at 08:49
  • Ok - now I understand - you updated your Phone, not the App, sorry for confusion. Then my comment is inadequate - cleaning. Are you able to deploy other app with VS2012 and debug it? – Romasz May 14 '14 at 08:53
  • As I've tried, I'm able to deploy new App with VS2012 on WP8.1 and debug it. Also, as I remember I sometimes had similar problem few months ago - it was quite weird because the problem was connected to 2 of 4 usb ports. Have you tried with different USB port? – Romasz May 14 '14 at 09:22
  • I have tried on all ports even I change my USB cable and then tried but still getting error. I will try it once again – Ajay May 15 '14 at 04:45
  • It looks like a special case - I'm run out of ideas. – Romasz May 15 '14 at 07:57

8 Answers8

17

We need to update visual studio 2012

Go to Tools->Extensions and update->updates and update the visual studio update 4

jee
  • 524
  • 4
  • 7
7

You may need to deploy the app on the phone before debug mode can be ran. Right click the project and select Deploy. Use this link to see more detailed information.

Lukkha Coder
  • 4,421
  • 29
  • 25
6

A specified communication resources(port) is already in use by another application

This is a generic error for any failure when Visual Studio attempts to connect it's debugger. There is no silver bullet solution to this problem. The problem persists in Visual Studio 2013, and on Windows Phone 8.1. You'll often notice that the application is actually deployed, but the debugger just couldn't attach itself.

However, uninstalling anything is never a correct solution to this problem.

Now, generally the following options can fix the 'problem' (sometimes one or more are required):

  • Unplug, and re-plug the USB cable
  • Uninstall the application from the phone and redeploy from Visual Studio
  • Redeploy from Visual Studio
  • Restart the phone
  • Restart Visual Studio

Bad USB cables or USB ports can also cause this issue.

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
  • I tried all these options but getting same issue. I notice that the application is deployed on phone. If I run the same solution from VS2013 all works fine. – Ajay May 07 '14 at 14:54
  • Is it possible to access the sort of "advanced" controls of the debugger? E.g You can attach to a running process on your own machine but can you see what processes are currently debugged and manually add/remove them? That might help here, may require the remote debugging tools though – sturrockad May 14 '14 at 09:55
5

I had exactly the same problem. In my case installing Update 4 RTM for VS 2012 helped and I could once again debug my apps (previously, I had Update 4 RC installed). However, the error still appears if I open VS 2012 and VS 2013 side by side - if only one of them is open at the time then the error won't pop up.

Updating to Vs2012 Update 4 RTM, then we can debug on Phone

Piotr
  • 61
  • 1
  • 1
    I got solution to this problem i.e. we must have **VS2013** to run app on `windows phone 8.1`. Once you setup vs2013 you can easily start debugging on windows phone 8.1 – Ajay Apr 21 '14 at 04:59
  • @AjayPunekar I have the same issue , i'm formatted my pc even cleaned my wp 8.1 curretly im downloading VS2013 , i hope this will fix the issue right . Hoping so , thank u very much – Eldho Jul 12 '14 at 14:50
  • I also suffered the same problem in VS2012 debugging a 8.0 app on a 8.1 phone. I overcame the problem just by using VS2013 (I didn't need to upgrade app to 8.1). – Nick Wright Sep 19 '14 at 10:47
4

Project GUID conflict

Yet another possible reason for this error is the Project GUID conflict. If the project / app GUID of the application you are trying to debug is the same as the GUID of another application installed from the store (can be the same application, and doesn't matter if you already uninstalled it), this error may occur.

I was testing in-app purchases for my app for which purpose I had to change the app GUID in WMAppManifest.xml and AssemblyInfo.cs to the GUID from the Windows Phone Store. Having the app installed from the store itself (for testing purposes) previously, I uninstalled it for the purpose of debugging. Yet that didn't help and anytime I changed my app GUID to match Windows Store App Guid I got this error. Changing the GUID back to the original project's GUID caused the error to go away and debugging was working well again.

VS2013 Ultimate Update 2, testing with 8.1 Device.

Miloš
  • 557
  • 5
  • 8
2

If you're getting this error when trying to debug a Xamarin App targeting a Windows Phone emulator, make sure you have Deploy ticked for the WinPhone project:

Solution > Properties > Configuration Properties > Configuration

enter image description here

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
1
  1. Close VS
  2. Delete the files from C:\Users\Luke\AppData\Local\Microsoft\Phone Tools\CoreCon
  3. Open VS and hopefully you can deploy

Source: @Stadler (https://connect.microsoft.com/VisualStudio/feedback/details/772570/wp8-emulator-a-specified-communication-resource-port-is-already-in-use-by-another-application)

Luke
  • 2,851
  • 1
  • 19
  • 17
-1

@Ajay, I have ran into exactly the similar problem after upgrading my device to phone 8.1

I have two different machines, Machine1 runs VS2012 Premium with update 3, it prompted for update 4, but some unknown reason I cannot get this update installed on that machine. Machine2 runs VS2013 Professional with Update 1. After deploying an app to 8.1 device, Machine2 can run the debugger successfully, but Machine1 pops the aforementioned error window. I tried @LukkhaCoder approach, but it didn't help.

Edit: You have to run your code in VS2012 update 4 or VS2013 to debug in a 8.1 device.

mesbahuk
  • 272
  • 1
  • 2
  • 11
  • 1
    I got solution to this problem i.e. we must have **VS2013** to run app on `windows phone 8.1`. Once you setup vs2013 you can easily start debugging on windows phone 8.1 – Ajay Apr 21 '14 at 04:56
  • Just as I thought, thanks @Ajay for clearing the issue. – mesbahuk Apr 22 '14 at 13:48