Visual Studio 2017 Breakpoint Xamarin - debugging

Visual Studio Profesional 2017 .
Version: 15.1 (26403.3) Release
Xamarin Portable library and UWP Project (not tested with Android), target to "Localhost" (Windows 10 Aniversary)
Since last update of Visual Studio (updated yesterday), break points doesn't work on an existing project, not work in Portable library and not work in UWP Project. Project was working fine before last VS2017 update, and yesterday after work with Project, i installed last update from VS2017 notification center.
I deleted all bin/obj folders, Clean Project and Rebuild solution, doesn't solve problem.
I've created a new Project with default settings (Master detail/Portable library) and in new project breakpoint Works in UWP Project, at least in MainPage.cs->MainPage() -> LoadApplication(new App3.App()) line. But doesn't work well with some parts of Portable library code, as you can see in picture.
.
Thanks

If you are having this problem with a Xamarin.Forms project that is either just updated from PCL to .Net Standard, or just created new as a .Net Standard:
Right click on your .Net Standard proj -> Properties
Build Tab -> Advanced... button
Switch Debugging Information combo box from "Portable" to "Full"

Ok, i solved it, i not very sure how, but i did it, i recover a project backup, and with Winmerge, i compared all .csproj, .csproj.user, .nutget, nutget.targets files (I've replaced all the lines, I thought it appropriate from backup Project, because i created a new Project and i've been adding everything back from scratch)
I try many things, but my lasts steps:
-In UWP Project:
.csproj.user: delete all lines, and now i only have : ShowAllFiles
.csproject: change TargetPlatformMinVersion, to lowest. Add reference: Microsoft.VCLibs, Version=14.0
-In Portable library:
.csproj: Delete line "AllowUnsafeBlocks"
.csproj.user: Delete all lines, and replace with : ProjectView: ShowAllFiles
And finally, but not least, I've updated Xamarin.forms in all projects to version 2.3.4.231
Really, when i can do work breakpoint has been when i added Microsoft.VCLibs, and update Xamarin.Forms nutget, i do this two steeps at same time, and then works.
Many thanks.

This is how i solved it:
Right click on your Android project -> Properties -> Build -> Uncheck "Optimize Code".
And Android project -> Properties -> Build -> Advanced -> Debugging information -> set it to "Full".

Related

Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Xamarin.Forms - VS2019

I have a Mobile App built with Xamarin.Forms
when I am trying to upgrade my project from VS2017 to VS2019
I get this error in Android Project
Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties
I tried to delete bin and obj folders to force the project to rebuild everything, but the error still appears
Can I get an explanation about the error above and how to solve it?
Note: the error doesn't appear in VS2017
armeabi is deprecated and your Android project should target armeabi-v7a and arm64-v8a at a minimum in your release builds destined for the Play Store.
You can directly edit your .csproj and remove the armeabi from within the AndroidSupportedAbis tags:
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
Or you can open the Android Build settings in the IDE and it will auto-update it for you:
Targeting 64 bit architectures on Xamarin Android
It can be adjusted in 3 steps.
Step 1 - Right-click on Android Project and Click Properties:
Step 2 to 4:
Step 5 - Uncheck armeabi:
In Visual Studio, right-click on your project under the Solution Explorer and select Properties. Under the Android Options page check the Packaging properties section and verify that Use Shared Runtime is disabled (turning this off allows you to explicitly select which ABIs to support). Click the Advanced button and, under Supported architectures, check the architectures that you want to support:
tip: if you are unaware of arm architectures checking all will remove errors

Breakpoints not being hit on Xamarin Android

Yesterday I upgraded to Xamarin.Android 7.3.0, and now none of my breakpoints get hit. I've tried many things to try to get breakpoints to work again, but no luck:
Cleaning the solution
Deleting the bin / obj folders
Closing and reopening Xamarin Studio
Restarting my Mac
Creating a new Android project
Rolling back to Xamarin.Android 7.2, Xamarin.Mac 3.2, and Xamarin Studio 6.2.1.
It doesn't make sense to me that even after creating a brand new project and running it with rolled back Xamarin versions, it still doesn't work. This should eliminate it being the code, and eliminate it being the Xamarin update, and yet it still doesn't work.
The pdb files are generated, so that's something. I have my configuration set to Debug-Dev, this has Debug Information set to Full, and Define Symbols set to:
DEBUG;__ANDROID__
I'm not sure what else to try at this point, help would be appreciated!
This seems to be a bug a bug related to mono 5.0 upgrade. Solution from Bugzilla
Alternate possible temporary workaround for users who have hit this issue after updating (as opposed to a fresh install on a new machine)
(For users who might wish to continue to use Xamarin Studio 6.3 for a little while before transitioning completely to Visual Studio for Mac.)
Set "Project > Active Runtime" to "Mono 4.8.0 (8f6d0f6) (/Library/Frameworks/Mono.framework/Versions/4.8.0)".
Rebuild the Android app project.
Explanation
By default the Mono 5.0 installer will leave the Mono 4.8 tools installed alongside the new Mono 5.0 tools. When the Xamarin.Android build process runs under Mono 4.8, it will generate the old .mdb debugger symbol file format for user assemblies, so the Xamarin Studio debugger will be able to use those symbols. Do note though that the framework debugger symbols files for Xamarin.Android are all shipped as portable .pdb files starting with Xamarin.Android 7.3, so stepping into framework code (as opposed to user code) still would not work as expected.
I had this problem for months, the root folder where I had all my projects had a "#" , I renamed it and now the break points are working just fine.

