| Start |
|---|
| Global and local AssemblyInfo Having a global allows for better DRYness, you need only put values that are different into AssemblyInfo.cs for projects that have variance. This use assumes your product has more than one visual studio project. GlobalAssemblyInfo.cs AssemblyInfo.cs - one for each project You can add the GlobalAssemblyInfo.cs to the local project using the following procedure (opens new window):
|
| [AssemblyVersion] This attribute applies a version to the assembly. The |
| [AssemblyTitle] This attribute is used to give a name to this particular assembly. |
| [AssemblyProduct] This attribute is used to describe the product that this particular assembly is for. Multiple assemblies can be components of the same product, in which case they can all share the same value for this attribute. |
| Automated versioning Your code in source control has version numbers either by default (SVN ids or Git SHA1 hashes) or explicitly (Git tags). Rather than manually updating versions in AssemblyInfo.cs you can use a build time process to write the version from your source control system into your AssemblyInfo.cs files and thus onto your assemblies. The GitVersionTask (opens new window) or SemVer.Git.Fody (opens new window) NuGet packages are examples of the above. To use GitVersionTask, for instance, after installing the package in your project remove the Note that Semantic Versioning is increasingly the de facto standard so these methods recommend using source control tags that follow SemVer. |
| Common fields It's good practice to complete your AssemblyInfo's default fields. The information may be picked up by installers and will then appear when using Programs and Features (Windows 10) to uninstall or change a program. The minimum should be:
'AssemblyTitle' becomes the 'File description' when examining the DLL's Properties Details tab. |
| [InternalsVisibleTo] If you want to make In this example code in the assembly This is especially useful for unit testing to prevent unnecessary |
| Reading Assembly Attributes Using .NET's rich reflection APIs, you can gain access to an assembly's metadata. For example, you can get |
| [AssemblyConfiguration] AssemblyConfiguration: The AssemblyConfiguration attribute must have the configuration that was used to build the assembly. Use conditional compilation to properly include different assembly configurations. Use the block similar to the example below. Add as many different configurations as you commonly use. |
| [AssemblyKeyFile] Whenever we want our assembly to install in GAC then it is must to have a strong name. For strong naming assembly we have to create a public key.
To generate the To create a strong name key file
once the keyFileName.snk is created at specified directory then give refernce in your project . give Properties -> AssemblyInfo.cs Thi will create a strong name assembly after build. After creating your strong name assembly you can then install it in GAC Happy Coding ???? RemarksThe filename |
Read Article
https://develop.horje.com/learn/1434/reference