You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add additional build issues to LUT FAQ
Add information about source generators
Add information about MSBuild nodes
* Apply suggestions from code review
Fixing a few issues to try to get Acrolinx score above 80
* Update docs/test/live-unit-testing-faq.yml
* Fix contractions in live-unit-testing-faq.yml
* Update contractions in live-unit-testing-faq.yml
---------
Co-authored-by: Mike Jones <[email protected]>
Copy file name to clipboardExpand all lines: docs/test/live-unit-testing-faq.yml
+26-9Lines changed: 26 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -48,26 +48,26 @@ sections:
48
48
49
49
- If NuGet packages referenced by the projects in the solution haven't been restored, Live Unit Testing won't work. Performing an explicit build of the solution or restoring NuGet packages in the solution before turning on Live Unit Testing should resolve this issue.
50
50
51
-
- If you are using MSTest-based tests in your projects, make sure that you remove the reference to `Microsoft.VisualStudio.QualityTools.UnitTestFramework`, and add references to the latest MSTest NuGet packages, `MSTest.TestAdapter` (a minimum version of 1.1.11 is required) and `MSTest.TestFramework` (a minimum version of 1.1.11 is required). For more information, see the "Supported test frameworks" section of the [Use Live Unit Testing in Visual Studio](live-unit-testing.md#supported-test-frameworks) article.
51
+
- If you're using MSTest-based tests in your projects, make sure that you remove the reference to `Microsoft.VisualStudio.QualityTools.UnitTestFramework`, and add references to the latest MSTest NuGet packages, `MSTest.TestAdapter` (a minimum version of 1.1.11 is required) and `MSTest.TestFramework` (a minimum version of 1.1.11 is required). For more information, see the "Supported test frameworks" section of the [Use Live Unit Testing in Visual Studio](live-unit-testing.md#supported-test-frameworks) article.
52
52
53
53
- At least one project in your solution should have either a NuGet reference or direct reference to the xUnit, NUnit, or MSTest test framework. This project should also reference a corresponding Visual Studio test adapters NuGet package.
54
54
55
55
- question: |
56
56
Why is my project not building?
57
57
answer: |
58
-
The build errors get reported to the Output window when the Live Unit Testing drop-down is selected. There are a few common issues caused by incorrect configuration in the [setup wizard](../test/live-unit-testing.md#configure) that can cause build issues in Live Unit Testing.
58
+
The build errors get reported to the Output window when the Live Unit Testing drop-down is selected. There are a few common issues caused by incorrect configuration in the [setup wizard](../test/live-unit-testing.md#configure) that can cause build issues in Live Unit Testing.
59
59
60
60
- If the [Workspace Root](../test/live-unit-testing.md#workspace-root) property is too long, it’s possible that the build will fail due to exceptions indicating that the path is too long.
61
61
62
62
- If the [Repository Root](../test/live-unit-testing.md#repository-root) property doesn't point towards the repository root, the workspace will be populated with the wrong set of files.
63
63
64
-
- For git repositories, the [Exclude files](../test/live-unit-testing.md#specify-the-excluded-files) property usually avoids copying the files specified in the *gitignore* file. However, it’s possible to check in files to the git repository that are ignored, or it’s possible to run tools that auto generate files, but these are not generated during the build. In these cases, the "<Custom>" option should be chosen and a custom set of rules that only list the artifacts folders should be listed.
64
+
- For git repositories, the [Exclude files](../test/live-unit-testing.md#specify-the-excluded-files) property usually avoids copying the files specified in the *gitignore* file. However, it’s possible to check in files to the git repository that are ignored, or it’s possible to run tools that auto generate files, but these aren't generated during the build. In these cases, the "<Custom>" option should be chosen and a custom set of rules that only list the artifacts folders should be listed.
65
65
66
66
Besides the issues described previously, the following project configurations that might not build correctly.
67
67
68
68
- If project dependencies are specified as a global solution configuration and not as `ProjectReferences` for each project, Live Unit Testing might end up building the incorrect set of projects. To fix this, add explicit references between projects.
69
69
70
-
- Until a [Live Unit Testing playlist](../test/live-unit-testing.md#specify-the-excluded-files) is chosen, Live Unit Testing will not build any projects. To fix this, include some tests in the Live Unit Testing playlist.
70
+
- Until a [Live Unit Testing playlist](../test/live-unit-testing.md#specify-the-excluded-files) is chosen, Live Unit Testing won't build any projects. To fix this, include some tests in the Live Unit Testing playlist.
71
71
72
72
- If you're using MSTest-based tests in your projects, make sure that you remove the reference to `Microsoft.VisualStudio.QualityTools.UnitTestFramework`, and add references to the latest MSTest NuGet packages, `MSTest.TestAdapter` (a minimum version of 1.1.11 is required) and `MSTest.TestFramework` (a minimum version of 1.1.11 is required). For more information, see [Supported test frameworks](../test/live-unit-testing.md#supported-test-frameworks).
73
73
@@ -81,6 +81,23 @@ sections:
81
81
</RunSettings>
82
82
```
83
83
84
+
- question: |
85
+
Does Live Unit Testing support source generator projects?
86
+
answer: |
87
+
Live Unit Testing can't build the source generator projects with instrumentation.
88
+
Due to how the C# compiler sets up assembly loading for source generators, the attempt to build source generator projects with instrumentation fails to load Live Unit Testing assemblies.
89
+
90
+
You can set `<ExcludeFromCodeCoverage>true</ExcludeFromCodeCoverage>` property in the source generator
91
+
csproj files, to make these projects build in Live Unit Testing.
92
+
93
+
- question: |
94
+
How to resolve error "Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces'"?
95
+
96
+
answer: |
97
+
Live Unit Testing runs the build inside of its own process for performance reasons.
98
+
If this separate build process is causing an error, you can set `<UseInProcMSBuildNode>false</UseInProcMSBuildNode>` to the *.lutconfig* file to ensure
99
+
that all of the build happens in the MSBuild process.
100
+
84
101
- question: |
85
102
Why are my tests failing to run?
86
103
answer: |
@@ -108,7 +125,7 @@ sections:
108
125
answer: |
109
126
If your solution requires custom steps to build for instrumentation (Live Unit Testing) that aren't required for the "regular" non-instrumented build, then you can add code to your project or *.targets* files that checks for the `BuildingForLiveUnitTesting` property and performs custom pre/post build steps. You can also choose to remove certain build steps (like publishing or generating packages) or to add build steps (like copying prerequisites) to a Live Unit Testing build based on this project property. Customizing your build based on this property doesn't alter your regular build in any way, and only impacts Live Unit Testing builds.
110
127
111
-
For example, there may be a target that produces NuGet packages during a regular build. You probably do not want NuGet packages to be generated after every edit you make. So you can disable that target in the Live Unit Testing build by doing something like the following:
128
+
For example, there may be a target that produces NuGet packages during a regular build. You probably don't want NuGet packages to be generated after every edit you make. So you can disable that target in the Live Unit Testing build by doing something like the following:
Why does Live Unit testing keep building my solution all the time even if I am not making any edits?
184
+
Why does Live Unit testing keep building my solution all the time even if I'm not making any edits?
168
185
answer: |
169
186
Your solution can build even if you're not making edits if the build process generates source code that's part of the solution itself, and your build target files don't have appropriate inputs and outputs specified. Targets should be given a list of inputs and outputs so that MSBuild can perform the appropriate up-to-date checks and determine whether a new build is required.
170
187
@@ -173,7 +190,7 @@ sections:
173
190
- name: Editor icons
174
191
questions:
175
192
- question: |
176
-
Why do I not see any icons in the editor even though Live Unit Testing seems to be running the tests based on the messages in the Output window?
193
+
Why don't I see any icons in the editor even though Live Unit Testing seems to be running the tests based on the messages in the Output window?
177
194
answer: |
178
195
You might not see icons in the editor if the assemblies that Live Unit Testing is operating on aren't instrumented for any reason. For example, Live Unit Testing isn't compatible with projects that set `<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable>`. In this case, your build process needs to be updated to either remove this setting or to change it to `true` for Live Unit Testing to work.
179
196
@@ -197,7 +214,7 @@ sections:
197
214
- question: |
198
215
Can I edit the files under the workspace folder?
199
216
answer: |
200
-
No, you should not open or edit the files under the build and test directories of the workspace folder.
217
+
No, you shouldn't open or edit the files under the build and test directories of the workspace folder.
201
218
Live Unit Testing should manage all of the files in the *src* folder, to keep them in sync between
202
219
the [Repository Root](../test/live-unit-testing.md#repository-root) and [Workspace Root](../test/live-unit-testing.md#workspace-root).
203
220
@@ -206,7 +223,7 @@ sections:
206
223
- question: |
207
224
Does live unit testing support Dev Drive for the default workspace root?
208
225
answer: |
209
-
Yes, but you need to make sure it's enabled. If you are using a Dev Drive, make sure that the [projected file system (ProjFS)](/windows/dev-drive/#filters-for-common-scenarios) filter is enabled. For example, the following command enables ProjFS and Windows Defender:
226
+
Yes, but you need to make sure it's enabled. If you're using a Dev Drive, make sure that the [projected file system (ProjFS)](/windows/dev-drive/#filters-for-common-scenarios) filter is enabled. For example, the following command enables ProjFS and Windows Defender:
0 commit comments