{"id":22070376,"url":"https://github.com/posinformatique/posinformatique.visualstudio.templates","last_synced_at":"2025-07-23T18:05:24.095Z","repository":{"id":206598198,"uuid":"717187367","full_name":"PosInformatique/PosInformatique.VisualStudio.Templates","owner":"PosInformatique","description":"Visual Studio code templates for P.O.S Informatique and also for its customers or project partners.","archived":false,"fork":false,"pushed_at":"2024-11-06T08:53:00.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-23T18:52:52.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PosInformatique.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-10T19:01:01.000Z","updated_at":"2024-11-06T08:53:02.000Z","dependencies_parsed_at":"2023-11-11T01:31:56.554Z","dependency_job_id":"cf396f14-d5b3-47a1-9e8d-298344108a64","html_url":"https://github.com/PosInformatique/PosInformatique.VisualStudio.Templates","commit_stats":null,"previous_names":["posinformatique/posinformatique.visualstudio.templates"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/PosInformatique/PosInformatique.VisualStudio.Templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.VisualStudio.Templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.VisualStudio.Templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.VisualStudio.Templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.VisualStudio.Templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PosInformatique","download_url":"https://codeload.github.com/PosInformatique/PosInformatique.VisualStudio.Templates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PosInformatique%2FPosInformatique.VisualStudio.Templates/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266726615,"owners_count":23974926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T20:16:11.950Z","updated_at":"2025-07-23T18:05:24.077Z","avatar_url":"https://github.com/PosInformatique.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P.O.S Informatique Visual Studio Templates\n\nThis repository contains Visual Studio templates of P.O.S Informatique company and can be used\nas *white label* when working for different customers.\n\nThese templates follow the [StyleCop](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)\nand [Microsoft coding conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions).\n\n- [White label companies of the templates](#white-label-companies-of-the-templates)\n  - [Companies settings file](#companies-settings-file)\n- [Visual Studio item templates](#visual-studio-item-templates)\n- [Packaging of the Visual Studio Templates](#packaging-of-the-visual-studio-templates)\n  - [Build the VSIX package](#build-the-vsix-package)\n  - [Generate the ATOM feed for the private extensions gallery](#generate-the-atom-feed-for-the-private-extensions-gallery)\n- [Build and deploy the Visual Studio templates](#build-and-deploy-the-visual-studio-templates)\n- [Install the Visual Studio Templates](#install-the-visual-studio-templates)\n\n## White label companies of the templates\nIf you work in a *Digital Services Company* with multiple customers, the source code edited\nbelong to your customer and maybe you have to write the customer company name on the header.\n\nFor example, for the *P.O.S Informatique* company:\n```csharp\n//-----------------------------------------------------------------------\n// \u003ccopyright file=\"CustomerManager.cs\" company=\"P.O.S Informatique\"\u003e\n//     Copyright (c) P.O.S Informatique. All rights reserved.\n// \u003c/copyright\u003e\n//-----------------------------------------------------------------------\n```\n\nIf you switch to another customer called *Chantier Connect*, the header of the C# files\nwill be:\n```csharp\n//-----------------------------------------------------------------------\n// \u003ccopyright file=\"CustomerManager.cs\" company=\"Chantier Connect\"\u003e\n//     Copyright (c) Chantier Connect. All rights reserved.\n// \u003c/copyright\u003e\n//-----------------------------------------------------------------------\n```\n\nIt is not easy to have manage and have different templates for each customers.\n\nTo fix this issue and allow to work with different companies with the same Visual Studio instance, these\ntemplates, will read the `stylecop.json` file in your project and extract the company name.\nSee the [Configuring StyleCop Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/Configuration.md)\nfor more information.\n\nIf no `stylecop.json` file exists, a wizard will be displayed to ask you the name of the company to put on the header.\n\n![Ask Company](docs/AskCompany.png)\n\n### Companies settings file\n\nIf there is no `stylecop.json` file associated to the project, the company name is asked \nonly once for each solution stored in your computer.\nThe association between the company and the solutions are saved in the following mapping file:\n\n```\nC:\\Users\\\u003cWindows user\u003e\\AppData\\Local\\P.O.S Informatique\\Visual Studio\\Templates\\Companies.json\n```\n\nIf you need to reset the mapping association between the company and solutions, just delete\nthis file. The Visual Studio extension will ask you again the name of the company when adding\na file with the template.\n\n\u003e **NOTE**: We use this strategy in order to avoid be intrusive in your repository source code\nby saving additional information (inside file, .sln,...) for this extension. We would\nlike that the source codes of the respository must be separated of the Visual Studio extensions used.\n\n## Visual Studio item templates\nThe [PosInformatique.VisualStudio.Templates.sln](PosInformatique.VisualStudio.Templates.sln) solution contains 2 projects:\n- **VisualStudio.Templates**: Allows to generate a VSIX package for the Visual Studio extension.\n- **VisualStudio.Templates.Files**: Contains the following item templates:\n  - [Class.cs](./src/VisualStudio.Templates.Files/Class.cs): C# class\n  - [Exception.cs](./src/VisualStudio.Templates.Files/Exception.cs): C# exception class\n  - [ExceptionUnitTest.cs](./src/VisualStudio.Templates.Files/ExceptionUnitTest.cs): C# exception unit test class\n  - [Interface.cs](./src/VisualStudio.Templates.Files/Interface.cs): C# interface\n  - [RazorComponent.razor](./src/VisualStudio.Templates.Files/RazorComponent.razor): Razor component (a separate code behind C# class is included)\n    - [RazorComponent.razor.cs](./src/VisualStudio.Templates.Files/RazorComponent.razor.cs): Razor component code behind (in C#).\n  - [XUnitTest.cs](./src/VisualStudio.Templates.Files/XUnitTest.cs): C# XUnit test class\n\n![Templates](docs/Templates.png)\n\n## Packaging of the Visual Studio Templates\nThe [VisualStudio.Templates.package.proj](./VisualStudio.Templates.package.proj)\nfile is a MSBuild script which allows to perform the following operations:\n- Build the VSIX package of the Visual Studio Templates\n- Generate the ATOM file used to publish the Visual Studio extension inside a private extensions gallery.\n\n### Build the VSIX package.\nTo build the VSIX package:\n- Open the **Developer Command Prompt for VS2022**.\n- Go to the root directory of the repository.\n- Execute the following command:\n\n```cmd\nmsbuild PosInformatique.VisualStudio.Templates.package.proj /t:Build /p:OutDir=\"\u003cOutput folder\u003e\"\n```\n\nWith `\u003cOutput folder\u003e` the folder where the VSIX package.\n\n### Generate the ATOM feed for the private extensions gallery.\nTo generate the ATOM feed:\n- Open the **Developer Command Prompt for VS2022**.\n- Go to the root directory of the repository.\n- Execute the following command:\n\n```cmd\nmsbuild PosInformatique.VisualStudio.Templates.package.proj /t:Publish /p:OutDir=\"\u003cOutput folder\u003e\" /p:PublishUrl=\"\u003cPublish URL\u003e\"\n```\n\nWith:\n- `\u003cOutput folder\u003e` the folder where the VSIX package and the ATOM feed will be generated\n- `\u003cPublish URL\u003e` the URL where you would like to publish your extensions in private extensions gallery.\n\n## Build and deploy the Visual Studio templates\nTo deploy the Visual Studio you can use the\n[build/azure-pipelines-release.yaml](./build/azure-pipelines-release.yaml)\nAzure Pipeline YAML provided in the repository.\n\nThis Azure Pipeline YAML allows to publish the Visual Studio Templates extensions\ninside an Azure Web App and required 1 parameter:\n- `Version`: The version of the Visual Studio Templates extensions to build.\n\nAnd 2 variables:\n- `AzureSubscription`: The name of the Azure Subscription which contains the Azure Web App\n- `WebAppName`: The name of the Azure Web App where to publish the extensions.\n\nThe extensions will be publish inside a sub folder named `visualstudio-extensions`.\n\nThe extensions after published will be available in private extensions gallery with the following URL:\n`https://\u003cWebAppName\u003e.azurewebsites.net/visualstudio-extensions/`.\n\n\u003e **NOTE**: You do not need to fork this repository, you can plug this repository to you own Azure Pipeline.\n\n## Install the Visual Studio Templates\nIn the case your the extension is deployed in a private extensions gallery.\n\nTo install the Visual Studio Templates, add the P.O.S Informatique extension gallery:\n- Click to the **Tools**/**Options** menu.\n- Add an additional extension gallery with the following settings:\n  - **Name**: `P.O.S Informatique`\n  - **URL**: `\u003cPublish URL\u003e` (The URL when you published the ATOM feed that contains the VSIX file.)\n\nAfter the extension gallery has been added, developers can install the Visual Studio extension\nfrom the extensions manager of Visual Studio:\n- Click on the **Extensions**/**Manage Extensions** menu.\n- Select the **Online**/**P.O.S Informatique** gallery.\n- Download and install the **P.O.S Informatique Visual Studio Templates**.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposinformatique%2Fposinformatique.visualstudio.templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposinformatique%2Fposinformatique.visualstudio.templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposinformatique%2Fposinformatique.visualstudio.templates/lists"}