Forum Xamarin Xamarin.Forms

How to add and use the .Net Framework to a project?

greetings I am new in visual studio and with Xamarin.forms I am trying to make a multiplatform app, the app requires that I use a nuget package but that package is 100% compatible with the .Net standard 2.0 that I am using so when compiling it gives me a series of warning and errors, I want to change to the .Net Framework 4.6.1 that my VS recommends but when I try to change I can not since it does not give me the option to select another .Net Framework attached an image where I highlight the problem and with the warning messages that I find after compiling, it seems strange to me since I have installed the .Net Framework from 3.5 to 4.7.1 but it does not give me the option to use them. Please help me with this problem if you can tell me how to use the different versions of the .Net Framework, I thank them and please can explain it to me in an easy way since as I mention I am new and it is costing me a lot to understand these things I appreciate it a lot.!


  • mattwardmattward GBMember Xamurai

    If you change the .NET Standard project to be .NET Framework then you will not be able to reference it from the Android nor iOS project. So I do not think changing it to .NET Framework is the solution here.

    Either find a NuGet package that provides a .NET Standard 2.0 assembly or just test your application works, even though it is using a .NET Framework assembly from the NuGet package. For a lot of the NuGet packages, using a .NET Framework assembly is OK in a .NET Standard 2.0 project. I think there was some analysis done and some 70% of the NuGet packages on that had .NET Framework assemblies were compatible with .NET Standard 2.0. However you would need to test your application to ensure it works since the .NET Framework assembly may use an API that is not provided by .NET Standard 2.0.

  • acejack15acejack15 Member ✭✭

    hello mate I am already realizing what you say but I do not know if it is for my pc or something because I compile it after what you told me but now it gives me the two warning that I was commenting and now I have an error that I do not have no idea why, but if you compile me but you are giving me an error when it comes to getting an image through the camera, could not it be because of this error that points me?
    Severity Code Description Project File Line Suppression State Error Could not locate C:\Users\cmanu\source\repos\Pokedex\Pokedex\Pokedex\packages.config. Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the project file. Pokedex.Android

  • mattwardmattward GBMember Xamurai

    I do not believe the Microsoft.Bcl.Build error would be the cause for failing to get an image through the camera.

Sign In or Register to comment.