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

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.

Related

Error publishing .NET MAUI project: the target "_GenerateAppxPackage" does not exist

I have a .NET MAUI project that was created with VS2022 Preview 2, and it builds without errors or warnings and works as expected in the debugger. Prior to updating Visual Studio to Version 17.4.0 Preview 4.0 I was able to publish the project as a sideloadable MSIX from within VS.
Since updating, I get the following error when I click Create in the Create App Packages wizard:
MSB4057 The target "_GenerateAppxPackage" does not exist in the project.
The error is listed against the MAUI project's .csproj file.
I've tried creating a separate new, default MAUI project in the new preview - this publishes ok and (as far as I can see) doesn't contain _GenerateAppxPackage anywhere within its files or project structure. So for now I'm assuming this isn't something new that was added with the preview.
I found some references to _GenerateAppxPackage on the web but they appear to refer to Azure integration. My project is a stand-alone data transformation app that doesn't even access the net.
I'm at a loss what to try next. I don't know what this target refers to, where it should "exist" within the project, or what it does. Can anyone help me understand the problem and/or point me to a solution?
Update: 2022-10-28:
I tried deleting the project structure and creating it from scratch with File -> New Project, then adding back only the .cs and .xaml files. Publishing the recreated project gives me the same error.
I also tried uninstalling the VS preview and re-downloading and installing it. Again, publishing the project gives me the same error.
I still have no idea what is causing this, or even where to start looking.
I faced with the same problem at Visual Studio 2022 17.4.0 (net6.0-windows10.0.19041.0).
The simplest solution for me was be using the command dotnet publish directly.
At root of project just write in terminal:
dotnet publish -f net6.0-windows10.0.19041.0 -c /p:RuntimeIdentifierOverride=win10-x64
I learned today that MAUI is now in the mainline Visual Studio 2022 edition, I've tried using that instead of the preview, and I can confirm that the problem goes away. I wish I'd known about this earlier...

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?

Build for Ionic project hangs in Visual studio

Im using Visual Studio 2017 and starter menu template from Ionic. When i try to build the project (to deploy it to device or run in simulator for example) build process hangs. The green bar for build just keeps scrolling but nothing happens. Task Runner Explorer window shows that ionic-app-scripts build task finished.
Im running Visual Studio as Administrator on high end workstation, so im not quite sure what can be the problem. I also deleted all files from temp folder regarding visual studio, but that did not help.
I tried building for android and windows configurations.
Has anyone else ever experienced this kind of problem, or have any guides on what to try on next?
I found out what the problem was. It seems that ionic build task does not notify properly VS that it is finished, so VS build is waiting for it forever. I excluded that ionic build task from build process and run it manually before VS Build and everything works ok now.

Is there a way to run a Xamarin UWP project without deploying every time

Do I always have to click to deploy a UWP app before running it? Thats two steps and I'd like to perform just one.
I've just created a Blank Xaml App (Xamarin.Forms Portable) New Project from the list of Cross-Platform, Windows, Visual C# Templates in Visual Studio 2015 update 2. There are projects for Droid, iOS, and UWP (Universal Windows) as well as a few others. I set the UWP app as the startup project and attempted to run it (by clicking the green arrow on my local machine or hitting F5), but I received an error saying that I need to deploy first. If I right click the project and then choose deploy it deploys successfully and then if I run it runs successfully. If I stop execution, make modifications, then run again I do not see my changes. If I deploy again and then run I can see my changes.
I'm trying to just make sure my UI looks like it should and so anything that helps me iterate between making code changes and seeing those changes in any platform would be helpful. the Droid takes forever to start up and I can't run iOS (no Mac) or Windows 8.1 (I'm on windows 10 home) which is why I'm testing things out with UWP first. Is there a better way than right clicking the project to deploy every time before hitting run?
Goto Build menu ->select configuration manager goto UWP project select both build and deploy option .. it will automatically deploy default this option switch off

Tesseract for WinRT UWP

I need to use Tesseract on a Windows 10 app for phones. Already found an intent made by Yoisel . I've tried to build the project for test, but i'm kinda new to Visual Studio dependencies and usage.
What i've done so far is to open the tesseract_winrt.sln on the VS2015 folder.
After that i copied leptonica project to root directory of tesseract_winrt so it can be loaded inside the solution. Once that everything is loaded i click build solution and get this errors:
I'm not sure what i'm doing wrong or how to properly set the dependencies
Any idea would be appreciated.
There are now binaries for the project that you can use:
https://github.com/yoisel/tesseract_winrt/releases/tag/v0.1-alpha
It is a set of Visual Studio Extension SDKs, you can install the one for UWP projects on your system and add a reference to it in your project using the "Extensions" tab:
Disclaimer: This project was merely a proof of concept and I strongly recommend not to use it as is in a production scenario

Resources