Running tests with tcm.exe results in Field not found: 'Microsoft.TeamFoundation.TestManagement.Common.WitCategoryRefName.SharedDataSet' - powershell

I'm trying to run an automated test case in Microsoft Test Manager from the command line with the following command:
TCM.exe run /create /title:"Nightly Run" /planid:5554 /suiteid:6582 /configid:97 /collection:XXX /teamproject:XXX /include /builddir:'C:\Source\'
This results in the following error:
.\TCM.exe : Field not found: 'Microsoft.TeamFoundation.TestManagement.Common.WitCategoryRefName.SharedDataSet'.
At C:\Users\XXXX\Desktop\RunTest.ps1:2 char:1
+ .\TCM.exe run /create /title:"Nightly Run" /planid:5554 /suiteid:6582 /configid: ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Field not found...SharedDataSet'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
However, this error happens on a Windows Server 2012R2 machine with Visual Studio 2013.4 installed but not on my local dev machine (Windows 10 with VS2013.4).
I know that SharedDataSets are introduced in VS2013.4 but I don't know where this error is coming from since the command doesn't give this error on my local pc.

I've found the solution. Running the following commands on the Windows Server fixed the error:
ngen uninstall Microsoft.TeamFoundation.TestManagement.Client
ngen uninstall Microsoft.TeamFoundation.TestManagement.Common

Related

vscode SSH connect failed using SSH-remote extension but success by terminal

I'm trying to setup a ssh server using my win10 PC. After following steps to setup the server, it is now can be connected via terminal from by laptop(win11).
However, if I use vscode extension Remote - SSH with connecting config :
Host 192.168.0.183
HostName 192.168.0.183
User User
Port 22
I always encounter Could not establish connection :
[23:49:42.494] Got password response
[23:49:42.494] "install" wrote data to terminal: "**********"
[23:49:42.521] >
[23:49:42.815] > powershell : �L�k���� 'powershell' ���J�O�_�� Cmdlet�B��ơB���O�ɩΥi����{�����W�١C���ˬd�W�٫��r�O�_���T�A�p�G�]�t
[23:49:42.826] > ��|���ܡA�нT�{��|�O�_���T�A�M��A�դ#���C
��� �u��:1 �r��:1
+ powershell
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (powershell:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
[23:49:44.124] "install" terminal command done
[23:49:44.125] Install terminal quit with output:
[23:49:44.126] Received install output:
[23:49:44.129] Resolver error: Error:
at g.Create (c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:583926)
at c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:581767
at t.handleInstallOutput (c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:582462)
at t.tryInstall (c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:680469)
at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
at async c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:642848
at async t.withShowDetailsEvent (c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:646166)
at async t.resolve (c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:643898)
at async c:\Users\lspss\.vscode\extensions\ms-vscode-remote.remote-ssh-0.94.0\out\extension.js:1:723024
[23:49:44.138] -----
Then I tried to use the laptop setting up as server and PC otherwise. It connect successfully with following output log :
[23:56:27.929] Got password response
[23:56:27.929] "install" wrote data to terminal: "************"
[23:56:27.951] >
[23:56:28.645] > Windows PowerShell
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> Install the latest PowerShell for new features and improvements! https://aka.ms/
> PSWindowsPS C:\Users\lspss>
> PS C:\Users\lspss> $uuid="d68ebbafd913"
> PS C:\Users\lspss> "${uuid}: running"
> d68ebbafd913: running
> PS C:\Users\lspss> "d68ebbafd913: pauseLog"
> d68ebbafd913: pauseLog
In comparison, the failed one have some random code I do not understand follow the powershell, while the other success after Windows Powershell.
I have tried to reinstall the ssh-server on my PC, and also tried using other laptop as client, which all failed.

VSCode remote-ssh cant connect to win server 2019

I'm using VSCode remote-ssh extension for development on winserv2016 and it works as intended. We recently switched to winserv2019 and the extension does not work. the error I get in output is
Server failed to start. - Program 'icacls.exe' failed to run: Win32 internal err
> or "Access is denied" 0x5 occurred while reading the console output buffer. Cont
> act Microsoft Customer Support Services.At line:4 char:1
> + icacls $ai_ /reset /Q
I have and admin rights on this machine, does anyone encounter this issue? I've also tried nightly build of VScode and nightly extension. No Success so far.

Docker for windows failing to start

I've just upgraded to the Windows 10 Pro creators update | 1703 | OS Build: 15063.138.
When docker tries to start I get the following error:
Unable to create: You cannot call a method on a null-valued expression.
at <ScriptBlock>, <No file>: line 137
at Get-NetAdapter<End>, <No file>: line 181
at New-Switch, <No file>: line 137
at <ScriptBlock>, <No file>: line 381
at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)
at Docker.Backend.ContainerEngine.Linux.Start(Settings settings)
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.<Register>b__0(Object[] parameters)
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)
Now I've tried all the usual troubleshooting methods to try to fix it but have had no luck i.e. uninstall docker reninstall, turn off hyper-V then turn it back on again.
I've even tried running the following commands using Powershell in C:\Program Files\Docker\Docker\resources
.\MobyLinux.ps1 -Destroy
.\MobyLinux.ps1 -Create
The create task throws the following error:
? : You cannot call a method on a null-valued expression.
At C:\Program Files\Docker\Docker\resources\MobyLinux.ps1:137 char:37
+ ... Get-NetAdapter | ? { $_.Name.StartsWith("vEthernet ($SwitchName)") }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Where-Object], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull,Microsoft.PowerShell.Commands.WhereObjectCommand
Any ideas how to fix this?
For anyone experiencing the same what i did to fix it was.
Uninstall Docker and Remove Hyper-V from the control panel. Go into
device manager -> network adapters.
Right click and uninstall any that are not your actual physical network card
Reboot and Turn Hyper-V back on and reinstall Docker (Or just install Docker as it turns on Hyper-V for you).

