Do the following when adding a new project:
- Add a project to the AccessibilityInsights Solution (
src\AccessibilityInsights.sln). - Right-click on the project and select Properties.
- In the Application tab, configure "Target Framework" to use the same .NET Framework version used by the
AccessibilityInsightsproject.- Currently .NET Framework 4.8 is used as target.
- In the build tab, set the following for both Debug and Release configurations:
- "Warning level" to 4.
- "Treat warnings as errors" to "All".
- Add the following NuGet packages in Visual Studio to enable signing and code analysis:
Microsoft.VisualStudioEng.MicroBuild.Core Microsoft.CodeAnalysis.FxCopAnalyzers - Close the solution and use your text editor to make the following changes to your
.csprojfile to properly configure the version and signing options:- Add the following line with the other
.csfiles):
<Compile Include="$(TEMP)\A11yInsightsVersionInfo.cs" /> - Add the following below the last ItemGroup:
<ItemGroup> <DropSignedFile Include="$(OutDir)\[your project name].dll" /> </ItemGroup> <Import Project="..\..\build\settings.targets" /> - Add the following line with the other
- Use your text editor to make the following changes to your project's
Properties\AssemblyInfofile to set the correct version:- Remove the following lines from the following lines, as well as the commented lines above them:
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("1.0.0.0")]
- Remove the following lines from the following lines, as well as the commented lines above them:
- Verify that Visual Studio can successfully load and build the entire solution in both Debug and Release.
- If your new assembly is to be shipped in the MSI, use your text editor to add the following to the
Product.wxsfile in theMSIproject:- If your project does not implement an extension interface, add the following with the other main assemblies:
<File Source="..\AccessibilityInsights\bin\Release\<AssemblyName>.dll" /> - If your project implements an extension interface, repeat the following pattern for your assembly and each of its dependencies in the
ExtensionsCompcomponent:
<File Source="..\AccessibilityInsights.Extensions.Telemetry\bin\Release\<AssemblyName>.dll" Id = <AssemblyName>_extension"/>
(Add assembly dependencies if they aren't already installed by another extension--if you aren't are of your dependencies, look at the contents of your project'sbin\releasefolder). - After updating the
.WXSfile, manually build theMSIproject by right-clicking on it in the Solution Explorer, then clicking "Build". Address any errors that occur.
- If your project does not implement an extension interface, add the following with the other main assemblies:
- Close the solution and use your text editor to add the following line to your
.csprojfile to properly configure Strong Naming for your assembly:
<Import Project="..\..\build\delaysign.targets" /> - Verify that Visual Studio can successfully load and build the entire solution in both Debug and Release. Ensure that the tests are appropriately discovered in the test explorer, and that they all run successfully.