ant4c.net.framework.module 2020.9.0

dotnet add package ant4c.net.framework.module --version 2020.9.0
NuGet\Install-Package ant4c.net.framework.module -Version 2020.9.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ant4c.net.framework.module" Version="2020.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ant4c.net.framework.module --version 2020.9.0
#r "nuget: ant4c.net.framework.module, 2020.9.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ant4c.net.framework.module as a Cake Addin
#addin nuget:?package=ant4c.net.framework.module&version=2020.9.0

// Install ant4c.net.framework.module as a Cake Tool
#tool nuget:?package=ant4c.net.framework.module&version=2020.9.0

Example of using in C#:

using System;
using Ant4C.Net.Framework.Module;

namespace Application
{
    class MainClass
    {
        public static void Main()
        {
            Console.WriteLine(
                "You running at the .NET Framework version {0}.",
                VersionDetector.GetVersion());

            var versions = new Version[] {
                new Version("2.0"), new Version("3.0"),
                new Version("3.5"), new Version("4.0"),
                new Version("4.5") };

            foreach (var version in versions)
            {
                Console.WriteLine(
                    "-Is .NET Framework {0} available? \n-{1}", version,
                    VersionDetector.Exists(version.ToString()) ? "Yes." : "No.");
            }
        }
    }
}

Possible output:

You running at the .NET Framework version 4.8.4300.0.
-Is .NET Framework 2.0 available?
-No.
-Is .NET Framework 3.0 available?
-No.
-Is .NET Framework 3.5 available?
-No.
-Is .NET Framework 4.0 available?
-Yes.
-Is .NET Framework 4.5 available?
-Yes.

Example code for Ant4C users:

<?xml version="1.0"?>
<project>
  <loadtasks module="ant4c.net.framework.module.dll" />

  <property name="is-assembly"
      value="${file::is-assembly('...\ant4c.net.framework.module.dll')}" />
  <echo level="Debug">is-assembly -> ${is-assembly}</echo>

  <property name="is-assembly"
      value="${file::is-assembly('...\ant4c.net.framework.module.clr.dll')}" />
  <echo level="Debug">is-assembly -> ${is-assembly}</echo>

  <property name="is-assembly"
      value="${file::is-assembly('ant4c.net.framework.module.clr.dll_')}"
            failonerror="false" />

  <property name="framework-directory"
            value="${framework::get-framework-directory()}" />
  <echo level="Debug">framework-directory -> ${framework-directory}</echo>

  <property name="framework-directory"
            value="${framework::get-framework-directory('NOT_USED')}" />
  <echo level="Debug">framework-directory -> ${framework-directory}</echo>

  <property name="frameworks"
            value="${framework::get-frameworks()}" />
  <echo level="Debug">frameworks -> ${frameworks}</echo>

  <property name="frameworks"
            value="${framework::get-frameworks('NOT_USED')}" />
  <echo level="Debug">frameworks -> ${frameworks}</echo>

  <property name="clr-version" value="${framework::get-clr-version()}" />
  <echo level="Debug">clr-version -> ${clr-version}</echo>

  <property name="runtime-framework"
            value="${framework::get-runtime-framework()}" />
  <echo level="Debug">runtime-framework -> ${runtime-framework}</echo>

  <property name="framework-exists" value="${framework::exists('net-4.0')}" />
  <echo level="Debug">framework-exists -> ${framework-exists}</echo>

  <property name="runtime_v2" value="${metahost::runtime('v2.0.50727')}" />
  <echo level="Debug">runtime_v2 -> ${runtime_v2}</echo>

  <property name="runtime_v4" value="${metahost::runtime('v4.0.30319')}" />
  <echo level="Debug">runtime_v4 -> ${runtime_v4}</echo>

  <property name="clr-version-from-file"
    value="${metahost::get-clr-version-from-file('...\ant4c.net.framework.module.clr.dll')}" />
  <echo level="Debug">clr-version-from-file -> ${clr-version-from-file}</echo>

  <property name="clr-version-from-file"
    value="${metahost::get-clr-version-from-file('...\ant4c.net.framework.module.dll')}" />
  <echo level="Debug">clr-version-from-file -> ${clr-version-from-file}</echo>
</project>

ant4c /f:sample.build -modulepriority -debug

See the package help file (located inside package) for more information.

Product Compatible and additional computed target framework versions.
.NET Framework net20 is compatible.  net35 was computed.  net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 2.0

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2020.9.0 386 12/28/2020

Module contains 'file', 'framework' and 'metahost' name spaces with
functions: 'file::is-assembly()', 'framework::exists()',
'framework::get-clr-version()', 'framework::get-framework-directory()',
'framework::get-frameworks()', 'framework::get-runtime-framework()',
'metahost::runtime()' and 'metahost::get-clr-version-from-file()'.

For .NET Framework users available 'VersionDetector' class with static
functions 'GetVersion()' and 'Exists()'.