Jenkins Build successful even after PS script failed to execute

I am executing Jenkins Job which Builds my .csproj file and execute few PS scripts.
Issue is I get a successful email even if my PS script fails,How should I tell my Jenkins Job to trigger me an email also if PS script is failing.
Error Logs-
Copy-Item : The process cannot access the file
'\\10.0.1.190\d$\Build\RPC\abcde.RPC.AirSearch\Common.Logging.Core.dll' because it is being used by another process.
At C:\Users\Administrator\AppData\Local\Temp\hudson9059014122834846757.ps1:3 char:1
+ Copy-Item "C:\AirSearchBnd\src\abcde.Air.Search.RPC.Host\bin\Release\*" "\\$en ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand
[AirSearchBnd] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Users\ADMINI~1\AppData\Local\Temp\hudson9149103993066004448.ps1'"
[SC] CreateService SUCCESS
SERVICE_NAME: AirSearchWindowsService
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 13784
FLAGS :
> C:\Program Files (x86)\Git\bin\git.exe tag -l RPCBUILD_6 # timeout=10
> C:\Program Files (x86)\Git\bin\git.exe tag -a -f -m Jenkins Git plugin tagging with RPCBUILD_6 RPCBUILD_6 # timeout=10
Pushing tag RPCBUILD_6 to repo Dev
> C:\Program Files (x86)\Git\bin\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
> C:\Program Files (x86)\Git\bin\git.exe push https://github.com/abcdeHoldings/abcde.Services.Air.Search.git RPCBUILD_6
Email was triggered for: Always
Sending email for trigger: Always
Request made to compress build log
Sending email to: abcde#software.com abcde#software.com abcde#software.com abcde#software.com
Finished: SUCCESS
The easiest way is to configure Jenkins to send e-mails on failed builds and in the Powershell step add the following at the end:
if ($error) { exit 1 }
The problem with Jenkins Powershell plugin is that it doesn't honor the errors that happen in Powershell, only the exit code of the shell itself, this will force build to fail and trigger the email.
There is an option of "Attaching Build Log". You can read the build log to see, if the ps script has failed.

Chain psexec and nunit is not working (psexec exit with code 1 and nunit is crashed)

Sorry for unclear subject but i really don't understand where problem.
I use a system for autotests c#+webdriver for chrome + nunit (2.6) + cc.net ( 1.6.7981.1)
And my tests is run on remote machine (Windows XP SP 2 x86)via psexec which start bat file on remote machine
bat file includes 2 commands:
run msbuild
run nunit-console
Well, psexec has next arguments
/accepteula \MachineName -u Login -p Pass -s Path\start.bat
Bat file has next command
nunit-console-x86.exe "%PROJECT_FOLDER%\Path\Tests.dll" "/xml=%TEST_RESULT_PATH%"
When cc.net launch psexec tests is started and the tests work during some time. Unexpected, psexec exit with code 1
message level="Error">Path\start.bat exited on MachineName with error code 1. message
But nunit-console on remote machine is continue working
And after some time console is crashed with error
szAppName : nunit-console-x86.exe szAppVer : 2.6.0.12051
szModName : kernel32.dll szModVer : 5.1.2600.2180 offset :
0001eb33
Message from Event log
Application: nunit-console-x86.exe Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.IOException Stack: at
System.IO._Error.WinIOError(Int32, System.String) at
System.IO._ConsoleStream.Write(Byte[], Int32, Int32) at
System.IO.StreamWriter.Flush(Boolean, Boolean) at
System.IO.StreamWriter.Write(Char[], Int32, Int32) at
System.IO.TextWriter.WriteLine(System.String) at
System.IO.TextWriter.WriteLine(System.String, System.Object) at
System.IO.TextWriter+SyncTextWriter.WriteLine(System.String,
System.Object) at System.Console.WriteLine(System.String,
System.Object) at NUnit.ConsoleRunner.Runner.Main(System.String[])
at NUnit.ConsoleRunner.Class1.Main(System.String[])
If run nunit locally than no problem(nunit-console works fun).
Some time ago system worked, and i don't know what is changed (This is most bad case)
How can i resolve this problem?
Thanks!
This problem is resolved!
Now system is working