RSCG – RSCG_NameGenerator
| name | RSCG_NameGenerator |
| nuget | https://www.nuget.org/packages/RSCG_NameGenerator/ |
| link | https://github.com/ignatandrei/NameGenerator/ |
| author | Andrei Ignat |
Generating unique names for assemblies
This is how you can use RSCG_NameGenerator .
The code that you start with is
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <PackageReference Include="RSCG_NameGenerator" Version="2024.26.8.2002" > <OutputItemType>Analyzer</OutputItemType> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </PackageReference> </ItemGroup> <PropertyGroup> <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath> </PropertyGroup> </Project>
The code that you will use is
using Generated.TestNameGenerator;
//by just putting here
//you will not deploy the dll when you deploy the project
//name are generated in the code source
Console.WriteLine($"Name:{TheAssemblyInfo.GeneratedName}");
Console.WriteLine($"Nice:{TheAssemblyInfo.GeneratedNameNice}");
Console.WriteLine($"Small:{TheAssemblyInfo.GeneratedNameSmall}");
//if you want to generate a new name every time you run the app
//put in the csproj
//<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
//but the dll will be deployed with the app
//Console.WriteLine(NameGenerator.NameGeneratorData.Generate().UniqueNameLong);
The code that is generated is
// <auto-generated/>
namespace Generated.TestNameGenerator
{
public static class TheAssemblyInfo
{
public const string AssemblyName = "TestNameGenerator";
public const string GeneratedNameNice = "Sir Winston Churchill is feeling private in Naypyidaw";
public const string GeneratedNameSmall = "private-Sir Winston Churchill";
public const string GeneratedName = "private-Sir Winston Churchill-Naypyidaw";
}
}
Code and pdf at
https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_NameGenerator
Leave a Reply