Bscmake error bk1520

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications - microsoft-ui-xaml/developer_guide.md at main · microsoft/microsoft-ui-xaml

Developer Guide

This guide provides instructions on how to build the repository and test your changes.

  • Prerequisites
  • Building the repository
  • Testing
  • Telemetry

Additional reading:

  • Source code structure
  • Coding style and conventions

Prerequisites

Visual Studio

Install latest VS2019 (16.1 or later) from here: http://visualstudio.com/downloads

Include the following workloads:

  • .NET desktop development
  • Desktop Development with C++
  • Universal Windows Platform development

SDK

While WinUI is designed to work against many versions of Windows, you will need
a fairly recent SDK in order to build WinUI. It’s required that you install the
17763 and 22000 SDKs. You can download these via Visual Studio (check
all the boxes when prompted), or you can manually download them from here:
https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

Building the repository

The MUXControls.sln solution is used to build all feature areas (such as controls, layout panels and composition elements). The MUXControlsInnerLoop.sln solution can be used to build only select feature areas.
Generally, you will want to set your configuration to Debug, x64, and
select MUXControlsTestApp as your startup project in Visual Studio. To retrieve the appropriate dependencies, right click on the solution in the Solution Explorer and select «Restore NuGet Packages».

If you get the following error while building the project:

BSCMAKE : error BK1520: internal limit exceeded; cannot generate source database file; please consider removing option /FR or /Fr from compiler command line

You will need to disable Browse Information in Visual Studio here:

Working with the MUXControlsInnerLoop solution

To work on a specific feature or control using the MUXControlsInnerLoop solution you will need to modify the InnerLoopAreas.props file to include the desired controls and projects. For example, to work on the ItemsRepeater control you will need to add

<FeatureRepeaterEnabled>true</FeatureRepeaterEnabled>

to the InnerLoopAreas.props file.

A list of all areas can be found in the FeatureArea.props file. To include a component in the Microsoft.UI.Xaml.dll without adding it to the MUXControlsTestApp, you add it with productOnly instead of true:

<FeatureRepeaterEnabled>productOnly</FeatureRepeaterEnabled>

Both files are located at the root of the repository.

When switching between the MUXControls and MUXControlsInnerLoop solutions, make sure you either delete the BuildOutput folder in the solution’s root directory or run git clean -dfx in order to delete some build files which are incorrectly determined to be up to date by MSBuild after the switch.
Note that git clean -dfx deletes all untracked files, so it may also delete any changes you made. To see what would be deleted by that command without actually deleting anything, run git clean -dfxn.

If you use the inner loop solution, please avoid pushing changes to the inner loop solution or InnerLoopAreas.props files.
This can be accomplished by running the following commands in git:

git update-index --skip-worktree InnerLoopAreas.props
git update-index --skip-worktree MUXControlsInnerLoop.sln

Creating a NuGet package

To create a NuGet package for a given build flavor (release/debug) and build arch (x64/x86/ARM/ARM64), you first need to build the solution in that configuration.

After building the solution in the desired configuration, you can run the build-nupkg.ps1 script that will run the required steps.
The script takes the following arguments:

-BuildOutput

The path to the microsoft-ui-xaml BuildOutput folder

-BuildFlavor

The flavor to use for nuget build (debug or release). Defaults to release.

-BuildArch

The build arch to use for the .winmd and generic.xaml file, one of: x64, x86, ARM, ARM64. Defaults to x86.

-OutputDir

The folder in which the NuGet package will be generated.

-SkipFrameworkPackage

Can be specified to skip building a framework package. Defaults to False.
In order to generate framework packages, you need to generate package appx files.
This can be done using the MakeAllAppx.cmd located in the same folder as build-nupkg.ps1.

Example usage (running from the root of the repository folder):

// Builds a NuGet package with debug binaries and arch x64 into the folder "NuGetPackage"
.buildNuSpecsbuild-nupkg.ps1 -BuildOutput "....BuildOutput" -BuildFlavor "debug" -BuildArch "x64" -OutputDir "....NugetPackage"

