NuGet MSTest.TestAdapter.3.0.0 crashes in .Net "Framework" 4.8 - mstest

Edited: as #Diego Malanij pointed out in answer
https://stackoverflow.com/a/74768591/4489263 it's the MSTest.TestAdapter 3.0.0 package causing the following observed misbehavior, whereas MSTest.TestFramework 3.0.0 works well
After updating NuGet packages in a .Net 4.8 solution, MS UnitTests just reproducibly stopped working here in Visual Studio 2022 "Community Edition" on Windows 10 without having changed anything in the custom solution itself.
The same update(s) work well in a .Net6.0 solution
UnitTests
Updates:
MSTest.TestFramework.2.2.10 -> MSTest.TestFramework.3.0.0
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.0
The Output window in the .Net4.8 solution shows exceptions, and the Test Explorer says:
UnitTests
Tests in group: 134
Outcomes
 134 Not Run
Output Window :
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
Log level is set to Informational (Default).
Source code repository not available. Some features may not work as expected.
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0,139 sec.
========== Starting test discovery ==========
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Data\bin\Debug\RingManager.Data.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager\bin\Debug\RingManager.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.CommonViews\bin\Debug\RingManager.CommonViews.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in D:\Dev.Net\ProdSW\RingManager\RingManager\RingManager.Common\bin\Debug\RingManager.Common.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
========== Test discovery finished: 134 Tests found in 3 sec ==========
========== Starting test run ==========
========== Test run finished: 134 Tests (134 Passed, 0 Failed, 0 Skipped) run in 16,7 sec ==========
Starting test discovery for requested test run
========== Starting test discovery ==========
========== Test discovery finished: 134 Tests found in 1,7 sec ==========
========== Starting test run ==========
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Stack trace:
at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestDeployment.GetDeploymentInformation(String source)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTestsInSource(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, String source, Boolean isDeploymentDone) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.ExecuteTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, Boolean isDeploymentDone)
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestExecutionManager.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle, TestRunCancellationToken runCancellationToken) at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithTests.InvokeExecutor(LazyExtension2 executor, Tuple2 executorUri, RunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>c__DisplayClass46_0.b__0()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInStaThread(Action action, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests)
========== Test run finished: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in 127 ms ==========
After reverting the changes via version control system - and restarting VS - all is back to normal.
So I guess I'll wait a little and then might try again with a next NuGet version, and this is more a warning than a question asking for help

I've found the same issue with my solution. Today I was able to dig a bit deeper with fusion log and the problem is that the assembly is being searched in the appbase for the testhost, rather than the location of the unit test output itself (meaning bin\debug or bin\release).
I've taken a look at the MSTest.TestAdapter package itself and its props... it has changed the structure regarding the previous version, and now it contains the Microsoft.VisualStudio.TestPlatform.TestFramework assembly (which is loaded from the packages\MSTest.TestAdapter.3.0.0\build\net462 location), but the extensions are no there.
I tried copying the missing dll in that location and tests execution succeeded, however that's clearly not a solution.
In my case this is with Visual Studio 2019, and I thought 2022 might have this solved but clearly after finding your post, that's not the case; I'll try to go a bit further with the analysis later, but as for now the only option is not updating the MSTest.TestAdapter package (the MSTest.TestFramwork is fine at 3.0.0).

MSTest.TestAdapter.3.0.1 now being available apparently cures the symptom, may have been a temporary bug in its version 3.0.0.
After installing NuGet
Updates:
MSTest.TestFramework.3.0.0 -> MSTest.TestFramework.3.0.1
MSTest.TestAdapter.2.2.10 -> MSTest.TestAdapter.3.0.1
... all seems to be okay again

Related

Microsoft Visual Studio Community 2022 (64-bit) 17.4.2 can't debug .Net Standard 2.0 Xamarin on Samsung Galaxy J5 2016 with Android 7.1.1

I made that question to the Microsoft community months ago, the solution I came up with was to install the previous version of Visual Studio, 17.2.6, that could work with that phone. Then I got a new testing phone and I could debug on it just fine with any later Visual Studio version. But that old problem resurfaced when I tried to debug on my old phone again lately.
So, when I try to debug on the Samsung J5 I get the message that deployment is successful but debugging and the app stop. The app gets installed on the phone just fine, I can run it and test things, and for those parts that I would have added breakpoints I add temporary log entries to see what is happening. But debugging would be so much faster and easier. So I don't know what happened to Visual Studio 2022 after version 17.2.6 and the debugging on the J5 stopped working without changing the Android project's settings.
On to the output. The last lines of the Build output:
Found device: dbb6c608
Creating "obj\Debug\130\upload.flag" because "AlwaysCreate" was specified.
Creating directory "obj\.cache\".
Done building project "iService5.Droid.csproj".
Build succeeded.
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
Last lines of Build Order output:
2>Starting deployment to Samsung SM-J510FN ...
2>Deploying to Samsung SM-J510FN ...
2>Deployment was successful to Samsung SM-J510FN.
========== Build: 1 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
========== Elapsed 02:07,822 ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
========== Elapsed 02:07,824 ==========
On Debug output:
This debug engine does not support exception conditions. The condition(s) will be ignored.
Forwarding debugger port 8815
Detecting existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.bshg.iservice5.droid/crc649586142a72936f38.MainActivity launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
The error I get in Xamarin Diagnostics window:
[E:]: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object[] args)
at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.<RunShellCommandAsync>b__0() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012
[D:RunShellCommand]: dbb6c608 setprop "debug.mono.extra" ""
-- Start SetProperty - 12/02/2022 13:15:16 (148.7124ms) --
[INPUT] setprop "debug.mono.extra" ""
[OUTPUT]
-- End SetProperty --
[D:RunShellCommand]: dbb6c608 am force-stop com.bshg.iservice5.droid
-- Start ForceStop - 12/02/2022 13:15:16 (1794.4007ms) --
[INPUT] am force-stop com.bshg.iservice5.droid
[OUTPUT]
-- End ForceStop --
I have searched and searched and I can't find anything usefull. As for the configuration:
Android Options
Advanced Android Options
Deleting bin and obj after testing different Android options made no difference. The same options debug on the new phone just fine. And I haven't changed the developers setting in the J5. They are the same ones that VS 17.2.6 could debug with.
I am currently installing 17.2.6 to exist in parallel with 17.4.2 on my pc to see if that will help. But any insights regarding the reason behind my problem would be greately appreciated!
Edit: Community is not available for versions before 17.2.10 anymore. So I'll try 17.2.10.
Edit 2: 17.2.10 debugs on my old phone just fine. Same settings, same everything. So, since our target android version is now 13 on the solution on latest vs, I also created a clone of the repo to work with on the old phone because older vs can have only up to android 12.1 as a target version.