Xamarin.Forms UWP missing references

When I create a new project in Xamarin.Forms I get a lot of errors in the UWP part of the project.
It looks like I miss all the referencs in UWP?
I installed Xamarin trough Visual Studios modify
Below is a screenshot of my Visual Studio
I also started to work with Xamarin about two weeks ago and came across many problems and one was just like yours. If you dont have Xamarin studio go and download it. Just do it.
Intellisense breaks really often and you get 200 errors that are dump(or not).
To get rid of the errors there are many ways.
Sometimes you just have to wait.
Open the xaml pages and save them.
Clean - rebuild the project it should run(at third try). If it doesnt you have to open Xamarin studio and built it from there.
If your project is new, just delete it and create a new one.
If you have MVC 5 or Core 1 Installed you will have to remove them(if that doesnt help do a PC Reset like a format).
If it says something for .zip files, find them keep a backup and delete them. Xamarin will re-download on Build.
I had same problem here using Visual Studio 2015 Update 2. Unload the UWP and everything works.
Tried in Xamarin Studio Professional and the following error: -
Could not load project 'blah\blah.UWP\blah.UWP.csproj' with unknown item type '{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A}'
The following link has some helpful points and mentions "UWP is available in Xamarin.Forms 2.1 and later"
https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/
The default setup when creating a new project in VS 2015 Up2 is to use Xamarin Forms v2.0.0.6482, however when I try to update to v2.1.0.6529 I get nuget errors
Checking my output when trying to update to 2.1 using nuget i got the following: -
The content at 'https://{myteamcityserver}/guestAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.UniversalWindowsPlatform'' is not valid XML.
Root element is missing.
So I turned of my local Package Source in Tools | NuGet Package Manager | Package Manager Settings | Package Sources
And woo hoo it all worked for me.
Regards
Peter

How can have my OpenCV settings made the default for all my Visual Studio C++ projects?

Having to manually editing the settings for every new project I create is quite tedious.
And it is quite error prone so I sometimes forget to add something and a compile
error happens.
Is it possible to set up Visual Studio so that the settings I need for OpenCV are automatically applied to every new project?
By the way, I'm using Visual Studio 2010.
Certainly under VS2012 you can set properties in microsoft.cpp.win32.user and they become global.
And according to this (and my vague memory) it works for VS2010 too:
http://www.curlybrace.com/words/2012/12/17/setting-global-c-include-paths-in-visual-studio-2012-and-2011-and-2010/
However, what I do is have a property sheet with all the OpenCV settings in it and when I create a new project I add the property sheet. (actually I have two, one for debug and one for release, although if I used conditional properties I would only need one.).
If I change versions of OpenCV I edit that property sheet and all my projects get the new settings.
Also see http://blogs.msdn.com/b/vsproject/archive/2009/06/23/inherited-properties-and-property-sheets.aspx
Your should consider using CMake (as OpenCV itself does) for generating your project and solution files. It will allow you to (re-)generate your solution files on any machine in a consistent manner for multiple versions of IDEs and OpenCV updates.
All you need is a single CMakeLists.txt file along with your source code.
You can import/export your project settings.
In Visual Studio(2010), goto Tools -> Import and Export Settings..
There you can, backup/save/export your current project settings. Now every time you create new project, import this setting and you won't need to repeat complete procedure.

How to convert a regular win32 (VC++ vcproj) project to a Qt project?

