Unable to debug unit tests in Visual Studio 2022 Mac (preview) - visual-studio-mac

I'm developing a solution and I'm using Visual Studio 2022 for the Mac on a Mac Mini M1.
The VS build is 6509 (latest i think).
I can debug my web-site w/o issue
I can RUN unit tests w/o issue
But if I try to DEBUG my unit tests (I'm using xunit) I get the following:
Unable to attach to CoreCLR. Unknown Error: 0x80131c3c
Any ideas?

I eventually fixed this by basically deleting VS and .net and then reinstalling. The only thing I can figure is that I had the old x86 stuff already installed and when the new M1 stuff went it some of the configuration files got messed up.

Related

.NET Maui Build Error Could not find Microsoft.iOS

I am on a PC Visual Studio CE 2022 attempting to archive and deploy for iOS. I am using the following command:
dotnet publish PopUpShop.Mobile.Maui -f net7.0-ios -c Release /p:ServerAddress=192.168.1.XXX /p:ServerUser='username' /p:TcpPort=58181 /p:ArchiveOnBuild=true
The process builds and connects to my Macbook but then throws this error:
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.1.1477\tools\msbuild\iOS\Xamarin.Shared.targets(1738,3): error : Could not find Microsoft.iOS in /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.1.1477/
I am not quite sure where it is looking for /usr/local/share.... I assume that is on the Macbook.
Do I have to install that version of the SDK on the Macbook? If so how do I do that? (Not a mac user). I tried in Terminal
dotnet add package Microsoft.iOS.Sdk --version 16.1.1477
but it wants to add that to a specific project.
Xcode 14.2 is still working on and it's not supported yet by Visual Studio c. You could check the release note here Visual Studio 2022 version 17.4 Release Notes.
As an alternative, you could now try downgrading back to Xcode 14.1 and build the project. If you still have questions, feel free to ask.
Hope it works for you.
The problem was I was missing the /p:_DotNetRootRemoteDirectory='/Users/{mac_os_username}/Library/Caches/Xamarin/XMA/SDKs/dotnet/' parameter. For some reason it was not part of the cli string I copied. The error message doesn't help either, sends you down a rabbit hole.

Visual Studio - Xamarin forms application not deploying onto iOS through "Pair to Mac"

I have a Xamarin.Forms application that has suddenly stopped deploying onto the iOS simulator when I use the "Pair to Mac" option on VS 2019. VS pairs to the mac with absolutely no problems, and it gives me the option to pick my simulator here:
However, when I click to deploy the app, the build and deploy stops almost immediately, and this is shown in the output.
It doesn't even look like it's trying to deploy it! I don't know why this has happened as it used to work with no issues until recently.
(Edit) I have the latest version of Visual Studio Community 2019 (16.8.4) and Xcode (12.3).

Building iOS app with Xamarin and Visual Studio 2019 - Error Wrong Version of Xcode installed when it isnt

I am trying out Xamarin on the Mac. I have an oldish Mac that DID have Xcode 10.1 on it.
I tried to build the iOS app and got the following error:
Severity Code Description Project File Line Suppression State
Error The Xcode version installed on the Mac (10.1) is not compatible with this version of Visual Studio. This may cause unexpected warnings or errors when building and deploying iOS projects. Please install Xcode '11.3' or visit the documentation to learn more. 0
I upgraded the Mac to Caitlin and upgraded Xcode to 11.3.
I can connect to the Mac and actually can run the iPhone simulator with the app, however, if I run the build, I STILL get the same error, like its not figured out how to update itself?
I have done the 'forget this Mac' and even renamed it on the network in case there was some legacy in a file somewhere.
I have dumped the solution and created a new one from the templates and still get the same error ... hair being torn out...
It might be one of those things that just goes away after a while I don't know. Any ideas?
Thanks.
EDIT * I realised that I wasnt clear. I am running VS2019 on a PC connecting to my Mac.

Build failed with error Remotebuild requires your projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. Please update your cordova-ios version

I am aiming to deploy a mobile application to the iOS platform using codes developed in Visual Studio for an Android phone. I am unable to open the Visual Studio file on my Macbook (macOS High Sierra ver.10.13.6) as Visual Studio here does not seem to support .jsproj files. As such, I have attempted following the instructions in the link below to run a remotebuild on my mac while debugging codes and seeing an iOS simulator on my Windows computer.
https://learn.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/first-steps/ios-guide?view=toolsforcordova-2017#run-on-simulator
I was able to get the remotebuild running, however, I came across the error where it required my projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. As my windows computer does not have Xcode, I turned to my macbook and tried updating and adding the Cordova iOS platform through the terminal, where it said "Current working directory is not a Cordova-based project." I have searched the error up and it said that it required my Visual Studio project to be open, which I am unable to do so as my file is not supported in the Mac version of Visual Studio.
The iOS version in my Windows Visual Studio is currently 4.2.0 and I am unsure how to get about updating it. I have seen the link below but in only applies to Macbook, where I cannot open the Visual Studio project file.
Install specific version of Cordova CLI in Visual Studio 2017
I have installed node.js as well as Git, also attempting to include/update the Cordova iOS platform through the command prompt (Once again unsure if that was the method, but I tried), however, the command prompt did not recognise the update to cordova. Under the toolset in Visual Studio, I have tried ticking on the checkbox under Cordova platforms to take the latest patch, where ~4.2.0 appears, but still does not update.
I am still new to coding and things seem very foreign to me, if I have missed out anything vital or am doing something fatally wrong, please do enlighten me.

Launch failed. The app could not be launched on xamarin

I am getting the following error when trying to run Visual Studio/Xamarin built application on the IOS Simulator.
Launch failed. The app 'App2' could not be launched on 'iPhone 7 Plus iOS 10.1'. Please check the logs for more details.
"App2" was created using the Tab Template, and NO code changes after rolling the application.
Windows environment: Windows 10 w/Visual Studio 2015 update 2
Mac environment: IMac Sierra fully patched. XCode 8.1 (what ever is most up to date).
I have connected the mac remote and pc. I can launch the iPhone simulator on the mac from Visual studio on the PC.
I get the error when trying to run "App2". It compiles fine, just won't run on the simulator.
I've searched here, and similar results speak of VS Crashing. Mine doesn't crash, just presents the error. NOTE: There's nothing in any log I can find with details by the way.
Ideas? Thanks!
EDIT: Just loaded up Parallels on the IMac and ran Win 10/VStudio. I get the same error. Again, xamarin remote agent connected and I can start the simulator from the PC, i just can't deploy to it.
After all the research and help from those here it comes down to a bug with the current version of Xamarin. Options are to wait until a new stable build is on the Xamarin site or get builds off of GIT. I'm choosing to wait, as I've not had great luck working with interim builds.
Xamarin that downloads with the new VS 2017 fixes this bug.

Resources