When debugging in Xamarin, it does not stop at breakpoints - c#

I am developing an app using a combination of Visual Studio 2022 Community, Xamarin.Forms and Android.
In debug mode, I am placing breakpoints, but they do not stop.
Is there something I need to configure?
Start Visual Studio 2022 on Windows 10 and Windows 11.
Create a Xamarin.Forms application.
Launch debugging.
This project was created in Visual Studio 2019.
Visual Studio 2019 can stop at breakpoints when debugging.
There was no "Use Shared Runtime" item in the Android Options in Visual Studio 2022 Communitey.

At first, you can check the official ducument about the issue.
Official document: https://learn.microsoft.com/en-us/visualstudio/debugger/troubleshooting-breakpoints?view=vs-2022
And then, if the issue is still here, you can try to enable the Use Fast Deployment. If you need more information, please check the following links:
Similar issue on the Github: https://github.com/xamarin/xamarin-android/issues/6480
Similar issue in the Visual Studio Community:https://developercommunity.visualstudio.com/t/Breakpoint-not-hit-debugging-Xamarin-And/1561025

"Use Fast Deployment" helps

Related

Getting visual studio to show the same API as Unity Hololens Development

When developing a Hololens UWP application using Unity 2017.2, the code completion in Visual Studio (2017) does not match what is available.
The dev environment is set up as described here.
The UWP (Hololens) build uses a subset of the API. Visual studio code completion does not match this.
How do you set visual studio up correctly for this development?
IntelliSense should work normally when the dev environment is setup as described. Usually one of the following helps:
Restart Visual Studio and open the project again
Turn off Resharper if you have it enabled
Ensure you have a using statement for the namespaces for which you want IntelliSense
If none of these options helps, you can try reinstalling again according to the instructions.

Xamarin Studio: Does not display the list for to create C# Android project

I am try use Xamarin Studio for Android. But, when i click File->New->Project... i don't see C#: Android application.
How to fix it? Thanks!!
As said here: The Cycle 7 version of Xamarin Studio on Windows requires both Microsoft Build Tools 2013 (or Visual Studio 2013) and Microsoft Build Tools 2015 (or Visual Studio 2015) to be installed.
You will need to update yours.
As a personal suggestion. Since you are using Windows I recommend to use Visual Studio Community. Its free and recommended by Xamarin.
To complement the answer I will quote what #MattWard said in the comments:
Xamarin.Android is included in Xamarin's universal installer but it is
also included in the Xamarin.VisualStudio.msi (note that even though
it says Visual Studio it does not require it to be installed). These
are available from your account page
Have you installed the Android SDK?

Visual Studio 2008 Design View not working?

