I have some problems trying to use nunit within a jenkins job. Even though the documentation for nunit-2.6 [1] states, that you can specify the build configuration to be used for the tests, this doesn't seem to work. I try to run the tests with the "Release" configuration, but nunit tries to load the Debug assembly and fails :( I start nunit with the following call:
nunit-console-x86.exe ambiHomeWPFTest\Tests\Tests.csproj /config:Release
Anyone has an idea, what is going on there? I'm quite new to .NET coming from a java background so maybe I miss something simple.
[1] http://www.nunit.org/index.php?p=consoleCommandLine&r=2.6
[test_ambiHomeWPFTest_master] $ cmd /c call C:\Windows\TEMP\hudson8704126216198591607.bat
c:\jenkins\workspace\test_ambiHomeWPFTest_master>nunit-console-x86.exe ambiHomeWPFTest\Tests\Tests.csproj /config:Release
NUnit-Console version 2.6.0.12051
Copyright (C) 2002-20011 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 2.0.50727.5456 ( Net 3.5 )
ProcessModel: Default DomainUsage: Default
Execution Runtime: net-3.5
Unhandled Exception:
System.IO.DirectoryNotFoundException: Ein Teil des Pfades "c:\jenkins\workspace\test_ambiHomeWPFTest_master\ambiHomeWPFTest\Tests\bin\Debug\Tests.dll " konnte nicht gefunden werden.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
bei NUnit.Core.AssemblyReader.CalcHeaderOffsets()
bei NUnit.Core.AssemblyReader..ctor(String assemblyPath)
bei NUnit.Util.RuntimeFrameworkSelector.SelectRuntimeFramework(TestPackage package)
bei NUnit.Util.DefaultTestRunnerFactory.GetTargetProcessModel(TestPackage package)
bei NUnit.Util.DefaultTestRunnerFactory.MakeTestRunner(TestPackage package)
bei NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
bei NUnit.ConsoleRunner.Runner.Main(String[] args)
c:\jenkins\workspace\test_ambiHomeWPFTest_master>exit -100
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
If you encounter problems with the /config: switch when referencing a .csproj in for example a nunit-console-x86 command, my recommendation is that you explicitly reference the DLL of interest instead.
In the scenario above, the call should thus be:
nunit-console-x86 ambiHomeWPFTest\Tests\bin\Release\Tests.dll
Related
Describe the bug
I am using VS Code, WSL and .net core 3.0 preview to build one sample web API project in WSL that is stored in C drive. But It throws an exception with a strange error
"/mnt/c/temp/test/test.csproj" (default target) (1:7) ->
(_CreateAppHost target) ->
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: The "CreateAppHost" task failed unexpectedly. [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: System.IO.IOException: Invalid argument [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at System.IO.MemoryMappedFiles.MemoryMappedView.CreateView(SafeMemoryMappedFileHandle memMappedFileHandle, MemoryMappedFileAccess access, Int64 requestedOffset, Int64 requestedSize) [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateViewAccessor(Int64 offset, Int64 size, MemoryMappedFileAccess access) [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.NET.HostModel.AppHost.HostWriter.<>c__DisplayClass2_0.<CreateAppHost>g__RewriteAppHost|0() [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.NET.HostModel.RetryUtil.RetryOnIOError(Action func) [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost(String appHostSourceFilePath, String appHostDestinationFilePath, String appBinaryFilePath, Boolean windowsGraphicalUserInterface, String assemblyToCopyResorcesFrom) [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore() in /_/src/Tasks/Microsoft.NET.Build.Tasks/CreateAppHost.cs:line 68 [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() in /_/src/Tasks/Common/TaskBase.cs:line 38 [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/mnt/c/temp/test/test.csproj]
/usr/share/dotnet/sdk/3.0.100-preview9-014004/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(370,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/mnt/c/temp/test/test.csproj]
To Reproduce
Steps to reproduce the behavior:
1. Using this version of ASP.NET Core '3.0.100-preview9' both on Window 10 and WSL
2. In Window 10
+ cd c:\temp
+ dotnet new webapi
3. Go to WSL, (/mnt/c/temp)
3. Run dotnet build
4. See error
Expected behavior
Run "dotnet build" successfully and can run/debug application in WSL from VSCode
Setting up dotnet on a fresh installation of Ubuntu (20.04) under WSL 2 on Windows 10 I had the above The "CreateAppHost" task failed unexpectedly. error along with a bunch file-system related permission errors when running dotnet build - however sudo dotnet build worked just fine...
My solution was to close/restart all running WSL instances, from a windows command prompt list all running instances;
C:\> wsl -l --running
Windows Subsystem for Linux Distributions:
docker-desktop-data (Default)
Ubuntu
docker-desktop
Then close the running one you wish to use for dotnet;
C:\> wsl --terminate Ubuntu
And then re-run/re-start the distro;
C:\> wsl -d Ubuntu
And then by magic dotnet build worked without the addition of sudo and also worked via vscode WSL remote plugin... hopefully this simple 'reboot solution' helps someone else!
I'm using Azure DevOps (visualstudio.com) and trying to get a Linux Build Agent up and running on a local server. This was working previously, but I upgraded the Linux server from Ubuntu 16.04 to 18.04. That broke my previous build agent.
So I removed the previous build agent and installed an up to date one. The new one registered easily, but when I try and run a build, it fails to check out sources.
Anybody know what might cause this problem, or where I can go for help? I don't manage our Azure DevOps. I'm just trying to get the Linux part working as it was.
Edit: I should note that running ./externals/tee/tf produces zero output (and returns with the same 100 code). Maybe it has something to do with java. I'm running Java(TM) SE Runtime Environment (build 12.0.2+10).
##[debug]Evaluating condition for step: 'Checkout'
##[debug]Evaluating: SucceededNode()
##[debug]Evaluating SucceededNode:
##[debug]=> True
##[debug]Result: True
##[section]Starting: Checkout
==============================================================================
Task : Get sources
Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version : 1.0.0
Author : Microsoft
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
##[debug]Processed: ##vso[plugininternal.updaterepositorypath alias=__designer_repo;]/home/***/myagent/_work/1/s
##[debug]Repository requires to be placed at '/home/***/myagent/_work/1/s', current location is '/home/***/myagent/_work/1/s'
Prepending PATH environment variable with directory containing 'tf'.
##[debug]Processed: ##vso[task.prependpath]/home/***/myagent/externals/tee
##[debug]PATH: '/home/***/myagent/externals/tee:/home/***/bin:/home/***/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
Querying workspace information.
##[debug]tf workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt
##[debug]Starting process:
##[debug] File name: 'tf'
##[debug] Arguments: 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'
##[debug] Working directory: '/home/***/myagent/_work/1/s'
##[debug] Require exit code zero: 'True'
##[debug] Encoding web name: ; code page: ''
##[debug] Force kill process on cancellation: 'False'
##[debug] Redirected STDIN: 'False'
##[debug] Persist current code page: 'False'
##[debug] Keep redirected STDIN open: 'False'
##[debug] High priority process: 'False'
##[debug]Updated oom_score_adj to 500 for PID: 1921.
##[debug]Process started with process id 1921, waiting for process exit.
##[debug]STDOUT/STDERR stream read finished.
##[debug]STDOUT/STDERR stream read finished.
##[debug]Finished process 1921 with exit code 100, and elapsed time 00:00:03.3458546.
##[error]Exit code 100 returned from process: file name 'tf', arguments 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'.
##[debug]Processed: ##vso[task.logissue type=error;]Exit code 100 returned from process: file name 'tf', arguments 'workspaces -format:xml "-collection:https://mydomain.visualstudio.com/" -jwt:*** -noprompt'.
##[debug]Processed: ##vso[task.complete result=Failed;]
##[debug] at Agent.Plugins.Repository.TeeCliManager.WorkspacesAsync(Boolean matchWorkspaceNameOnAnyComputer)
at Agent.Plugins.Repository.TfsVCSourceProvider.GetSourceAsync(AgentTaskPluginExecutionContext executionContext, RepositoryResource repository, CancellationToken cancellationToken)
at Agent.Plugins.Repository.CheckoutTask.RunAsync(AgentTaskPluginExecutionContext executionContext, CancellationToken token)
at Agent.PluginHost.Program.Main(String[] args)
##[section]Finishing: Checkout
When I saw that the tf command produced no output, I was pretty sure it had to be a java problem. I had tried many different versions of java and none of them worked. But with Oracle java 1.8.0_221 it finally worked.
I downloaded the .tar.gz file, extracted it, and overwrote the /usr/bin/java* symlinks to point to the 1.8 copies and then it worked.
Is there a way to retrieve the process description and publisher from a Windows Kernel crash dump?
I tried !process and !dml_proc. It doesn't show that information.
Description sould be get from exe module.
Example:
0: kd> !PROCESS fffffa800482f940 2
GetPointerFromAddress: unable to read from fffff80397f65000
PROCESS fffffa800482f940
SessionId: 1 Cid: 0e3c Peb: 7f7cfefa000 ParentCid: 04bc
DirBase: 26bcc000 ObjectTable: fffff8a0028f4e80 HandleCount: <Data Not Accessible>
Image: Taskmgr.exe
0: kd> .process /p fffffa800482f940
Implicit process is now fffffa80`0482f940
0: kd> .reload /user
Loading User Symbols
..........................................................
0: kd> lmvm Taskmgr
Browse full module list
start end module name
000007f7`d08c0000 000007f7`d09da000 taskmgr (deferred)
Image path: C:\Windows\system32\taskmgr.exe
Image name: taskmgr.exe
Browse all global symbols functions data
Timestamp: Thu Jul 26 02:07:18 2012 (50107C26)
CheckSum: 00119B41
ImageSize: 0011A000
File version: 6.2.9200.16384
Product version: 6.2.9200.16384
File flags: 0 (Mask 3F)
File OS: 40004 NT Win32
File type: 1.0 App
File date: 00000000.00000000
Translations: 0409.04b0
CompanyName: Microsoft Corporation
ProductName: Microsoft® Windows® Operating System
InternalName: Taskmgr.exe
OriginalFilename: Taskmgr.exe
ProductVersion: 6.2.9200.16384
FileVersion: 6.2.9200.16384 (win8_rtm.120725-1247)
FileDescription: Task Manager
LegalCopyright: © Microsoft Corporation. All rights reserved.
i was trying to edit and post clarification to pykd-teams answer but the edit turned out ot be substantial so posted this as an answer
FileDescription from lmvm output refers to description column in Task manager Details tab
Company Name Refers refers to publisher column in startup tab
C:\Windows\system32>wmic Startup where Caption="vmware user process" get /format:list
Caption=VMware User Process
Command="C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr
Description=VMware User Process
Location=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Name=VMware User Process
SettingID=
User=Public
UserSID=
C:\Windows\system32>reg query hklm\software\microsoft\windows\currentversion\run
HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run
VMware User Process REG_SZ "C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" -n vmusr
you can check by modifiying the FILE_VERSION_INFO in rsrc section of any file that is executed in startup see below an edited publisher in windbg of the same exe as posted above
how to check for validity of the above assertion
open a live kd session
run task manager in target and select a startup
look at details and locate the process name say vmtoolsd.exe
break into kd using ctrl+break
!process 0 0 vmtoolsd.exe
.process /p /r EPROCESS ADDRESS OF vmtoolsd.exe
!dh vmtoolsd find the Data directory SECURITY DIRECTORY and start searching for FILE_VERSION_INFO
loacte the string value of Company Name
use eb Address to edit the Company Name to some random string
execute using g
now execute task manager and you will see the publisher column in startup tab reflecting the random string as publisher
username is not tied to file but to process grab the token
from !process <Eproc> 1 and pass the TOKEN value to !token -n
here is sample script to retrieve user names for each running process
!for_each_process "r $t0=(##c++(((_EPROCESS*) ##Process )->Token.Object)&0xfffffff8);r? $t1=##c++(((_TOKEN*)##(#$t0))->LogonSession->AccountName);r? $t2=##c++(((_EPROCESS *) ##Process )->ImageFileName);.printf \"%mu\t\t\t%ma\\n\",##c++((wchar_t *)#$t1.Buffer),##c++((char*)#$t2)"
should get your results like this
kd> $$>a< getuname4proc.txt
xx-PC$ smss.exe
LOCAL SERVICE svchost.exe
xx taskhost.exe
You can get this information and a lot more by using !ps command from DbgKit.
Note: From a Kernel Memory Dump you can only get User Name. To get User Name, File Description and Company Name you need a Complete Memory Dump.
Copy dbgkit.dll into winext folder (For example: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\winext)
Open a dump file in WinDbg
Run .load dbgkit command
Run !ps command (to view other commands run !dbgkit.help)
I am trying to make a call to a method of a Windows COM interface from the Go language. I suspect I am doing something wrong in the way I invoke the call and would like to see how the registers change during the invocation.
But I have a hard time getting to it since I can't seem to set a breakpoint in WinDBG. The command "bu 64b6ea43" ends up not working with an error "Only part of a ReadProcessMemory or WriteProcessMemory request was completed". The full message is below.
Microsoft (R) Windows Debugger Version 6.2.8400.0 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: C:\Users\ccherng\Go\bin\error.exe
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path. *
* Use .symfix to have the debugger choose a symbol path. *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
ModLoad: 00400000 00971000 image00400000
Unable to insert breakpoint 1 at 64b6ea43, Win32 error 0n299
"Only part of a ReadProcessMemory or WriteProcessMemory request was completed."
bp1 at 64b6ea43 failed
WaitForEvent failed
eax=00415a7b ebx=7ffdd000 ecx=00000000 edx=00000000 esi=00000000 edi=00000000
eip=77b37098 esp=0006fff0 ebp=00000000 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000200
77b37098 89442404 mov dword ptr [esp+4],eax ss:0023:0006fff4=00000000
To me it was problem because of ASLR.
running editbin /DYNAMICBASE:NO NameOfDetectedExe.exe fixed it.
Switched to Ollydbg which works. Learned that WinDbg sucks badly.
Is it possible to get information about the host where a dump file was been created e.g., OS version, service pack, .NET framework version etc.
Also the vertarget command displays current version of the Microsoft Windows operating. system
OS version and so forth is listed automatically when you open the dump file.
You can get the .NET framework version using the !eeversion command.
0:000> !eeversion
2.0.50727.4952 free
Workstation mode
SOS Version: 2.0.50727.4952 retail build
To get additional information for loaded modules use the verbose option for lm. E.g.
0:000> lm vm mscoree
start end module name
000007fe`f0f10000 000007fe`f0f7f000 mscoree (deferred)
Image path: C:\Windows\System32\mscoree.dll
Image name: mscoree.dll
Timestamp: Fri Nov 06 06:09:26 2009 (4AF3AF86)
CheckSum: 00072187
ImageSize: 0006F000
File version: 4.0.31106.0
Product version: 4.0.31106.0
File flags: 8 (Mask 3F) Private
File OS: 4 Unknown Win32
File type: 2.0 Dll
File date: 00000000.00000000
Translations: 0409.04b0
CompanyName: Microsoft Corporation
ProductName: Microsoft® .NET Framework
InternalName: mscoree.dll
OriginalFilename: mscoree.dll
ProductVersion: 4.0.31106.0
FileVersion: 4.0.31106.0 (Main.031106-0000)
PrivateBuild: DDBLD278
FileDescription: Microsoft .NET Runtime Execution Engine
LegalCopyright: © Microsoft Corporation. All rights reserved.
Comments: Flavor=Retail