How do I convert a project from targeting .net core to target framework to a .net standard? - visual-studio

I created a new .net core 3.1 project and built it using VS2019 16.4.4
Now I want to change it to .Net Standard.
I know to go to the project properties and select the Target framework combo.
However no Standard framework options appear.
If I select Install other frameworks then I am taken to The download .Net SDKs for Visual Studio page
However the SDK I want is already installed on my machine.
Why am I not seeing what I want in the combo box.?

.NET Standard, like .NET Core and .NET Framework, is separate framework, so you can't switch that easily. You would need to create separate project targeting .NET Standard. Once you do it, you will see other options in 'Target framework'.
Worth to mention, you can't reference .NET Core and .NET Framework projects from your .NET Standard library, since .NET Standard is just an abstraction which is built differently depending on the executing environment (.NET Core or Framework)

Related

How can I switch an existing 'Class Libray' project to target .NET 5

I have multiple class library projects targeting .NET Framework 4.7.2. I want to upgrade to .NET 5. In the project properties I only see versions of the .NET framework, I don't see .NET 5. I know I could open the project as a file and modify the target framework but what is the correct way of doing it with the UI?
Microsoft provides here a good migration example. You can also check this post with another example.
If you intend to do this gradually, keeping common packages compatible with both .NET Framework and .NET 5, you may use .NET Standard projects/packages for that.

How to convert NetFramwork 4 code to NetCore 2?

I have a C# project which was created using NetFramework 4.6. I want to convert it to using the NetCore 2.1.
I checked the network, and people say I can just change the Target Framework value in the project's properties page. But on my computer, I cannot see options for NetCore.
I already have the NetCore 2.1 SDK installed.
Is there another way to convert the project? Is there something wrong with my project that prevents it getting converted?
People are wrong, there is no such "one step" approach.
Remember that .NET Core is not a higher version of .NET Framework, it is rather a rewrite from scratch. So it does not work like retargeting .NET Framework version form 4.0 to 4.5.
Porting to .NET Core from .NET Framework is a good place to get started.
Edit: This page lists some differences between .NET Core and .NET Framework.
You can't do this simply like this; because of their totally different frameworks, not different versions of same framework. You have to port your project to .net core; there is one of the nice extension for visual studio that generate a report for you about how portable your code is between .NET Framework and .NET Core.
This is also one of the article about the issue that may be useful for you.

ABP 3.0 differences between Full and Cross Net Framework template

Related to "Free Startup Templates" for the last ABP 3.0 version, what are the differences between the Full .NET Framework and .Net Core (Cross Platform) versions?
I presume you are talking about the ASP.NET Core 2.0 target framework, either Full .NET Framework and .NET Core (Cross Platform)?
I think the code is more-or-less the same (as mentioned by #Alper Ebicoglu the .NET Core project is missing the SignalR implementation) but the output from the build will be for .NET Framework 4.6.1 as supposed to for .NET Core.
Basically they're building a .NET Framework project using .NET Core tools which you can do.
For example:
Create a temp folder and open Command Prompt or PowerShell in that directory. Then run dotnet new console, then dotnet restore and finally dotnet build. You should get a message like temp -> C:\Source\temp\bin\Debug\netcoreapp2.0\temp.dll
Edit the .csproj file and change the TargetFramework property to net461. Run dotnet build and you'll see a different message temp -> C:\Source\temp\bin\Debug\net461\temp.exe.
In the first instance you created a .dll to run cross platform using dotnet run and in the second instance you created a .exe which will only run on the Windows platform.
I hope I'm answering what you're asking and this helps.
if we talk about only aspnetboilerplate framework; the only main difference is, currently in .NET Core platform SignalR implementation is missing.

Creating Azure Function Project in .NET Core Targets .NET Framework

I upgraded my Visual Studio 2017 to the latest version i.e. 15.3. I then upgraded the VS Extension for Azure Functions and WebJobs.
When I create a new Azure Function project targeting .NET Core 2.0, it still targets .NET Framework. See below...
This is the project file:
P.S. To be fair, the dialog says .NET Framework 2.0 NOT .NET Core 2.0. So I guess MS means literally targeting .NET Framework 2.0!!!
Update 12/21/17 See newer post here: Develop Azure Functions on any platform
Previous answer
The behavior can be a bit confusing; I've now clarified the blog post: Azure Functions Tools released for Visual Studio 2017 Update 3.
The project type is .NET Standard, but we don't currently support the .NET Standard 2.0 facades in the Azure Functions runtime. Now that .NET Standard 2.0 is RTM, we will make this update in a future release. Once this happens, you won't have to make any project changes other than changing the target framework.
Currently, Azure Functions runs only on full framework, so there is no benefit to targeting netstandard2.0. However, we are porting the runtime to .NET Core, at which point there is a difference. Once that work is complete, the New Project dialog will target netstandard2.0 by default.

Need to evaluate TeeChartNET2015EVAL_4.1.2015.12166.exe with Framework 3.5

Looks like when I run TeeChartNET2015EVAL_4.1.2015.12166.exe, it installs version of TeeChart.dll built on framework 4.5 only. I need to do the evaluation with the dll built with framework 3.5 (because I have to integrate to an already existing application based on Framework 3.5). Is there any way I can get the evaluation dll for Framework 3.5?
Thanks
When running the installer you need to choose which environments do you want the assemblies for. If you choose Visual Studio 2008 this will install .NET Framework 3.5 assemblies as this is the default framework supported by this environment.

Resources