How can I convert existing vcproj files to project files that the QT add-in to Visual Studio recognizes and treats as valid Qt projects?
Should I just bite the bullet and create new projects to replace the old ones, and then add existing code?
I am using QT 4.6 and VS 2008 with Qt Add-in 1.1.2.
Original vcproj files have NOT been generated with QMake.
Using Visual Studio 2010+ it is now possible to convert a project to a Qt Addin project, using the "Convert project to Qt Add-in project" feature of the Qt Addin.
The following steps are from the work around in bug QTVSADDINBUG-27. This was tested with Visual Studio 2010, but should work similarly with new versions:
Right click on your project in "Solution Explorer", click on "Unload Project"
Right click on your project in "Solution Explorer", click on "Edit .vcxproj"
Add line <Keyword>Qt4VSv1.0</Keyword> between the tags <PropertyGroup Label="Globals"> and </PropertyGroup>.
Right click on your project in "Solution Explorer", click on "Reload Project"
Right click on your project in "Solution Explorer", click on "Convert project to Qt Add-in project"
If you have header files in your project you are going to have to follow the instructions in this answer to trigger the generation of moc_* files in the "Generated Files" folder.
For editions of Visual Studio older than 2010 see this work around.
Here's the response from Nokia support engineer, name removed for privacy protection:
Hi,
Thanks for the suggestion. I have
passed it on to our developers who
will consider implementing it for a
future release. You can track it using
the following link:
https://bugreports.qt.io/browse/QTVSADDINBUG-27
Regards,
Support Engineer, Qt Development Frameworks, Nokia
>
Original question
We have quite a few legacy vcproj projects that we wish to add Qt to it.
Currently, we don't have an easy way to convert these legacy vcproj
files into a Qt-enabled vcproj.
What do I mean by Qt-enabled?
On a non-Qt-enabled vcproj, when I right click on the project name
under Solution Explorer, all options related to Qt are all grayed-out.
It would be really useful if Nokia adds this capability to VSTD Add-in.
Stackoverflow fellows, if you would like to see this feature implemented by Nokia, please help vote for it at the link above! =)
I use Qt VS Tools instead of Qt VS Add-in.
Instructions
In the .vcxproj file, make the following modifications:
Add <Keyword>Qt4VSv1.0</Keyword> into <Project><PropertyGroup Label="Globals"> (in accord with Benjamin's answer).
Add the following element into <Project> (the root element):
<ProjectExtensions>
<VisualStudio>
<UserProperties MocDir=".\GeneratedFiles\$(ConfigurationName)" UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" lupdateOptions="" lupdateOnBuild="0" lreleaseOptions="" Qt5Version_x0020_x64="5.6-msvc2013_64" MocOptions="" />
</VisualStudio>
</ProjectExtensions>
Note that the value of the attribute Qt5Version_x0020_x64 should match the name of a Qt version in Qt VS Tools. You may set an arbitrary value and then fix it in Qt Project Settings in Visual Studio.
My setup
Visual Studio 2013
Qt VS Tools 2.0.0 Beta (apparently a rebranding of Qt VS Add-in)
Qt 5.6 msvc2013_64
Notes
When I follow Benjamin's answer and try to "Convert project to Qt VS Tools project", Visual Studio gets stuck.
The only Qt specific functionality I've tried with the project is exporting a .pri file.
I have reverse engineered the necessary modifications from a fresh VS project created using the template Qt GUI Application.
Converting a regular VC project to a QT project should be easier and the error message displayed by the Qt plug-in when attempting to add a Qt class to a non-QT project is exceedingly unhelpful especially when considering the actual differences between a Qt .vcprojfile and a non-Qt one are minimal. It is often the case that you have existing legacy code built into libraries and Dll's. During migration to Qt you may wish to add a Qt class to an existing module which was previously a non-Qt project. If the module has relatively few source files you may find it easier to re-create the project as a Qt project. If it has hundreds of source files or is complex in other ways it is often be easier to simply hand edit the .vcproj file. By comparing a regular .vcproj with a Qt one it is easy to see what the differences are:
A Qt project has a Keyword="Qt4VS1.0" immediately before
TargetFrameWorkVersion line near the top of the file.
At the bottom of the file you need to add the required Globals (in
particular QtVersion.Win32)
You will need to add the locations of the Qt header files to the
include paths (for all build configurations). You can do this later
via the visual studio user interface
For an exe or dll you will also need to add the Qt library locations
and library files to the linker options.
You actually only need to do 1 and 2 in a text editor and then you can reload the project in Visual Studio.
After setting up include paths and libraries you should be able to build the project as usual. Next you can add a new Qt class or convert an existing class into a Qt class. To do the latter first remove the source files for the existing class from the project otherwise the Qt add class wizard is likely to complain.
The above steps are intended for experienced users and you should always back up existing projects .vcproj files bfore hand editing. Simple mistakes here can render the file unusable.
More answer from Qt support engineer; I think the first pargraph is helpful as I didn't know that before:
i think this is a misunderstanding
really. If you have a Qt project
generated with the Add-in, then you
can change this project into a qmake
generated Qt project - and vice versa;
If you have a .vcproj that has been
generated by doing qmake -tp vc, then
you can convert this to a Qt Add-in
project.
There is no functionality to convert a
regular win32 project into a Qt
enabled project, so the suggestion
created is still valid, see:
https://bugreports.qt.io/browse/QTVSADDINBUG-27
I can see from the history of this
report that it has been closed and
re-opened again, so I assume there was
a misunderstanding regarding what you
were looking for in the first place.
If you create a .pro for you project
using qmake, then you should be able
to create a .vcproj file using 'qmake
-tp vc' on that .pro file. The qmake manual is available here:
http://doc.qt.io/qt-5/qmake-manual.html
I hope this helps.
Regards,
--
Support Engineer, Qt Development
Frameworks, Nokia

Resources