Build a test project - xamarin.forms

iam building a MAUI Project with a mstest project.
The MAUI project builds totally fine, the test project was building fine but i added a android and iOS as a targetedframeworks in the csproj file becasue i need to build the test for these platforms aswell. so i get the following error when iam trying to build the test project:
"Error Empty ResolveFrameworkReference.RuntimePackPath while trying to read runtime components manifest. ResolvedFrameworkReference available: { Microsoft.NETCore.App, RuntimePackPath: } XXXapp.Test C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.11\Sdk\RuntimeComponentManifest.targets"
could anybody please help, thanks
i tried to update the .net sdk but no success

Related

UWP project added to Xamarin is not compatible with netstandard2.0

I have a Xamarin.Forms app (only doing things for Android now) where I added a project from an UWP app. With this, I get two erros which I cannot solve. I've found some things on the internet, but nothing for my specific situation.
The erros are:
Project UWP.Project is not compatible with netstandard2.0 (.NETStandard,Version=v2.0).
Project UWP.Project supports: uap10.0.17763 (UAP,Version=v10.0.17763).
Project UWP.Project is not compatible with monoandroid11.0 (MonoAndroid,Version=v11.0).
Project UWP.Project supports: uap10.0.17763 (UAP,Version=v10.0.17763).
How do I solve this?
I have a Xamarin.Forms app (only doing things for Android now) where I added a project from an UWP app.
It looks you need to update the UWP project target version to 17763. For adding the new platform for existing Forms app, you may refer to this document. And please note making the following changes to UWP MainPage.xaml
Inside the <Page> tag, add: xmlns:forms=“using:Xamarin.Forms.Platform.UWP

How to fix Xamarin Forms pipeline Target Framework error

Locally, I can build and run my Xamarin Forms application with no issues. In my Azure build pipelines I have my master branch failing because of my target framework version. It says it is 9.0 when it should be at least 10.0.
In my Android project file I have the framework version set to 10.0. I have made sure it is also v10 in the properties tab for the project. Yet I still get the below error.
##[error]C:\Users\VssAdministrator\.nuget\packages\xamarin.forms\5.0.0.2012\build\Xamarin.Forms.targets(188,5): Error XF005: The $(TargetFrameworkVersion) for MyApp.Android (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion) for MyApp.Android.
Try to open your .csproj file,and manually modify its targetFrameworkVersion.
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
Verify that BOTH of the following project properties are set to 10.0:
Application / Compile using Android version (Target Framework).
Android Manifest / Target Android version.
https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/android-api-levels
If those are already both 10.0, then make sure the Azure build pipeline has up-to-date versions of Android SDKs and tools.
Another way to fix:
If you are able to create a new sample solution, and successfully build that via Azure, then start a new solution, and add all your files to it.

Azure Dev Ops - Building an Xamarin Project fails

I have created a Xamarin Forms solution that contains both an iOS and an Andoid project that uses F#. I created a Azure Dev Ops pipeline (classic template, no YAML) and I am getting the following error when it attempts to build:
error FS3053 : The type provider
'Xamarin.Android.FSharp.ResourceProvider' reported an error : The type
provider constructor has thrown an exception: [error CS0009: Metadata
file
`/Users/runner/runners/2.165.2/work/1/s/src/packages/Newtonsoft.Json.12.0.3/lib/netstandard2.0/Newtonsoft.Json.dll'
does not contain valid metadata]
[/Users/runner/runners/2.165.2/work/1/s/src/Droid/sameroom.mobile.droid.fsproj]
Can anyone add some insight from here? It works fine building/running on my local macbook.
I found the answer. Instead of using the OOB Xamarin.iOS Build Solution task, use the MSBuild task and only point to the iOS project (iOS.fsproj)

Xamarin.Android Build Error for Xamarin Forms 4 Solution

I am trying to compile a newly created Xamarin.Forms solution using Visual Studio Pro 2019 version 16.1.3. I use the stable Xamarin.Forms version 4.0.0.425677. The solution contains an iOS, Android and UWP project.
When I try to compile I get the following Android compilation error even without having made any code changes.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3326,2): error : A part of the path "AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.class" could not be found
The only related post I found was here which recommends to delete bin and obj folders in the Android project. This does not apply since I start with an new solution in the first place. Any ideas what the cause could be?
Well, it turns out that I only get this issue when I have the term "Xamarin" in my Android project name. This seems to confuse the Android compiler.

Azure deployment issue after solution conversion to VS2017

I have a .net core web app written using VS2015 and deployed in Azure.
Recently I have moved to VS2017 and it forced me to convert my web app solution so that I can develop it in new VS. I did this and there were no issues.
Then I made a minor change in my app and commited that change to github. Once I did it, Azure has started to build new version as it is configured to automatically deploy current version of app from github.
the issue is that after solution conversion to VS2017 i cannot deploy it in azure. I constantly get an error:
D:\home\site\repository\WebApp\src\WebApp\WebApp.csproj(84,5): error
MSB3073: The command "dotnet bundle" exited with code 1. Failed
exitCode=1, command=dotnet publish "WebApp\src\WebApp\WebApp.csproj"
--output "D:\local\Temp\8d481c16c48679f" --configuration Release
Can any one help me, I'm not very experienced in VS IDE, I think it might be something with project properties or references.
thank you in advance
In the .csproj file, please get rid of any references to "dotnet bundle" as well as the NuGet package "BundlerMinifier.Core". When you've done that and it compiles correctly, you can install the NuGet package "BundlerMinifier" which will add build time support through MSBuild now in .NET Core apps too

Resources