How to find which version of RazorEngine works with which .net framework? - razorengine

It am struggling to find out the simple information of which RazorEngine version works with which version of .net framework.
I am basically looking for the version that can work with .net core 2.2, but the dot net core version of Razor Engine (RazorEngine.NetCore 3.1.0) works only with .net core 3.1 and .net standard 2.0
I searched everything here https://github.com/Antaris/RazorEngine but could not find the .net core 2.2 compatible version of RazorEngine
Can anybody help?

Related

Compatibility/ Documentation with ML.NET on MVC5

I've read online and watched some videos concerning ML.NET and the usage of it. All the videos and documentation that I've read online were on ASP.NET Core. I was wondering if it was possible to use the ML.NET on MVC5 (Since that's what we've been taught in class and have to use for our project)
If it is compatible are there any links or suggestions on how to go about it?
ML.NET requires .NET Core in version 2.1 (or newer) or .NET Framework version 4.6.1 (or newer):
First, ensure you have installed .NET Core 2.1 or later. ML.NET also works on the .NET Framework 4.6.1 or later, but 4.7.2 or later is recommended.
Source: GitHub page for ML.NET
As long as your app is running on one of those .NET implementations, you should be good to go. Regardless of the app type (ASP.NET, Winforms, ...).
You can find samples here.

Can an app targeting .net framework 4.7.2 be safely run on .net framework 4.7.1?

I have this issue in which I'm currently targeting .NET Framework 4.7.2 in my solution but the Azure Web App Service only supports up to .NET Framework 4.7.1. So, my question is this: As long as I only use 4.7.1 features, should it work without issue on the Azure Web App Service (which only supports up to 4.7.1) even though I'm targeting 4.7.2? Are the .NET Frameworks backwards compatible? So far, I haven't seen any issues. I just want to make sure there will be no future complications. Ideally, I would like to keep targeting 4.7.2 so that I can start using the 4.7.2 features once it becomes available on Azure Web App Service.
The .NET Framework 4.7.2 builds on previous versions of the .NET Framework 4.x by adding many new fixes and several new features while remaining a very stable product.
The .NET Framework 4.7.2 is included with the Windows 10 April 2018 Update
The .NET Framework 4.7.2 can be used to run applications built for the .NET Framework 4.0 through 4.7.1.
Azure App Service now supports 4.7.2
I think that you did a good thing in upgrading and targeting .NET Framework 4.7.2 ; I also have an Azure App Service and upgraded it to 4.7.2 and it is running very well. As said before, it brings updates and fixes, and it is backward compatible on almost all cases.
Note that the recommended is that the target machine have a .Net version Equal or Greater of the of the .NET Framework 4.x than your compiled version.
See:
https://learn.microsoft.com/en-us/dotnet/framework/whats-new/index#v472
https://learn.microsoft.com/en-us/dotnet/framework/install/on-windows-10
#TheDude, you cannot build an app on 4.7.2 and hope to run it on lower version like 4.7.1. At runtime the target framework version check will fail as it will find the Framework version (4.7.2) as missing.
The other way round (i.e. target 4.7.1 and run on 4.7.2) is fine as the higher versions are backwards compatible.

Core 2 error referencing Framework libraries

I have a test project int Core 2 console (Core2ConsoleTest).
It make a reference to .NET Framework 4.6.1 Project (NetFrameworkTest).
NetFrameworkTest project references the standard System.Printer.dll.
Download Core2ConsoleTest project here
When I call to any System.Printer function I have the error: Could not load file or assembly 'System.Printing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. El sistema no puede encontrar el archivo especificado.
I tested with other standard libraries like System.Windows.Forms.dll and the same error if the Core project references a Nuget Package that uses standard libraries.
Note: The same error with ASP.Net Core 2
Thanks for your help!
This is not going to work on .NET Core.
.NET Core 2.0 has a compatibility layer that allows loading and using .NET Framework libraries but this only works as long as this library only uses types and methods that are also available on .NET Core.
Since System.Printing is not part of .NET Core, this library will fail to access it with the exception you posted.
Only .NET Framework applications can use this API (e.g. an ASP.NET Core on .NET Framework application).
I really have the problem with ASP.Net Core Framework Project. I'm unable to create a new Project with Core 2.0 and reference a Framework library that references System.Printing.dll or other libraries.
But #mairaw gave me another way: On a project that works in Core 1.1, updating the libraries Nuget to 2.0, works correctly.
So it looks like a Visual Studio 2017 problem or Core templates.
My concern is to remove this functionality, because it allows to adopt the Core technology in a staggered way with a high code reuse.
Edit: Added sample projects
CoreTest.zip -> A ASP.Net Core Framework Project created referencing Core 1.1 and .NET Framework 4.6.1 in the past, then upgraded to Core 2.0 using Nuget: WORKS!
Core2Framework.zip -> A similar project (ASP.Net Core Framework Project created referencing Core 2.0) created with Visual Studio 2017 15.3.4: ERROR when calling System.Prinig.dll from the .NET Framework 4.6.1 Project.

Can I use a .net 4.0 dll assembly reference in a .net 3.5 sharepoint web part?

I am using some dll's from the crm 2011 sdk in a .NET 3.5 web part.The target is for SharePoint 2010 online. When I try to build it gives me the following error:
The primary reference "microsoft.xrm.client" could not be resolved because it was built against the ".NETFramework,Version=v4.0" framework.
This is a higher version than the currently targeted framework ".NETFramework,Version=v3.5". VisualWebPartProjectWebServiceTest.
I cannot upgrade my web part to .NET 4.0 because SharePoint 2010 is not supporting .NET 4.0. Is there some other solution to reference .NET 4.0 dlls in a .NET 3.5 sharepoint webpart?
I will say NO, you can't use .Net framework 4.0 dll in 3.5 but Yes in the other way around. There are a few workarounds to achieve this, but in a little different way. Check these following SO posts for further reference:
Can you use a .NET 4.0 dll in a 3.5 project?
How Can i use .NET 4.0 code in C# project which is built using .NET framework 3.5?
Making a call to a .NET 4 library from 3.5

Is it possible to have single (portable?) library for .NET 3.5 and .NET 4.5?

We have a large project targeting SharePoint 2010/.NET 3.5 built against the SharePoint.dll and we plan to expand it to support SharePoint 2013 as well, but the new SharePoint uses SharePoint.dll compiled in .NET 4.5.
Is it possible to somehow share code between .NET 3.5 and .NET 4.5 projects, something like Portable Class Libraries, but between .NET 3.5 and 4.5? Or the only solution is starting new project for .NET 4.5 and using referenced files from the first .NET 3.5 project?
The .NET build target is per project, so a 4.5 solution can include a project library targetting 3.5. Your can have a 4.5 library that extends the 3.5 solution where required and your main solution can build to 4.5 and include the 4.5 library.
Thus both the 3.5 solution and the 4.5 solution use the same 3.5 SharePoint code library, but the 4.5 solution can extend your SharePoint library to take advantage of new features not available in 2010 and .Net 4.5

Resources