How can i make archive iPA in Visual studio MAC. error occur in latest version - xamarin

Package 'Microsoft.Bcl 1.1.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

According to the error message you provided, it lists some supported versions of NETFramework and you are using NETStandard.
So You should change your projecr target framework from .NETStandard to .NETFramework.

Related

All nuget packages requiring net6.0 are "not compatible with net6.0" even after complete Windows reset

After booting up my PC I tried to continue using a previous project I had been working on:
ASP.NET MVC Core 6.0.
All of a sudden Microsoft.EntityFrameworkCore was not installed in the solution.
After trying to reinstall the Microsoft.EntityFrameworkCore nuget package I received the following errors:
Package restore failed. Rolling back package changes for 'BulkyBook' (my project)
NU1202: Package Microsoft.Extensions.Logging 6.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.Extensions.Logging 6.0.0 does not support any target frameworks.
NU1202: Package Microsoft.Extensions.Options 6.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.Extensions.Options 6.0.0 does not support any target frameworks.
... for all dependencies AND
NU1202: Package Microsoft.EntityFrameworkCore 6.0.5 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.EntityFrameworkCore 6.0.0 does not support any target frameworks.
When trying to install ANY nuget packages requiring net6.0 I get the same issue.
I have done a reset of Windows (keeping files but losing all programs) and fully reinstalled Visual Studio 2022.I still have the same issue.
This is killing me, I'm willing to try anything.
Image for proof:

Error when adding new Nuget to a .Net Standard Project

I am working on referencing another set of .dlls in another project and have bundled it up via Nuget:
I get this error:
Severity Code Description Project File Line Suppression State
Error NU1701 Package 'MyPackageImTryingToInstall' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project. 1
I understand the error, but how do I make .Nuget restore with .Net standard?
Just found that if I reference the Nuget in a .Net Framework 4.6.1 project - it works fine.
It has something to do with making a nuget from .net standard to .net standard.
I had to add lib folders for the target frameworks I wanted to add the nuget package to:
For the files section in the nuspec I needed to make a \netstandard2.0 folder and \461 folder

Plugin.FirebasePushNotification installation error in Xamarin forms

While installing Plugin.FirebasePushNotification getting error-
Could not install package 'Xamarin.Firebase.Messaging 60.1142.0'.
You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.0', but the package does not contain any assembly references or content files that are compatible with that framework.
For more information, contact the package author.
after updating Android API 7.0 this installation works well(when create a new project)
BUT i already have a project with compile version Android 6.0.
While installing this plugin on this project then it shows same error.
So how to solve this installation issue on my previous project?
You need to set your <TargetFrameworkVersion> to Android 8.0 or greater.
https://developer.xamarin.com/guides/android/application_fundamentals/understanding_android_api_levels/#framework
https://www.nuget.org/packages/Xamarin.Firebase.Messaging/ version 60.1142.0 only includes a MonoAndroid80 folder which means it requires APIs from Xamarin.Android 8.0 at a minimum to compile against.
If you want to figure this out yourself, do the following:
Download https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
Download the NuGet via Manual Download
Open the .nupkg
Expand the lib folder to see the respective target frameworks

target 'MonoAndroid,Version=v6.0' project dependencies

My Visual studio 2017 nuget package can't install following error is occured in Xamarin.Forms Portable class library Project
Severity Code Description Project File Line Suppression State
Error Could not install package 'Xamarin.Android.Support.Compat 25.3.1'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0
Xamarin.Android.Support.Compat version 25.3.1 has dependencies of
MonoAndroid 7.0
Xamarin.Android.Support.Annotations (= 25.3.1)
Xamarin.Build.Download (>= 0.4.3)
Re: https://www.nuget.org/packages/Xamarin.Android.Support.Compat/25.3.1
You need to set the Target Framework to at least 7.0.
Re: https://developer.xamarin.com/guides/android/application_fundamentals/understanding_android_api_levels/#Target_Framework

MsBuild to build and create a deployment package

I was trying to use the following command to build my solution, but that was giving me an error saying MSBuild target package not found
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
"C:\Users\FullPath\SolutoinName.sln" /T:Build;package
/p:Configuration=DEBUG /p:OutputPath="obj\DEBUG"
/p:DeployIisAppPath="/bidmc-defaul" /p:VisualStudioVersion=10.0
I have tried MSBuild target package not found but that did not help, then I removed package from target and ran the command and it was successful
Then I ran the following command to create a package zip
"C:\Program Files (x86)\IIS\Microsoft Web Deploy\msdeploy.exe"
-verb:sync -source:package="C:\Users\Full Path\Website\obj\Debug_PublishedWebsites\defaul_Package\myPackage.zip"
-dest:auto,computerName=localhost -allowUntrusted=true
Now this says object of type package and path cannot be created, the zip package could not be loaded, could not find part of the path
Update
fix to my first command to create package. I was giving my solution name SolutoinName.sln, I replaced it with my main project in solution myproject.csproj, with corresponding paths. That resolved my first error.
now second error has changed to "the applicatoin pool that you are
trying to use has the managedRuntimeVersion property set to v4.0 the
application required 4.5"
How should I address this, just install .NET 4.5 on build machine?
It seems you're attempting to build a VS2012.NET 4.5 or higher solution with MSBuild 4.0. That's supported, provided you install the full .NET 4.5 Framework and the required SDK's and targeting packs for VS 2012, VS 2013 and more.
Alternatively, you can upgrade to MSBuild 2013 v12.0 (for VS 2013 solutions support) or MSBuild 2015 v14.0 (VS 2015).
You need to change the VisualStudioVersion to 11 on the MSBuild call.
/p:VisualStudioVersion=11.0
Use IIS Manager to upgrade the .NET Framework version assigned to your app pool (or change your project properties to downgrade the .NET Framework version your web application targets).

Resources