I download visual web developer 2008 to develop seilver-light apps BUT I faced problem!
Why design view not appear in visual studio web developer 2008 :( !! just xaml window appears !!
I tried by repair and re-install it also I see some solutions which not obvious! as:
Visual Studio 2008 Hangs in Design View with ASP.Net web pages
Visual Studio 2008 - html not updating with design view
It's possible that Visual Studio had failed to load one or more packages in the past. To reset:
Quit Visual Studio
Run devenv /resetskippkgs from a Visual Studio Command Prompt.
Source: Accepted answer on No xaml designer in vs2008
For anyone else on Windows 8.1 having trouble finding the Visual Studio Command Prompt, check out Where is Developer Command Prompt for VS2013?

Debugging asynchronous ASP.NET WebAPI controller shows "No tasks to display" in Tasks window

I'm trying to debug some asynchronous code using the Tasks window (Debug -> Windows -> Tasks), but when I break on a line within an async method using a breakpoint the Tasks window shows "No tasks to display".
My project is a WebAPI project running in IIS Express on a Windows 8.1 machine in Visual Studio 2013.
I've seen this question which is very similar, but the answer given here is that it needs to run on a windows 8.1 machine rather than Windows 7... but I am running 8.1!
I've tried creating a basic console application, setup a very simple asynchronous app and debugging that, and it works perfectly ok there... so what am I doing wrong? Why doesn't it work in my WebAPI project?
Using Visual Studio 2017 15.6 or above can solve this problem.
This problem was a known issue and it can be found here on Developer Community The status tag confirms that the issue was fixed in Visual Studio 2017 15.6 preview 1 and Visual Studio 2017 15.6. I was trying to find an official announcement for fixing this issue in the official release note and their official blog but found none.
Visual Studio Blog, Official Release Notes
With the latest version, this should be no longer an issue.

Working with Unity3D and Visual Studio 2013

how do i get Unity3D for debugging the code, and Visual Studio 2013 which i have now to only script the code. Example: Like Flash Professional for debugging and FlashDevelop for scripting only.
My question is, how do i get the Unity3D link with Visual Studio 2013. I already searching around the internet, and had found that Unity3D only works with VisualStudio 2010.
I wrote a blog article on this awhile back on my blog HERE for Visual Studio.
However I will paste it here too:
How to use Visual Studio 2013
Recently Microsoft bought and re-released the popular Unity3D plugin UnityVS. The now renamed Visual Studio Tools for Unity plugin smooths the connection between Unity and Visual Studio and even allows one to perform debugging too! Download it here.
In Unity Editor go to Edit->Preferences->External Tools and In External Script Editor choose Browse from the drop down box.
Browse to and select C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.
The External Script Editor should automatically show your selected editor as Visual Studio 2013.
That’s it! It should just work from that point on.
As an important update, I would like to notice, that former UnityVS (after Microsoft's acquisition of SyntaxTree) is now available for free as a rebranded Visual Studio 2013 Tools for Unity.
The versions for VS 2012 and VS 2010 are also available.
The integration of Unity3d and Visual Studio got simpler with latest Unity (version 5) and Visual Studio Tools. This is the current procedure.
To use Visual Studio as editor and debugger with Unity you must:
Install the Visual Studio Tools For Unity. For this download the package at http://unityvs.com (careful to get the version for the Visual Studio you are using) and import it (as is standard in Unity for packages) by going into Assets -> Import Package -> Custom Package and browse to the tools installation folder and pick the package.
Once installed in Unity you will get an additional menu Visual Studio Tools, go there and select "generate project files". Visual Studio will already be the default editor for your scripts.
This done, if you say put a breakpoint in Visual Studio, click on "Attach to Unity" in Visual Studio, and then run your Unity project, the process will stop at breakpoints in Visual Studio and allow variable inspection etc.
you can use unityvs VS plugin (but I'm not sure about current 2013 support, it's works with vs2012) http://unityvs.com/ - on windows it's works very well, but remote OSX debugging feature is not ready yet
I'd like to add to the fine answer given by Pietro Polsinelli, that for me, there was an extra step in his Step 1. And that is that, after installing Visual Studio Tools For Unity, I had to, in Unity, go to Assets->Import Package->Visual Studio 201X Tools and then click around on the menu bar until "Visual Studio Tools" showed up as an option. After that, I could Generate Project Files and Open in Visual Studio.
This enabled me to Attach to Unity in Visual Studio and debug.
None of these solutions worked for me. Renaming monodevelop just changed the default program to notepad++, and the next default program after that was simply notepad.
However, there is a known bug with Visual Studio 2013 (not sure if it was present in previous versions, or if it is present in the non-professional version) where if you try to open a C# file in visual studio, where Visual Studio is opened as administrator and Unity isn't, VS crashes.
I had to either run both programs (VS and Unity) as administrator, or not open VS as administrator (as per the solution found here: http://connect.microsoft.com/VisualStudio/feedback/details/597863/cannot-open-visual-studio-files-from-windows-explorer).
With Visual Studio You Can Use UnityVS Plugin But if You Use Monodevelop You Can Go To Run->Attach To Process.. And Connect The Debugger to Unity Editor It Work Perfectly.
To link Unity with Visual Studio, do the following:
Do this on Unity.
Go to file --> preferences --> external tools --> external script editor --> Choose visual studio.
If Visual Studio is not showing, you Re gonna have to browse Visual Studio by hand.
Then you open any script in the Unity Project window and Visual Studio should open the file.
I hope this is helpful.
Note that I am using Unity 2020.2 and Visual Studio 2019

Categories

Resources