Note: To use debug build outputs as a NuGet package, you need to change the following line in
microsoft-ui-xaml/dev/dll/Microsoft.UI.Xaml.Common.props from

<DisableEmbeddedXbf Condition="'$(Configuration)'=='Release'">false</DisableEmbeddedXbf> 

to

<DisableEmbeddedXbf>false</DisableEmbeddedXbf> 

to allow building of .pri files in debug mode, which are needed for the NuGet package.

Testing

Validating UI and accessibility requirements

More information will be coming on this soon

Manual testing

Test app

The WinUI solution project has a test app that is useful for validating common
scenarios affected by the presence of the WinUI NuGet package. Set
MUXControlsTestApp as your startup project in Visual Studio and you can F5
to start debugging that app and validate your changes.

Organization

MUXControlsTestApp is a no frills test app built specifically for on demand developer
testing scenarios and to be UI automation friendly. As such it’s perhaps not as
friendly to navigate as something similarly control-centric like the
Xaml Controls Gallery.
That’s a great potential area for future improvement, although
MUXControlsTestApp must continue to function as an automation test target.

Standalone app targeting custom NuGet package

In the end developers will consume WinUI as a NuGet package in their own apps.
So it’s important to keep in mind that scenario when validating changes.

To enable automated NuGet package testing there is a separate solution at
testMUXControlsReleaseTestMUXControlsReleaseTest.sln, which contains
MUXControls.ReleaseTest, NugetPackageTestApp (C#) and NugetPackageTestAppCX
(C++).

Test classes for this are in MUXControls.ReleaseTest, and they share test
infrastructure with MUX so you can write tests in the same way as in MUX.
The only difference is you’ll have to specify the TestType in ClassInitialize
and TestCleanup (TestType.Nuget for NugetPackageTestApp and TestType.NugetCX
for NugetPackageTestAppCX).

public static void ClassInitialize(TestContext testContext)
{
    TestEnvironment.Initialize(testContext, TestType.Nuget);
}

public void TestCleanup()
{
    TestEnvironment.AssemblyCleanup(TestType.Nuget);
}

The test apps are using released versions of the WinUI NuGet package locally. In CI,
the test pipeline will generate a NuGet package for each build, and there’s a
separate pipeline configured to consume the generated package from the latest
build and run MUXControl.ReleaseTest.

Downlevel testing

One of the core features of WinUI is that it maintains down-level compatibility with earlier versions of Windows 10, handling version compatibility differences so
that developers using WinUI don’t have to. As such, testing your changes on
different Windows versions is sometimes necessary. Windows versions can be acquired using a Visual Studio subscription as described here, if required.

Automated testing

You can run the test suite from within Visual Studio by using the Test top
level menu. To target individual tests you can use the Test Explorer
(found under the Test->Windows sub menu).

This same suite of tests will be run as part of your Pull Request validation
check.

Creating a new test

For your test to be discovered it needs to be a method tagged as [TestMethod]
in a class tagged with as [TestClass].
With that metadata in place your new test method will be picked up by Test
Explorer.

There are two types of tests you can use to validate your scenarios:

  • API Tests: Run in the context of an app and validate the behaviors of our
    APIs.
  • Interaction Tests: Drive the UI on an external app and validate the
    results using UI Automation.

Keep in mind that your test will be run on many different versions of
Windows, not just the most recent version. Your tests may need version or
IsApiPresent
checks in order to pass on all versions.

Axe testing

Axe tests are part of the interaction tests. Axe.Windows is a library to run automated app scans and allows to detect accessibility issues.
To add a new test page to use for Axe scanning, you can use the AxeTestPageAttribute which will add the test page to the list of test pages for Axe scanning. That way, other tests are not affected by the new test page.

Running the Axe.Windows scan can be done using the AxeTestHelper.TestForAxeIssues method. If accessibility issues have been found, the method will throw an exception.

Visual tree verification tests

Update visual tree verification files

Visual tree dumps are stored here and we use them as the baseline for visual tree verifications. If you make UI changes, visual tree verification tests may fail since the new dump no longer matches with previous verification files. The verification files need to be updated to include your latest changes. A visual verification test automatically captures the new visual tree and uploads the dump to the test pipeline’s artifacts. Below are the steps to replace existing verification files with the updated ones.

  1. Find your test run

    test fail page1

    test fail page2

  2. Identify your buildId

    The Build Id for the azure dev ops build associated with your test run can be found in this page’s url.

    BuildId Location

  3. Diff & replace

    Open a powershell command prompt and navigate to the tools directory of your Winui 2 project. Call the GenerateVisualVerificationUpdates script passing in the BuildId number that you identified in step two.

    This script does the logic for determining the required verification file updates and publishes them to the VerificationFiles folder within the project. If preferred, they can be published to a different location by passing the desired location as a second optional argument.

    Now use your preferred file comparison tool (VisualStudio,…) to compare the updated files with their unchanged versions prior to your contribution and verify that the changes are as expected.

    Finally commit the updated viual verification files to your pull request.

Create new visual tree tests
  1. Write a new test

    Write a new test using VisualTreeTestHelper. Quick example here.

  2. Run the test locally

    Run the test locally and make sure everything looks right. The test will fail, which is expected since the test is new and there’s no verification file to compare against. A new verification file should be generated in your Pictures folder (The test app doesn’t have write access to other arbitrary folders ☹).

  3. Queue a test run in pipeline

    A local test run only gives you the visual tree dump for your host OS version. However, some controls have different visual behaviors depending on the Windows version used. To get verification files for all supported OS versions, you’ll need to start a test run in test pipeline.

    Go to the build page and select the WinUI-Public-MUX-PR pipeline. Click the Queue button on the top right corner, update the Branch/tag TextBlock to be your working branch and then click on Run.

    Outside contributors may not have permission to do this. In this case, just open a PR and one of our team members will queue a test run for you.

  4. Get the new verification files

    The new verification files will be uploaded to the test pipeline’s artifacts folder when the test finishes. Follow the steps outlined in the Update visual tree verification files section above to download and commit the new files.

Telemetry

This project collects usage data and sends it to Microsoft to help improve our
products and services. Note, however, that no data collection is performed
when using your private builds.

I use msbuild to compile a Visual Studio 2010 solution and need a successful build without any errors.

But each time I run msbuild, or rebuild, or clean and compile my solution directly using Visual Studio, I get several bscmake errors like this one. Sometimes the errors disappear when compiling again without cleaning, but it is not a good solution to me to run msbuild twice.

[...]
10>  Generating Code...
11>  xxxxxxxxmshtml.tlh(63588): warning BK4504: file contains too many references; ignoring further references from this source
11>  
11>BSCMAKE : error BK1500: Internal error
11>  
11>    Version 10.00.30319.01
11>  
11>    ExceptionCode            = C0000005
11>    ExceptionFlags           = 00000000
11>    ExceptionAddress         = 001343DA (00130000) "c:Program Files (x86)Microsoft Visual Studio 10.0VCbinbscmake.exe"
11>    NumberParameters         = 00000002
11>    ExceptionInformation[ 0] = 00000000
11>    ExceptionInformation[ 1] = 00000000
11>  
11>  CONTEXT:
11>    Eax    = 00141B30  Esp    = 003CF1C0
11>    Ebx    = 04B142C6  Ebp    = 003CF770
11>    Ecx    = 04BB621C  Esi    = 00000006
11>    Edx    = 00000000  Edi    = 00000001
11>    Eip    = 001343DA  EFlags = 00010293
11>    SegCs  = 00000023  SegDs  = 0000002B
11>    SegSs  = 0000002B  SegEs  = 0000002B
11>    SegFs  = 00000053  SegGs  = 0000002B
11>    Dr0    = 00000000  Dr3    = 00000000
11>    Dr1    = 00000000  Dr6    = 00000000
11>    Dr2    = 00000000  Dr7    = 00000000

[...]

The point is that I don’t need browse information for my release and I don’t want this error message to occur. It was possible to hide errors like these with Visual Studio 2008, but I think that the compiler parameter is no longer available.

How can I hide bscmake errors?

Can I deactivate bscmake (for release versions)?

  • Remove From My Forums
  • Question

  • Sometimes if I stop a build before it’s finished, I get errors like this in some C++ projects:

                BSCMAKE : warning BK4502: truncated .SBR file ‘.binDebugcsiTransactionParameters.sbr’ not in X:BuildAscentNightlyBuildBinariesWin32Debug/ParamContext.bsc
                BSCMAKE : error BK1513: nonincremental update requires all .SBR files

    I’m not doing clean builds and it looks like the only way to get rid of these errors is to delete all of the output files before starting the build again.

    I’m wondering if anyone has seen this and knows how to avoid it any way other than doing a clean build?

    Thanks,
    Richard

Answers

  • I’ve not heard of those errors, but I would guess that it’s likely a side effect of stopping a build, which terminates the build process immediately.  If you only hit the problem with particular files, then you could try deleting only those, but a clean build is your best bet.

    Buck

Я использую msbuild для компиляции Visual Studio 2010 решение и нужна успешная сборка без каких-либо ошибок.

Но каждый раз, когда я запускаю msbuild, или перестраиваю, или очищаю и компилирую свое решение напрямую с помощью Visual Studio, я получаю несколько ошибок bscmake, подобных этой. Иногда ошибки исчезают при повторной компиляции без очистки, но дважды запускать msbuild для меня не лучший вариант.

[...]
10>  Generating Code...
11>  xxxxxxxxmshtml.tlh(63588): warning BK4504: file contains too many references; ignoring further references from this source
11>  
11>BSCMAKE : error BK1500: Internal error
11>  
11>    Version 10.00.30319.01
11>  
11>    ExceptionCode            = C0000005
11>    ExceptionFlags           = 00000000
11>    ExceptionAddress         = 001343DA (00130000) "c:Program Files (x86)Microsoft Visual Studio 10.0VCbinbscmake.exe"
11>    NumberParameters         = 00000002
11>    ExceptionInformation[ 0] = 00000000
11>    ExceptionInformation[ 1] = 00000000
11>  
11>  CONTEXT:
11>    Eax    = 00141B30  Esp    = 003CF1C0
11>    Ebx    = 04B142C6  Ebp    = 003CF770
11>    Ecx    = 04BB621C  Esi    = 00000006
11>    Edx    = 00000000  Edi    = 00000001
11>    Eip    = 001343DA  EFlags = 00010293
11>    SegCs  = 00000023  SegDs  = 0000002B
11>    SegSs  = 0000002B  SegEs  = 0000002B
11>    SegFs  = 00000053  SegGs  = 0000002B
11>    Dr0    = 00000000  Dr3    = 00000000
11>    Dr1    = 00000000  Dr6    = 00000000
11>    Dr2    = 00000000  Dr7    = 00000000

[...]

Дело в том, что мне не нужна информация о просмотре для моего выпуска, и я не хочу, чтобы появилось это сообщение об ошибке. Подобные ошибки можно было скрыть с помощью Visual Studio 2008, но я думаю, что параметр компилятора больше не доступен.

Как скрыть ошибки bscmake?

Могу ли я деактивировать bscmake (для выпускных версий)?

Понравилась статья? Поделить с друзьями:
  • Brother mfc 8370dn ошибка 78
  • Bs5443 ошибка мерседес актрос
  • Brother hl2132 error
  • Bs5043 ошибка актрос
  • Brother hl 2132r моргает error