-
-
Notifications
You must be signed in to change notification settings - Fork 6
change category #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
change category #387
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Just later | ||
|
|
||
| ## Latest Update : 2025-07-26 => 26 July 2025 | ||
| ## Latest Update : 2025-07-28 => 28 July 2025 | ||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
|
|
||
| <h1>RSCG nr 210 : AssemblyVersionInfo</h1> | ||
|
|
||
| <h2>Info</h2> | ||
| Nuget : <a href="https://www.nuget.org/packages/AssemblyVersionInfo/" target="_blank">https://www.nuget.org/packages/AssemblyVersionInfo/</a> | ||
|
|
||
| <p>You can find more details at : <a href="https://github.com/BlackWhiteYoshi/AssemblyVersionInfo" target="_blank"> https://github.com/BlackWhiteYoshi/AssemblyVersionInfo</a></p> | ||
|
|
||
| <p>Author :Black White Yoshi</p> | ||
|
|
||
| <p>Source: <a href="https://github.com/BlackWhiteYoshi/AssemblyVersionInfo" target="_blank">https://github.com/BlackWhiteYoshi/AssemblyVersionInfo</a> </p> | ||
|
|
||
| <h2>About</h2> | ||
|
|
||
| Generating assembly version and other info from csproj to csharp | ||
|
|
||
| <h2> | ||
| How to use | ||
| </h2> | ||
| <h3> | ||
| Add reference to the <a href="https://www.nuget.org/packages/AssemblyVersionInfo/" target="_blank">AssemblyVersionInfo</a> in the csproj | ||
| </h3> | ||
| <img src="images/AssemblyVersionInfo/DemoAttr.csproj.png" width="580" height="580" /> | ||
|
|
||
| <h3>This was for me the <b>starting</b> code</h3> | ||
|
|
||
| <br /> | ||
| I have <b>coded</b> the file Program.cs | ||
| <br /> | ||
| <img src="images/AssemblyVersionInfo/csFiles/Program.cs.png" width="580" height="580" /> | ||
| <hr /> | ||
| <h3>And here are the <i>generated</i> files</h3> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is Assembly.g.cs | ||
| <br /> | ||
| <img src="images/AssemblyVersionInfo/generated/Assembly.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is BuilderAttribute.g.cs | ||
| <br /> | ||
| <img src="images/AssemblyVersionInfo/generated/BuilderAttribute.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is NullObjectAttribute.g.cs | ||
| <br /> | ||
| <img src="images/AssemblyVersionInfo/generated/NullObjectAttribute.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is ShadowWriter.TheProject.g.cs | ||
| <br /> | ||
| <img src="images/AssemblyVersionInfo/generated/ShadowWriter.TheProject.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <p> | ||
| You can download the code and this page as pdf from | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyVersionInfo'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyVersionInfo | ||
| </a> | ||
| </p> | ||
|
|
||
|
|
||
| <p> | ||
| You can see the whole list at | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG | ||
| </a> | ||
| </p> | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "generator":{ | ||
| "name":"AssemblyVersionInfo", | ||
| "nuget":[ | ||
| "https://www.nuget.org/packages/AssemblyVersionInfo/" | ||
| ], | ||
| "link":"https://github.com/BlackWhiteYoshi/AssemblyVersionInfo", | ||
| "author":"Black White Yoshi", | ||
| "source":"https://github.com/BlackWhiteYoshi/AssemblyVersionInfo" | ||
| }, | ||
| "data":{ | ||
| "goodFor":["Generating assembly version and other info from csproj to csharp"], | ||
| "csprojDemo":"DemoAttr.csproj", | ||
| "csFiles":["Program.cs"], | ||
| "excludeDirectoryGenerated":[""], | ||
| "includeAdditionalFiles":[""] | ||
| }, | ||
| "links":{ | ||
| "blog":"", | ||
| "video":"" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| AssemblyVersionInfo is a very simple source generator that generates constant strings of your assembly name and version. The intended usage is for the System.CodeDom.Compiler.GeneratedCodeAttribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # AssemblyVersionInfo | ||
|
|
||
| AssemblyVersionInfo is a very simple source generator that generates constant strings of your assembly name and version. | ||
| The intended usage is for the [GeneratedCodeAttribute](https://learn.microsoft.com/en-us//dotnet/api/system.codedom.compiler.generatedcodeattribute). | ||
|
|
||
| All it does is generating a the static class *Assembly* in the namespace *AssemblyVersionInfo*: | ||
|
|
||
| ```csharp | ||
| // <auto-generated/> | ||
|
|
||
| namespace AssemblyVersionInfo; | ||
|
|
||
| internal static class Assembly { | ||
| public const string NAME = "{{compilation.name}}"; | ||
|
|
||
| public const string VERSION_MAJOR = "{{compilation.version.Major}}"; | ||
| public const string VERSION_MINOR = "{{compilation.version.Minor}}"; | ||
| public const string VERSION_BUILD = "{{compilation.version.Build}}"; | ||
| public const string VERSION_REVISION = "{{compilation.version.Revision}}"; | ||
|
|
||
| public const string VERSION = "{{compilation.version}}"; | ||
| public const string VERSION_MAJOR_MINOR = "{{compilation.version.Major}}.{{compilation.version.Minor}}"; | ||
| public const string VERSION_MAJOR_MINOR_BUILD = "{{compilation.version.Major}}.{{compilation.version.Minor}}.{{compilation.version.Build}}"; | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| <br></br> | ||
| ## Get Started | ||
|
|
||
| 1. Add PackageReference to your .csproj file. | ||
|
|
||
| ```xml | ||
| <ItemGroup> | ||
| <PackageReference Include="AssemblyVersionInfo" Version="{latest version}" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| 2. Access the strings in the *Assembly* class. | ||
|
|
||
| ```csharp | ||
| using AssemblyVersionInfo; | ||
|
|
||
| const string example = $"AssemblyName={Assembly.NAME}, AssemblyVersion={Assembly.VERSION}"; | ||
| Console.WriteLine(example); | ||
| ``` |
48 changes: 48 additions & 0 deletions
48
v2/rscg_examples/AssemblyVersionInfo/src/.tours/AssemblyVersionInfo.tour
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
|
|
||
| { | ||
| "$schema": "https://aka.ms/codetour-schema", | ||
| "title": "AssemblyVersionInfo", | ||
| "steps": | ||
| [ | ||
| { | ||
| "file": "DemoAttr/DemoAttr.csproj", | ||
| "description": "First, we add Nuget [AssemblyVersionInfo](https://www.nuget.org/packages/AssemblyVersionInfo/) in csproj ", | ||
| "pattern": "AssemblyVersionInfo" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "DemoAttr/Program.cs", | ||
| "description": "File Program.cs \r\n>> dotnet run --project DemoAttr/DemoAttr.csproj ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
|
|
||
| ,{ | ||
| "file": "DemoAttr/obj/GX/ShadowWriter/ShadowWriter.ProjectInfoGenerator/ShadowWriter.TheProject.g.cs", | ||
| "description": "Generated File 4 from 4 : ShadowWriter.TheProject.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "DemoAttr/obj/GX/ShadowWriter/ShadowWriter.NullObjectGenerator/NullObjectAttribute.g.cs", | ||
| "description": "Generated File 3 from 4 : NullObjectAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "DemoAttr/obj/GX/ShadowWriter/ShadowWriter.BuilderGenerator/BuilderAttribute.g.cs", | ||
| "description": "Generated File 2 from 4 : BuilderAttribute.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "DemoAttr/obj/GX/AssemblyVersionInfo/AssemblyVersionInfo.Generator/Assembly.g.cs", | ||
| "description": "Generated File 1 from 4 : Assembly.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ], | ||
|
|
||
| "ref": "main" | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.14.36408.4 d17.14 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoAttr", "DemoAttr\DemoAttr.csproj", "{E7AE387F-3B33-41EF-A809-94E5C21EDBFC}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {E7AE387F-3B33-41EF-A809-94E5C21EDBFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {E7AE387F-3B33-41EF-A809-94E5C21EDBFC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {E7AE387F-3B33-41EF-A809-94E5C21EDBFC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {E7AE387F-3B33-41EF-A809-94E5C21EDBFC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {75065D34-E2FE-414E-BE26-D871D5945284} | ||
| EndGlobalSection | ||
| EndGlobal |
23 changes: 23 additions & 0 deletions
23
v2/rscg_examples/AssemblyVersionInfo/src/DemoAttr/DemoAttr.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net9.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
|
|
||
| <PropertyGroup> | ||
| <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
| <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath> | ||
| </PropertyGroup> | ||
|
|
||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="AssemblyVersionInfo" Version="1.0.2"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // Access project information anywhere in your code | ||
| Console.WriteLine($"Project Name: {AssemblyVersionInfo.Assembly.NAME}"); | ||
| Console.WriteLine($"Project Version: {AssemblyVersionInfo.Assembly.VERSION}"); | ||
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "scriptName": "AssemblyVersionInfo", | ||
| "steps": | ||
| [ | ||
| {"typeStep":"exec","arg":"clipchamp.exe launch"}, | ||
| {"typeStep":"text","arg": "Welcome to Roslyn Examples"}, | ||
| {"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"}, | ||
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, | ||
| {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, | ||
|
|
||
| {"typeStep":"text","arg": "Today I will present AssemblyVersionInfo . Generating assembly version and other info from csproj to csharp ."}, | ||
| {"typeStep":"browser","arg":"https://www.nuget.org/packages/AssemblyVersionInfo/"}, | ||
| {"typeStep":"text","arg": "The whole example is here"}, | ||
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyVersionInfo"}, | ||
| {"typeStep":"text","arg": "You can download the code from here"}, | ||
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyVersionInfo#download-example-net--c-"}, | ||
| {"typeStep":"text","arg":"Here is the code downloaded "}, | ||
| {"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\AssemblyVersionInfo\\src\\DemoAttr.sln"}, | ||
| {"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, | ||
| {"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\AssemblyVersionInfo\\src"}, | ||
|
|
||
| {"typeStep":"text","arg": "To use it ,you will put the Nuget AssemblyVersionInfo into the csproj "}, | ||
|
|
||
| {"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\AssemblyVersionInfo\\src\\DemoAttr\\DemoAttr.csproj"}, | ||
|
|
||
| {"typeStep":"text","arg": "And now I will show you an example of using AssemblyVersionInfo"}, | ||
|
|
||
| {"typeStep":"hide","arg": "now execute the tour in VSCode"}, | ||
| {"typeStep":"tour", "arg": "src/.tours/"}, | ||
| {"typeStep":"text","arg":" And I will execute the project"}, | ||
| {"typeStep":"showproj", "arg":"DemoAttr.csproj"}, | ||
| {"typeStep":"text","arg":" This concludes the project"}, | ||
| {"typeStep":"waitseconds","arg":"30"}, | ||
| {"typeStep":"text","arg": "Remember, you can download the code from here"}, | ||
| {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/AssemblyVersionInfo#download-example-net--c-", | ||
| SpeakTest=" "}, | ||
| {"typeStep":"waitseconds","arg":"30"}, | ||
| ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.