SonarCloud doesn't analyse Xamarin forms project - xamarin

I have a solution in Xamarin stored in Azure devOps git repository. I've created a pipeline to analyse the code on SonarCloud. My Xamarin solution contain 3 projects (Xamarin forms, Xamarin Android, Xamarin iOS). Here is the pipeline:
When I run the pipeline everything is OK (nuget restore, build, code analysis, publish) but when I go to SonarCloud, I see that only Android and iOS projects have been analysed. The Xamarin forms project was not analysed. In sonarCloud, I can see my code for the iOS and Android projects but not for my Xamarin forms project. Can somebody know why ?

Ok I understand why. It's because I've analysed a short lived branch. Only the new and modified files, compared to the “target branch”, are displayed and can contain issues.
By default branches are short-lived if their name does not start with “branch” nor “release”.

Related

Updates to code on Xamarin iOS application are not applying at runtime/debug

I have an application which I am developing. Everything has been going smoothly, but suddenly my code no longer applies when I deploy. If I make a change and deploy the app to my iPhone, the app launches but my changes do not appear.
Furthermore, my breakpoints hollow, which I believe means that the code that is running differs from the code in Visual Studio.
I am running Visual Studio 2022 on Mac, deploying to my iphone hardware.
I have tried:
Normal build and run
Build -> Rebuild Solution
How can I solve this problem?
I was able to solve the problem with the following steps:
Open the location of my iOS project (note that I also have Android projects and other libraries, but I only did this for the iOS location)
Delete the bin and obj folders
Build project, observe there are now errors due to references missing to classes which should come from nuget packages
Right-click on the Packages folder in the solution explorer and select Restore
Build and deploy the project
I'm not sure why my project got in this state, but this seems to solve it when it does happen.

Xamarin on Visual Studio always rebuilds even if no code changes. It didn't do this before

A week or so ago Visual Studio, on my Xamarin Forms mobile app, started rebuilding the solution (Android project + Forms project) every time I run the app in debug mode. This happens even if there is nothing changed at all between two consecutive runs.
Before it did only rebuild the Android project on the first build of the day, or if I changed something within the Android Project. The other times it would just rebuild the Forms project and deploy to the device, even if I changed some code in the Forms project.
This is very upsetting as it takes a lot longer to deploy when rebuilding the Android project.
I've seen some sugestions of changing the properties in this window:
But I think they are right, and I haven't changed them ever so I don't see how they would start impacting the builds without me changing anything.
I'm on VS 2019 v16.8.2
What else could it be that started this behaviour?

Two different projects with the same name and GitHub

I have two projects, one is in the Documents / Android Studio / Project folder, the other project is in the Documents / XCode / Project folder. That is, in both cases the folder is called "Project". I added the Android Studio project from the Android Studio to Github and successfully tested it. The versioning system works as it should. Next, I decided to add a project from Xcode to GitHub. I added a GitHub account in the Xcode settings. Xcode showed the projects available for my account. Next, I try to add a project to Github by clicking Source Control - Create Git Repositories. Xcode reports that all projects are already under the control of the versioning system. If I click Source Control - Commit, it looks like Xcode offers to commit for all project files to the same online repository called Project, which stores the project from Android Studio. I don’t understand what to do, because it is not recommended to rename the Xcode project. How to resolve this conflict?
Just create a new github repo at github (browser) by some other name. Then follow the instructions for pushing your project to it in the Terminal using the command line. Do not use Xcode for this or any other git related stuff.

Cannot see the "Components" folder in Xamarin.forms /.netstandard project

I am new in xamarin and I am looking for a way to add some components in my android projet but I cannot see the "Components" folder when I create my project
Thanks in advance
Unless you are already using a Solution that has components added, you won't be able to view the components directory in VS. Instead you should use Nuget Packages.
https://blog.xamarin.com/hello-nuget-new-home-xamarin-components/
In the upcoming releases of Visual Studio 2017 and Visual Studio for
Mac, both of which are currently available in preview, the Xamarin
Component Store is only visible in the IDE for developers whose
projects are currently using Xamarin Components in their apps.

Bitrise Xamarin Build Configurations in multiple submodules / projects

I have an app for ios and android written in Xamarin which I am trying to build with Bitrise.
In the platform project I have 10 build configurations for different releases of the app. In the two submodule projects I have simply a debug & release configuration (and debug|iPhone & simulator on the ios project) - these projects don't need to know about which release of the app is going out - the build config's are for resources and manifest/plist details.
In the solution I use configurations mappings to specify what build config should be used for the submodule projects, i.e.
Solution Configuration : Release_a_particular_version
Platform project maps to : Release_a_particular_version
Core project maps to : Release
Submodule Library maps to : Release
This builds fine in Xamarin Studio or Visual Studio but when building in Bitrise gets an error, project configuration not found.
If I create configurations in both submodules with the same name as the solution_configuration everything builds well.
I imagine there's an msbuild switch to turn configuration mapping on? If there is, how would I apply that to the bitrise build step?
Or some alternative?
Without your Bitrise configuration and the failed build log, it is hard to answer this question.
To help you, we would need to take a look on your configuration and on the failed build log.
You can reach out our support team on Bitrise on-site-chat (on every Bitrise page you can find a message icon in the lower right corner where you can send us a message).

Resources