Black.Beard.Roslyn 1.0.92

There is a newer version of this package available.
See the version list below for details.
dotnet add package Black.Beard.Roslyn --version 1.0.92                
NuGet\Install-Package Black.Beard.Roslyn -Version 1.0.92                
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="Black.Beard.Roslyn" Version="1.0.92" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Black.Beard.Roslyn --version 1.0.92                
#r "nuget: Black.Beard.Roslyn, 1.0.92"                
#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 Black.Beard.Roslyn as a Cake Addin
#addin nuget:?package=Black.Beard.Roslyn&version=1.0.92

// Install Black.Beard.Roslyn as a Cake Tool
#tool nuget:?package=Black.Beard.Roslyn&version=1.0.92                

Black.Beard.Roslyn

Build status

Use Roslyn for generate the assembly


    // Use NJsonSchema for generate json schema
    JsonSchema schema = JsonSchema.FromType(typeof(Sample1));

    // Helper for manipulate codeDom object
    var samples = "CodeDOMSample".ToNamespace()
        .Import("System")       // append usings

        .AppendPoco(schema)     // add a poco class from schema

        .ToCSharp(Path.Combine(_dir.FullName, "class1.cs")) // Generate csharp code
        ;

    // compile
    AssemblyResult assembly = GetCsharpBuilder(samples.FullName);

    // consumme the result assembly
    if (assembly.Success)
    {
        var ass = assembly.LoadAssembly();
        var type = ass.GetTypes().First(c => c.Name == "Sample1");
        Assert.NotNull(type);
    
        var property = type.GetProperties().FirstOrDefault(c => nameof(Sample1.Name) == c.Name);
        Assert.NotNull(property);
    
    }
    else
    {
        var payload = File.ReadAllText(samples.FullName);
        throw new Exception();
    }


    private static Bb.Compilers.AssemblyResult GetCsharpBuilder(string filepathCode)
    {

        var fileInfo = new FileInfo(filepathCode);

        // Build assembly

        Action<CSharpCompilationOptions> action = (r) =>
        {

        };

        BuildCSharp builder = new BuildCSharp()
        {
            ResolveAssembliesInCode = true,
            Debug = true,
            LanguageVersion = LanguageVersion.CSharp7,
        }
        .AddSource(fileInfo)
        .Suppress("CS1702", "CS1998")
        ;

        // System.Collections
        builder.References.AddRange(
            typeof(object),
            typeof(RequiredAttribute)
        );

        var assembly = builder.Build();
        return assembly;

    }        

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Black.Beard.Roslyn:

Package Downloads
Black.Beard.Jslt

Implementation of jslt language in DOTNET. Use a template for transform Json document to another json document.

Black.Beard.OpenApi

add helpers for manipulate open api document. provide a visitor pattern.

Black.Beard.OpenApiServices

add visitor for generate code from open api documentation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.119 57 5/3/2024
1.0.118 112 5/2/2024
1.0.117 179 4/7/2024
1.0.114 262 4/3/2024
1.0.113 293 3/31/2024
1.0.112 219 3/19/2024
1.0.111 106 3/16/2024
1.0.110 98 3/16/2024
1.0.109 135 3/15/2024
1.0.108 145 3/13/2024
1.0.107 194 3/12/2024
1.0.106 102 3/9/2024
1.0.105 92 3/6/2024
1.0.104 100 3/5/2024
1.0.103 144 3/4/2024
1.0.102 138 3/4/2024
1.0.101 98 3/4/2024
1.0.100 128 3/4/2024
1.0.99 141 3/3/2024
1.0.98 85 2/29/2024
1.0.97 91 2/29/2024
1.0.96 88 2/29/2024
1.0.95 105 2/27/2024
1.0.94 111 2/26/2024
1.0.93 119 2/25/2024
1.0.92 87 2/24/2024
1.0.91 91 2/24/2024
1.0.90 90 2/24/2024
1.0.89 180 2/24/2024
1.0.88 87 2/24/2024
1.0.87 109 2/23/2024
1.0.86 94 2/23/2024
1.0.85 92 2/23/2024
1.0.84 103 2/23/2024
1.0.83 102 2/23/2024
1.0.82 96 2/23/2024
1.0.81 95 2/22/2024
1.0.80 88 2/22/2024
1.0.79 79 2/22/2024
1.0.78 72 2/22/2024
1.0.77 96 2/21/2024
1.0.76 128 2/19/2024
1.0.75 89 2/19/2024
1.0.74 77 2/18/2024
1.0.73 81 2/17/2024
1.0.72 253 12/12/2023
1.0.70 230 10/17/2023
1.0.69 158 10/17/2023
1.0.68 128 10/17/2023
1.0.67 130 10/16/2023
1.0.66 145 10/16/2023
1.0.65 178 10/13/2023
1.0.64 173 10/10/2023
1.0.63 246 9/13/2023
1.0.62 174 7/31/2023
1.0.61 181 7/28/2023
1.0.60 163 7/28/2023
1.0.59 185 7/28/2023
1.0.58 170 7/28/2023
1.0.57 128 7/28/2023
1.0.56 151 7/27/2023
1.0.55 157 7/27/2023
1.0.54 185 7/27/2023
1.0.53 160 7/27/2023
1.0.52 176 7/27/2023
1.0.51 202 7/25/2023
1.0.50 170 7/25/2023
1.0.49 429 7/4/2023
1.0.48 210 6/30/2023
1.0.47 239 6/30/2023
1.0.46 195 6/30/2023
1.0.45 243 6/17/2023
1.0.44 224 6/17/2023
1.0.43 204 6/17/2023
1.0.42 223 6/6/2023
1.0.41 237 6/5/2023
1.0.40 206 6/5/2023
1.0.39 243 6/5/2023
1.0.38 244 5/31/2023
1.0.37 168 5/30/2023
1.0.36 209 5/30/2023
1.0.35 172 5/30/2023
1.0.33 197 5/30/2023
1.0.32 224 5/30/2023
1.0.31 191 5/30/2023
1.0.30 198 5/29/2023
1.0.29 206 5/25/2023
1.0.28 182 5/24/2023
1.0.27 179 5/18/2023
1.0.26 193 5/18/2023
1.0.25 212 5/18/2023
1.0.24 192 5/16/2023
1.0.23 200 5/15/2023
1.0.22 190 5/15/2023
1.0.20 174 5/14/2023
1.0.18 1,264 5/18/2022
1.0.17 1,693 5/17/2022
1.0.16 443 5/17/2022
1.0.15 470 4/3/2022
1.0.13 449 4/3/2022
1.0.12 1,733 3/28/2022
1.0.11 439 3/27/2022
1.0.10 3,683 3/16/2022
1.0.9 451 3/16/2022
1.0.8 445 3/16/2022
1.0.7 456 3/16/2022
1.0.6 487 3/16/2022
1.0.5 449 3/16/2022
1.0.4 444 3/14/2022
1.0.3 459 3/6/2022
1.0.2 9,834 12/19/2021
1.0.1 418 12/18/2021