Black.Beard.Roslyn 1.0.140

dotnet add package Black.Beard.Roslyn --version 1.0.140
                    
NuGet\Install-Package Black.Beard.Roslyn -Version 1.0.140
                    
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.140" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Black.Beard.Roslyn" Version="1.0.140" />
                    
Directory.Packages.props
<PackageReference Include="Black.Beard.Roslyn" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Black.Beard.Roslyn --version 1.0.140
                    
#r "nuget: Black.Beard.Roslyn, 1.0.140"
                    
#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.
#:package Black.Beard.Roslyn@1.0.140
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Black.Beard.Roslyn&version=1.0.140
                    
Install as a Cake Addin
#tool nuget:?package=Black.Beard.Roslyn&version=1.0.140
                    
Install as a Cake Tool

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 net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.140 411 4/14/2025
1.0.138 344 4/14/2025
1.0.137 345 4/3/2025
1.0.136 337 4/1/2025
1.0.135 319 4/1/2025
1.0.134 310 4/1/2025
1.0.133 436 1/27/2025
1.0.132 278 12/21/2024
1.0.131 339 12/7/2024
1.0.130 268 11/27/2024
1.0.129 261 11/24/2024
1.0.128 315 11/19/2024
1.0.127 241 11/19/2024
1.0.126 264 11/18/2024
1.0.125 257 11/17/2024
1.0.124 268 11/17/2024
1.0.123 255 11/17/2024
1.0.122 251 11/17/2024
1.0.121 260 11/17/2024
1.0.120 753 10/28/2024
Loading failed