Genexus17 could not reach web server

I am following Udemy tutorials with Genexus 17 trial version.
After I create my first transaction, and click F5 to Execute/Deploy to cloud, it displays the following error:
========== DeveloperMenu Compilation for Default (.NET Framework) started ==========
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" /nologo
/p:Configuration=Release
/p:FrameworkPath="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" /v:q
/m "C:\Models\TravelAgency3\CSharpModel\build\LastBuild.sln" Success:
DeveloperMenu Compilation for Default (.NET Framework)
========== Web config update started ========== Updating web config ... Success: Web config update Building file gx_last_transfer.zip...
Uploading 7 Kbytes Deploying website
========== Execution started ========== ... waiting for server ... error: Could not reach web server or something went wrong running your
application at
https://trialapps3.genexus.com/Idf34a868f535909f93e51fbc52ebdb90f/developermenu.html
please try again. Status code: 404 NotFound.. If the problem
persists, follow the steps described in
https://wiki.genexus.com/commwiki/wiki?49557 Failed: Execution Failed:
Run Developer Menu
File developermenu.html is not deployed to cloud when "Short File Name" is not enabled in your Windows installation.
Anyway, the application seems to be well deployed.
There are three solutions:
What this html has is a link to each object of the KB, so what you can do is to include the name of the object to be executed in the URL.
Example: https://trialapps3.genexus.com/Idf34a868f535909f93e51fbc52ebdb90f/customer.aspx
Another possibility is to create a Webpanel main (https://wiki.genexus.com/commwiki/servlet/wiki?7407,Main%20program%20property) that calls the rest of the objects (eg using a button or a link) and execute that main.
Perhaps the easiest is to edit Packages\rundotnet.config file including this line:
*.html

"The process cannot access the file 'Default.rd.xml' because it is being used by another process." on AppVeyor CI

I am doing some work on cordova-windows (https://github.com/apache/cordova-windows), which is using AppVeyor for testing on Windows. One of the things that was missing, were tests with Visual Studio 2017 (only VS2015 was used to test before). So I added those and it works like a charm - mostly.
Unfortunately we now have a very strange test failure:
https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-windows/build/1.0.458
Started
Creating Cordova Windows Project:
Path: testcreate 応用
Namespace: com.test.app
Name: 応用
Windows project created with cordova-windows#5.1.0-dev
Building project: C:\projects\cordova-windows\testcreate 応用\CordovaApp.Windows10.jsproj
Configuration : release
Platform : x64
Patching 10 in prebuild event...
Injected base.js reference to the www/index.html
Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from www/index.html
Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from www/index.html
CordovaApp.Windows10 -> C:\projects\cordova-windows\testcreate ??\build\windows\release\x64\win10\CordovaApp.Windows10_1.0.0.0_x64.appx
CordovaApp.Windows10 -> C:\projects\cordova-windows\testcreate ??\build\windows\release\x64\win10\Upload\CordovaApp.Windows10_1.0.0.0_x64.appx
CordovaApp.Windows10 -> C:\projects\cordova-windows\testcreate ??\AppPackages\CordovaApp.Windows10_1.0.0.0_Test\CordovaApp.Windows10_1.0.0.0_x64.appxbundle
CordovaApp.Windows10 -> C:\projects\cordova-windows\testcreate ??\AppPackages\CordovaApp.Windows10_1.0.0.0\CordovaApp.Windows10_1.0.0.0_x64.appxbundle
CordovaApp.Windows10 -> C:\projects\cordova-windows\testcreate ??\AppPackages\CordovaApp.Windows10_1.0.0.0_x64_bundle.appxupload
Your package has been successfully created.
Building project: C:\projects\cordova-windows\testcreate 応用\CordovaApp.Windows10.jsproj
Configuration : release
Platform : x86
Patching 10 in prebuild event...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2975,5): error MSB3231: Unable to remove directory "build\windows\bld\PackageUploadLayout\". The process cannot access the file 'Default.rd.xml' because it is being used by another process. [C:\projects\cordova-windows\testcreate ??\CordovaApp.Windows10.jsproj]
C:\projects\cordova-windows\testcreate 応用\cordova\node_modules\q\q.js:155
throw e;
^
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
at ChildProcess.whenDone (C:\projects\cordova-windows\testcreate 応用\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:920:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
The relevant part is this:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\AppxPackage\Microsoft.AppXPackage.Targets(2975,5): error MSB3231: Unable to remove directory "build\windows\bld\PackageUploadLayout\". The process cannot access the file 'Default.rd.xml' because it is being used by another process. [C:\projects\cordova-windows\testcreate ??\CordovaApp.Windows10.jsproj]
This is not happening when I run the tests locally, meaning I can in no way reproduce what is going on here.
Any idea what process could block this Default.rd.xml file or build\windows\bld\PackageUploadLayout\?
How can I find out in a CI environment like AppVeyor?
Update:
Investigated a bit more by adding /clp:Verbosity=normal to the msbuild calls that are executed.
It runs a similar msbuild call 3 times (once per architecture). The first one succeeds, but during the second one the failure occurs. Makes sense as in the first iteration the folder doesn't exist yet, which it confirms with this output: Directory "build\windows\bld\PackageUploadLayout\" doesn't exist. Skipping..
The last output before the failure then is Removing directory "build\windows\bld\PackageUploadLayout\". which matches what we get in the error message. No indicator why the removing doesn't work though.
Super strange: With /clp:Verbosity=detailed added to the msbuild call, the build actually succeeds! My guess: Because the output takes time, whatever is having a lock on the folder or file releases it.
This is not exactly an answer, but rather investigation report. It is just not enough room comments to describe it. Here is what I did:
forked your repo
created AppVeyor project
added RDP
connected with RDP
installed procmon
added filter to monitor objects which path ends with bld\PackageUploadLayout\Properties\Default.rd.xml
run npm test manually from CMD
When the same error happened I see this:
I am not sure I understand why msbuild failed this way. I opened SHARING VIOLATION event, switched to process and see this:
What catches my eye is that msbuild version is 14. Should be 15 on Visual Studio 2017 image. We have version 14 installed for specific scenarios but default one is 15 (run where msbuild and you will see C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe). I am not sure where this path is set in your scripts, but I feel if you make it run correct msbuild version this may help.

Xamarin/Visual studio: Deployment failed. How to troubleshoot

Im quite new to Xamarin and android development. I have made a new virtual device but when Im trying to run debug (by hitting "play" in Visual Studio) I get the message "Deployment failed", but I cant find any error message or logs.
Any tips on how to find that or troubleshoot for failing deployments?
(I can deploy when using a simple program and the pre-installed kit kat 4.4)
EDIT:
From output window:
Starting deploy 0001 ...
Starting emulator 0001 ...
An error occured. See full exception on logs for more details.
An error occured. See full exception on logs for more details.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Visual Studio deploy fails with "The method or operation is not implemented"

I'm trying to remotely debug a Windows 8.1 app on an x86 tablet.
The Remote Debugger is started on the Tablet, but every time I try to deploy the app to the Tablet, the Visual Studio output window shows this:
1>------ Build started: Project: $REDACTED, Configuration: Debug x86 ------
1> $REDACTED-> C:\Users\$REDACTED\bin\x86\Debug\$REDACTED.exe
2>------ Deploy started: Project: $REDACTED, Configuration: Debug x86 ------
2>Error: The method or operation is not implemented.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Also, the Remote Debugger on the tablet prints Failed attempt to connect from $REDACTED
Changing remote machine (VS 2015 Remote Debugger settings) from No Authentication to Windows Authentication fixed the problem for me.

Resources