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
If you use MSTest.TestAdapter on a UWP project, the very long name of the Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices component can cause the resource generation step to fail because the Windows maximum path length is exceeded. The error message reported in this case does not make it at all obvious that path lengths are the problem.
I am using MSTest.TestAdapter 3.0.2 on Visual Studio 2022 17.4.5
Steps To Reproduce
In Visual Studio, create a UWP test runner project using MSTest.TestAdapter (or clone a repo that contains one) such that the fully-qualified name of the folder is longer than 80 characters. For example, the name of the project folder in which I encountered this problem was:
That folder path is 95 characters long. This is more than enough to trigger the problem.
Building the project causes this error:
1>C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.net.uwpcoreruntimesdk\2.2.14\tools\CoreRuntime\Microsoft.Net.CoreRuntime.targets(195,9): error : Framework resource extraction failed. Could not find a part of the path 'C:\Users\matth\source\repos\reactive\Rx.NET\Source\tests\Tests.System.Reactive.Uwp.DeviceRunner\obj\x86\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices\en\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources.Resource.resw'.
The path in the error message is 270 characters long, 10 over the traditional Windows maximum path length. As is common for modern Windows systems, this particular machine is configured to allow files longer than that old limit. But paths that long cause problems for code that does not know how to work with long filenames.
Expected behavior
Ideally, it should just be able to work with longer filenames.
Failing that, it should report that this is a path length issue.
Furthermore, it would be worth considering giving this component a much shorter name and/or making the name of the embedded resource shorter (does it really need to end with ".Resources.Resources"?) so that it is less likely to trigger this sort of problem. The current names of these components mean that this will add 175 characters to your project folder ("\obj\x86\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices\en\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources.Resource.resw") or more for Release builds (because "Release" is longer than "Debug")
Actual behavior
We get the error "Could not find a part of the path" which is not helpful when trying to diagnose the problem.
Additional context
Very long component names tend to cause path length problems, so it would be great it there was any way to make the names shorter.
The text was updated successfully, but these errors were encountered:
I will raise the point in our next chat with PMs because while technically it's easy to do, we have lots of customers still using the non-sdk project style and so having manual references to dll which would cause a massive break.
I am facing the same issue with WinUI 3.
I cannot run tests in CI with vstest.console.exe MyTestApp.build.appxrecipe because the path is longer than 260 characters.
Description
If you use
MSTest.TestAdapter
on a UWP project, the very long name of theMicrosoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices
component can cause the resource generation step to fail because the Windows maximum path length is exceeded. The error message reported in this case does not make it at all obvious that path lengths are the problem.I am using MSTest.TestAdapter 3.0.2 on Visual Studio 2022 17.4.5
Steps To Reproduce
In Visual Studio, create a UWP test runner project using
MSTest.TestAdapter
(or clone a repo that contains one) such that the fully-qualified name of the folder is longer than 80 characters. For example, the name of the project folder in which I encountered this problem was:C:\Users\matth\source\repos\reactive\Rx.NET\Source\tests\Tests.System.Reactive.Uwp.DeviceRunner
That folder path is 95 characters long. This is more than enough to trigger the problem.
Building the project causes this error:
The path in the error message is 270 characters long, 10 over the traditional Windows maximum path length. As is common for modern Windows systems, this particular machine is configured to allow files longer than that old limit. But paths that long cause problems for code that does not know how to work with long filenames.
Expected behavior
Ideally, it should just be able to work with longer filenames.
Failing that, it should report that this is a path length issue.
Furthermore, it would be worth considering giving this component a much shorter name and/or making the name of the embedded resource shorter (does it really need to end with ".Resources.Resources"?) so that it is less likely to trigger this sort of problem. The current names of these components mean that this will add 175 characters to your project folder ("\obj\x86\Debug\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices\en\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources.Resource.resw") or more for Release builds (because "Release" is longer than "Debug")
Actual behavior
We get the error "Could not find a part of the path" which is not helpful when trying to diagnose the problem.
Additional context
Very long component names tend to cause path length problems, so it would be great it there was any way to make the names shorter.
The text was updated successfully, but these errors were encountered: