Is it possible to use .NET 4.6.1 for Xamarin on Mac? - c#

I want to use .NET PCL library from a NuGet that target .Net 4.6.1 in Xamarin PLC project.
I can add it to the project, it will build fine. But, I cannot reference it in the project itself, it just doesn't allow because of .NET versions differences. The maximum version that I can set for my PCL projects is 4.5.
I can select 4.5.1 for example but it will jump back to 4.5 due to missing profiles for that version.
I was not able to find those profiles or update .NET Framework.
If I'm doing something completely dumb, please, tell me :)

If you are using visual studio 2017, you need to go to the visual studio installer, and select a few more checkboxes:

Related

How to change .NET Framework to .NET Standard/Core in Visual Studio?

I have a solution in C# in Visual Studios. It was first created in .NET Framework. I want to convert the project to .NET Standard/Core. If I go into project --> properties I see the attached screen, where Target Framework is .NET Framework. How am I able to change that to .NET Standard/Core?
As Roman Ryzhiy mentions in the comments, this is the way to go:
https://learn.microsoft.com/en-us/dotnet/core/porting/
This worked fine for me, I upgraded a .NET Framework 4.7.2 projekt. It was a small project, so I had few aftermath-problems. After the upgrade, the Target Framework in the Application tab will say ".NET 5.0".
Install upgrade-assistant:
dotnet tool install -g upgrade-assistant
Go to your solution folder
Run the assistant:
upgrade-assistant upgrade your-project-name.csproj
Follow the steps in the assistant, it's really straight-forward.
Also, here are the steps more detailed:
https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview#installation-steps

The C# Project is targeting ".NetFramework, Version=v4.5,Profile=Unity Full v3.5", which is not instaled on this machine

I tried to open a script in VS2015 from Unity 5.6.
For some reasons, this popup shows up and I click the first option and change the target to .Net Framework 4.5.2 and everything builds and works as expected.
However, every time I made changes in the Unity editor and switched back to Visual Studio, this dialog pops up again.
When I looked into the csproj files, I can see that, after I made changes in the Unity editor, I see this:
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
Then after I selected "Change the target to .NET Framework 4.5.2"
I see this:
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
It seems that the Unity editor is configured to change the .Net Framework to 4.5.
I tried to install .Net Framework 4.5 but it is already installed.
Is there any way I can either use .Net 4.5 in Visual Studio or change the target framework in Unity such that this dialog won't pop up again?
Before you do anything complicated, try this:
Open Edit>Project Setting>Player
Click Other Setting, go to Configuration, if the scripting runtime version is .NET 3.5, change it to .NET 4.x.
This not only fixed the warning, it also got back VS intellisense and the MathNet.Numerics can now be installed properly.
If this does not work, then try this link project-target-framework-not-installed.
In the Unity roadmap is stated that support for .net 4.6 will be added arround july 2017. The beta is out allready.
Scripting Runtime Upgrade (Preview)
Upgrade Mono and IL2CPP .NET runtimes to support the latest .NET functionality and APIs. This includes access to C# 6 and the .NET 4.6.x class library profile.
Currently Unity is only compatible with .net 3.5 but here is an workaround which may help.
If you have any of the .NET Framework v4.6 series allready installed you only need to install the Visual Studio 2015 Tools for Unity to be able to use the project without conversions.

Using SSH.NET on C# Console application in Visual Studio 2008 and .NET Framework 3.5

I have a Visual Studio 2008 project in C# with .NET Framework 3.5 and I would like to use SSH.NET library but I see no binaries there for last stable release 2016.0.0.
Also in home page says it has been moved to here. Once I go to this page, I see three branches, develop, master and sftpfilestream, so which one I have to take which is compatible with .NET Framework 3.5 (My project uses .NET Framework 3.5 on Visual Studio 2008)?
Also If I downloaded any of them, once unzipped I do not see any DLL, only projects. Well, in fact, I prefer to reference a project within mine in order to use it, but by curiosity, where are the binaries (DLLs)? and which project is the correct I have to add to mine for .NET Framework 3.5?

How to create .NET Platform Standard project

I read up on the new .NET Platform Standard concept replacing the old Portable Class Libraries, which seems nice. However, I can't seem to figure out how to create such a library, yet.
Is there a Project Template for Visual Studio where I could choose the target generation / netstandard? Or do I have to manually change a PCL project.json file for this?
(Got VS15, Update 3 installed)
If you create a PCL project and then double click properties, you should see an option to change your target platform. That will let you choose a .net standard version. Same thing as doing it yourself in the project.json but is the closest thing I have found so far to having a VS template do it for you
You can follow this Create .NET Standard Packages with Visual Studio 2015
From the article:
This guide will walk you through creating a nuget package targeting
.NET Standard Library 1.4. This will work across .NET Framework 4.6.1,
Universal Windows Platform 10, .NET Core, and Mono/Xamarin.
On Visual Studio 2019 it is possible to create projects that target .NET standard, just as you create another type of project. To do so, you just need to add new project, and then if you search for .net standard it will show several types of projects in which you can target .NET standard, as shown below.
You can also create new .NET Platform Standard projects from a template by using Visual Studio 2017 RC.

.NET Framework 2.0 and 4.0 Visual Studio Toolbox item

I want to install two different version of my WinForms custom control in the Visual Studio Toolbox: the .NET Framework 2.0 version and the .NET Framework 4.0 one. I found this professional solution http://vstudiotoolbox.codeplex.com/ but selecting the proper .NET Framework is not covered.
Where can I learn more?
Thanks.
http://www.lextm.com/2012/08/how-to-install-custom-controls-to-visual-studio-part-i/
This covers what is required to install a .NET 2 control. If you want to install .NET 4's, you can follow
http://www.lextm.com/2012/08/how-to-install-custom-controls-to-visual-studio-part-ii/
My open source project is a sample for you to review how to perform the needed steps,
https://github.com/lextm/actionlistwinforms
Inno Setup is used to author the installer, but the tricks should apply to other installer techniques.

Categories