Visual Studio Xamarin: Could not connect to the debugger - c#

I'm working with Visual Studio Community 2015 Update 3 and the Visual Studio Emulator for Android (API Level 19). Everything works fine, but since last Xamarin update I can't deploy to Visual Studio Emulator.
I click on run at visual studio and it deploys the app to the emulator (I cann see it in app drawer), then it starts the app.
But the app closes immediately, and visual studio says at output:
Could not connect to the debugger.
Solutions I tried already (without success):
Enabled Migrate to a physical computer with a different processor version in Hyper-V settings
Disabled Use Fast Deployment in project settings
EDIT: On my real phone I can debug this app.
EDIT2: Here's the logcat output

I had the same problem and it's really frustrating!
I had the problem for both Visual Studio 2019 and Visual Studio 2022.
I tried literally every solution on the web, and none of these worked for me:
updating everything in Visual Studio to the latest version
updating every Android SDK and component
sending various adb commands via the ADB console (like: adb -s 10.0.2.2:5554 root)
#TienQuang solution in this post
restarting multiple times Visual Studio and Windows
deleting and recreating Android emulators images
I was really out of solutions to try, and then...I simply reset my emulator proxy configuration (the always worked fine) switching to the "default Android Studio HTTP proxy settings", and now I can debug my application!

I've had this problem before. My problem was that the emulator was old and could not load things properly and was really slow. I suggest upgrading to a different emulator or just using your phone for debugging. If you want, you could try running it in release and see if it runs then. If not create a new emulator from the AVD Manager.

Related

Xamarin android emulator on Visual Studio 2017 blacked out

So I'm trying my hand at making mobile apps using C# and Xamarin on Visual Studio 2017. What I'm trying to do is test out the system by making a simple application that has two buttons that either increment or decrements a number by 1 when clicked. Nothing fancy. But when I try to run the android emulator, it is just a black screen. Nothing loads. And when I "x" out of the emulator, I get a There were deployment errors. Continue? dialogue box when it's done.
I have searched all over for a solution, and nothing I've tried has worked so far.
Among the things I have tried:
Enabling virtualization in the BIOS settings.
Disabling "Use host GPU" in the AVD.
Change from Debug mode to Release mode.
Ticked "Wipe User Data" from the launch options.
Restarts and rebuilds along with "clean Solution" here and there.
I also tried using the Xamarin Live Player paired with my phone to no avail.
(Also, I have no drawable icon in my drawable folder under resources. Is that anything that's necessary??)
Here's a screenshot of my problem:
https://imgur.com/a/6OhCA
I'm using Visual Studio 2017 on Windows 7.
If you have JDK 9 installed you can try uninstalling it.
https://developer.xamarin.com/guides/android/troubleshooting/questions/jdk9-errors/#Known_Issues_with_JDK_9
This fixed the problem for me. I had JDK 9 installed and even if in my Xamarin options I was pointing to JDK 8 folder, it was messing up my deployment.

Visual Studio crashes when launching SharePoint add in

My visual Studio 2017 community keeps freezing and i get the error message not responding when i deploy a Provided hosted add in to SharePoint. I can run all other types of projects that i have tried without any problems. I have a newly installed windows with just a few programs on it. I can run a console application to my SharePoint online without any problems. So i guess SharePoint isn't the problem.
What i have tried:
Reinstall windows
Reinstall Visual Studio
Reinstall ISS
Update Visual Studio
Update windows
Disable some debug options (Read online that might help)
And some minor things
I appreciate any help/tips i can get everything is helpful at this point.
i had same problem and i figure out its firefox problem, so when i uninstall firefox, problem solved for me,
may be it help you as well.
Same issue for me, you need to change the default browser from "Start Action" to "Internet Explorer" in the Add-in project properties pane.

Visual studio Xamarin not hitting breakpoints

I have installed VS 2017, version 15.3.3, breakpoints are working perfectly on web asp mvc projects but not working on xamarin projects, either: PCL, Android or iOS.
(I am on Debug mode) everything is installed in its default setting, I have not changed any project options
If you are debugging with the Android emulator, you might need to tick "migrate to physical computer with a different processor version" under Hyper-V manager -> Image -> Settings -> Processor -> Compatibility. This resolves random app crashes and also allows debugging from visual studio to work.
I've had this issue before, and restarting Xamarin Studio / deleting the app and cleaning/rebuilding/reinstalling worked.
I Solved it,
checked checkboxes was unchecked, now it's working

Visual Studio 2013 Hangs on WinCE Deployment for C++ App not C#

Have a weird behavior in Visual Studio 2013 Community Edition Update 5 when I try to deploy an application on my Windows Embedded Compact 2013 device. In my solution I have a C++ and a C# project, both for my WinCE device. When I press BUILD -> "Deploy myApp" it works for the C# application perfectly but for the C++ project VS 2013 just hangs. In the left bottom corner I see "Deploy started..." and that's it. Even after 15 minutes nothing changed, no error message. I have to close VS with the Task Manager.
On another computer I can deploy both projects. Same configuration, add-ins and plugins.
Deployment is over TCP/IP.
What I tried so far:
Repair VS 2013
Reinstall VS 2013 with Update 4
Reinstall WinCE SDK
Anybody any idea where I should look or what I should test?
This happens also on some of my machines.
The only solution I found is to set the target IP address into the project properties (in the debugging tab) before download.
In this way Visual Studio will not ask for the IP and everything* works.
*everything debugging related, at least :)

Xamarin iOS debugging takes forever, doesn't load the simulator

I started some tests using Visual Studio 2015 and Xamarin for iOS. The latest version of Xamarin build server is set up and running on my new Mac Mini, Visual Studio 2015 is updated and running the latest version of Xamarin.
Now, when I compile a standard Universal app, it is done within 3 seconds or so. But when I hit Debug, the server log says it is handling requests, but the simulator doesn't show up, nor any message on the Mac.
After an endless list of:
Request handled in X.XXXms
(usually in steps of approximately 2 seconds)
it stops debugging after a few minutes without any message on the Mac or in Visual Studio.
What is wrong with my debugging? Is it a problem with Visual Studio, the Mac, Xamarin?
The problem was that Visual Studio was set to debug a Device, not the Simulator.
Somewhere in the build log it says:
Waiting for device 'Device' to connect.
This is an stupid mistake obviously, but the fact that there isn't any message, nor a pointer to connect the device correctly or what is actually wrong, makes it very hard to find the problem.
So, instead of Device, set the debug target to the Simulator:

Categories

Resources