3.2 KiB
3.2 KiB
Adding a new project
Do the following when adding a new project:
For all projects
- 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
AccessibilityInsights
project.- 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".
For non-test projects only
- 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
.csproj
file to properly configure the version and signing options:- Add the following line with the other
.cs
files):
<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\AssemblyInfo
file 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.wxs
file in theMSI
project:- 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
ExtensionsComp
component:
<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\release
folder). - After updating the
.WXS
file, manually build theMSI
project 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:
For test projects only
- Close the solution and use your text editor to add the following line to your
.csproj
file 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.