Microsoft .NET Core SDK manager - .net-core

It turned out that i have tens of side by side installed Microsoft .NET Core SDK 2.1.??? (x64) visible from Apps & Features windows settings.
e.g.
Microsoft .NET Core SDK 2.1.100 (x64)
Microsoft .NET Core SDK 2.1.102 (x64)
Microsoft .NET Core SDK 2.1.104 (x64)
...
Microsoft .NET Core SDK 2.1.509 (x64)
Microsoft .NET Core SDK 2.1.511 (x64)
Microsoft .NET Core SDK 3.1.101 (x64)
Is there some kind of "dotnet core" runtime manager to keep these under control? e.g. like we have Android SDK manager where we can install/uninstall what we need in a batch?
Note: My problem is that if there is no such manager, i have to manually go through all uninstalls one by one.

I believe you have to generate a globals.json file in your current working directory, if you use the CLI.
https://learn.microsoft.com/en-us/dotnet/core/tools/global-json?tabs=netcore3x

Related

Unable to edit storyboards in Xamarin Forms for Windows

I am trying to edit the LaunchScreen.storyboard in my iOS project of my Xamarin Forms solution in Visual Studio (VS) for Windows . When I double click the storyboard to edit it, I receive the error message as follows:
"The iOS Designer requires an active connection to a Mac server. Please connect to a Mac to enable the designer."
However, I am connected to my Mac build server.
I have seen some older posts where there are mismatches between the Mac build server and the Windows development box so I checked for updates to Visual Studio on the Mac. There were some so I installed them. Then when I re-opened my project in Visual Studio for Windows and tried to connect to the Mac, I receive the error message as follows:
So I clicked to have Visual Studio correct the miss-match error and now I am back to the same error message saying "Something went wrong".. as shown above.
I have checked for updates to VS on Windows and there are currently no updates. (I really hate it when Microsoft release incompatible updates like this.. ARG!!!)
Here are the details for the Windows VS:
Microsoft Visual Studio Professional 2019
Version 16.8.2
VisualStudio.16.Release/16.8.2+30717.126
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Professional
Visual C++ 2019 00435-20050-31374-AA182
Microsoft Visual C++ 2019
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 2019 16.8.553.28003
ASP.NET and Web Tools 2019
ASP.NET Core Razor Language Services 16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c
Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2019 16.8.553.28003
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.8.553.28003
Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.6.1000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Functions and Web Jobs Tools 16.8.553.28003
Azure Functions and Web Jobs Tools
Azure Stream Analytics Tools for Visual Studio 2.6.1000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 3.8.0-5.20567.16+53c5d7d3cf13d88978744a32a27c5f8350a8400a
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.2.6 (master#34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Fabric.DiagnosticEvents 1.0
Fabric Diagnostic Events
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure HDInsight Azure Node 2.6.1000.0
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.6.1000.0
Language service for Hive query
Microsoft Azure Service Fabric Tools for Visual Studio 16.0
Microsoft Azure Service Fabric Tools for Visual Studio
Microsoft Azure Stream Analytics Language Service 2.6.1000.0
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30924.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio Process Editor 1.0
Process Editor for Microsoft Visual Studio Team Foundation Server
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Mono Debugging for Visual Studio 16.8.43 (00471f8)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 5.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.62010.06180
Microsoft SQL Server Data Tools
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript Tools 16.0.21016.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.8.0-5.20567.16+53c5d7d3cf13d88978744a32a27c5f8350a8400a
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual C++ for Cross Platform Mobile Development (Android) 16.0.30608.117
Visual C++ for Cross Platform Mobile Development (Android)
Visual F# Tools 16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd
Microsoft Visual F# Tools
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
Visual Studio Tools for Kubernetes 1.0
Visual Studio Tools for Kubernetes
VisualStudio.DeviceLog 1.0
Information about my package
VisualStudio.Foo 1.0
Information about my package
VisualStudio.Mac 1.0
Mac Extension for Visual Studio
Xamarin 16.8.000.255 (d16-8#d002176)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 16.8.0.507 (remotes/origin/d16-8#e87b24884)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 16.8.112 (86385a3)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 11.1.0.17 (d16-8/c0e2b8e)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8#79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2#ebe9000
SQLite: xamarin/sqlite/3.32.1#1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8#2fb1cbc
Xamarin.iOS and Xamarin.Mac SDK 14.4.1.3 (e30c41de3)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Here are the details for VS on the Mac
=== Visual Studio Professional 2019 for Mac ===
Version 8.8.2 (build 41)
Installation UUID: 7927aa3f-75df-48d3-a901-74299635ff3e
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000107
=== Mono Framework MDK ===
Runtime:
Mono 6.12.0.107 (2020-02/a22ed3f094e) (64-bit)
Package version: 612000107
=== Roslyn (Language Service) ===
3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa
=== NuGet ===
Version: 5.8.0.6860
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/5.0.100/Sdks
SDK Versions:
5.0.100
3.1.404
3.1.403
3.1.402
3.1.302
3.1.301
3.1.300
3.1.200
3.1.102
3.1.101
3.0.101
3.0.100
2.1.701
2.1.700
2.1.505
2.1.302
2.1.301
2.1.4
2.0.0
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.0
3.1.10
3.1.9
3.1.8
3.1.6
3.1.5
3.1.4
3.1.2
3.1.1
3.0.1
3.0.0
2.1.23
2.1.22
2.1.20
2.1.19
2.1.18
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.9
2.1.2
2.1.1
2.0.5
2.0.0
=== .NET Core 3.1 SDK ===
SDK: 3.1.404
=== Xamarin.Profiler ===
Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 12.2 (17535)
Build 12B45b
=== Xamarin.Mac ===
Version: 7.0.0.15 (Visual Studio Professional)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:40-0500
=== Xamarin.iOS ===
Version: 14.4.1.3 (Visual Studio Professional)
Hash: e30c41de3
Branch: d16-8
Build date: 2020-10-20 22:18:50-0400
=== Xamarin Designer ===
Version: 16.8.0.507
Hash: e87b24884
Branch: remotes/origin/d16-8
Build date: 2020-10-29 00:31:38 UTC
=== Xamarin.Android ===
Version: 11.1.0.17 (Visual Studio Professional)
Commit: xamarin-android/d16-8/c0e2b8e
Android SDK: /Users/gmceaser/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.5
SDK Build Tools Version: 29.0.2
Build Information:
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8#79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2#ebe9000
SQLite: xamarin/sqlite/3.32.1#1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8#2fb1cbc
=== Microsoft OpenJDK for Mobile ===
Java SDK: /Users/gmceaser/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:30 UTC
=== Android Device Manager ===
Version: 16.8.0.45
Hash: fc0af5f
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:54 UTC
=== Build Information ===
Release ID: 808020041
Git revision: dba789c00d07d6923cce74016b7e406526d683da
Build date: 2020-11-23 04:40:23-05
Build branch: release-8.8
Xamarin extensions: dba789c00d07d6923cce74016b7e406526d683da
=== Operating System ===
Mac OS X 10.16.0
Darwin 20.1.0 Darwin Kernel Version 20.1.0
Sat Oct 31 00:07:11 PDT 2020
root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
Any assistance would be greatly appreciated:
P.S. I have never tried to edit a storyboard in VS on windows before so I am not sure if I was ever able to do it but I know according to the documentation I am supposed to be able to do it.
So according to Microsoft here is the solution:
See https://developercommunity.visualstudio.com/comments/1255414/view.html for a work around. Basically, disconnect from Mac, Forget Mac, Add mac again via IP Address. Downside is that you get 2 connection options to the same Mac.
As a heads up - you may need to do the forget then reconnect to the Mac when you open a different project you want to edit the storyboard for even if you are already connected to the Mac by IP address. Basically, if you ever get the error, disconnect from the Mac - forget the Mac then reconnect to it by IP address.

F# Interactive (fsi.exe) support in.Net Core SDK (v3.1.100.14727)

I want to deploy\use F# interactive as part of a .Net library which supports both .Net Framework & .Net Core - I've done this before for just .Net Framework but now I want to support .Net Core, as a way of learning more about .NET Core.
I have VS2019 with the .NET Core SDK (v3.1.100.14727) installed.
I can run fsi.exe from the VS2019 install folder:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp
But I can not run fsi.exe. from the .NET Core SDK folder - not built to run on a Windows OS:
C:\Program Files\dotnet\sdk\3.1.100\FSharp
I would have thought if I have the correct version of the .Net Core runtime installed (which I do) I should be able to run any .Net Core application - is this not the case?
Do I have to deploy 2 versions of the F# Interactive to support a .Net Core implementation?
This just means that fsi.exe hasn't been compiled to run as a single exe but instead needs to be called via dotnet.
⨯ C:\Program Files\dotnet\sdk\3.1.100\FSharp 
[00:00] ❯ dotnet .\fsi.exe
Microsoft (R) F# Interactive version 10.7.0.0 for F# 4.7 Copyright (c)
Microsoft Corporation. All Rights Reserved.
For help type #help;;
>
You could wrap this or try the --targetprofile option.

which .NET SDK version project refer if there are multiple version installed on system?

I have 2.1.4 version of .NET SDK installed on the system but I was getting "The current .NET SDK does not support targeting .NET Core 2.1. target .NET Core 2.0 or lower or use a vs of the .NET SDK that support NET Core 2.1" error on opening an existing project.
Now I have installed 2.2.104 version for .NET SDK along with existing one. So which version of SDK my project is referring now, I'm not sure. Can someone please help on this.
Your confusion is probably because you think SDK 2.1.x (2.1.4) should be able to target .NET Core 2.1. That's unfortunately not true. As you can see on the .NET Core 2.0 download site, the .NET Core 2.1.4 SDK is for .NET Core 2.0!
If you want to target .NET Core 2.1, you need SDK version 2.1.300 or later. SDK 2.2.104 should be good enough for this.
If you have installed multiple .NET Core SDKs, the latest (the one with the highest version number) is the one used by default. You can run dotnet --info to see all the installed SDK and Runtimes. It will also tell if you if a global.json file is making .NET Core use another SDK instead of the latest. You can use a global.json file to force a different version of .NET Core SDK to be used.

VS for Mac 2017 building with .NET Core SDK instead of Mono

I have several solutions that target some combination of .NET Standard 2.0 or .NET Core 2.1. I have the latest .NET Core 2.1 SDK installed.
When I build them via Visual Studio for Mac, I notice it is using the Mono build tools instead of dotnet such as csc.exe:
Target CoreCompile:
/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Roslyn/csc.exe
Is there an option or some other property needs changed so that it can use the SDK instead of the Mono tools?
There is no option to use dotnet for building within Visual Studio for Mac. It uses msbuild. If you really want to do that you would need to bypass the built-in support and use of msbuild that VS Mac provides.
VS Mac uses msbuild that ships with Mono because it supports more target frameworks (e.g. Xamarin.iOS, Xamarin.Android) than the .NET Core SDK's MSBuild does. Note that VS on Windows takes a similar approach where it uses a desktop MSBuild to run builds and does not use dotnet build.
However Mono's MSBuild still uses the various MSBuild sdk target files that are shipped with the .NET Core SDK. There is an MSBuild sdk resolver that ships with Mono that allows the .NET Core SDK msbuild targets to be found and used.
Also note that Mono's MSBuild includes some parts of the .NET Core SDK so it can compile .NET Standard projects without needing the .NET Core SDK.

How to Open .NET Core CLI Project in Visual Studio 2017

For one of my classes this semester, I am required to use .NET Core 1.1 and version 1.0.0-preview2-003177 of the CLI tools. How can I open such a project in Visual Studio 2017? I have found solutions that work for 1.0.0-preview4-004233, but I am not allowed to upgrade my project to the newer version due to my professor's requirements.

Resources