Error MSB3073 in postbuild event VS2013 - visual-studio-2013

In the process build of a huge enterprise C# VS2013 sometimes I get the error MSB3073 after the in the post build event. Unfortunately all the answers on this topic did not tackle exactly this problem.
The error message is the following:
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073: The command "#call "D:\TFS\SUV\Dev\2.2.28\DotNet\GUI\Allianz.Vita.Web.SUV\Allianz.Vita.Web.SUV.Post-Build.cmd" D:\TFS\SUV\Dev\2.2.28\DotNet\GUI\Allianz.Vita.Web.SUV\ " exited with code 1073750991.
I was not able to find a criterion to reproduce it sistematically, I only figured out it never happens if I run Clean before Rebuild. Setting verbosity of the MSBuild log to diagnostics did not give me any clue.
The last statement of the cmd file executed in the post build is "SUCCESS", which appears in the log.
Here is the log of a failed build
ERRORLEVEL = 0 (TaskId:2172)
SUCCESS ! (TaskId:2172) ==> end of Allianz.Vita.Web.SUV.Post-Build.cmd file
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4548,5): error MSB3073: The command "#call "D:\TFS\SUV\Dev\2.2.28\DotNet\GUI\Allianz.Vita.Web.SUV\Allianz.Vita.Web.SUV.Post-Build.cmd" D:\TFS\SUV\Dev\2.2.28\DotNet\GUI\Allianz.Vita.Web.SUV\ " exited with code 1073750991.
Done executing task "Exec" -- FAILED. (TaskId:2172)
Here is the log of a successful build:
ERRORLEVEL = 0 (TaskId:2172)
SUCCESS ! (TaskId:2172) ==> end of Allianz.Vita.Web.SUV.Post-Build.cmd file
Done executing task "Exec". (TaskId:2172)
Done building target "PostBuildEvent" in project "Allianz.Vita.Web.SUV.csproj".: (TargetId:3611)
Target "CoreBuild: (TargetId:3612)" in file "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets" from project "D:\TFS\SUV\Dev\2.2.28\DotNet\GUI\Allianz.Vita.Web.SUV\Allianz.Vita.Web.SUV.csproj" (target "Build" depends on it):
Done building target "CoreBuild" in project "Allianz.Vita.Web.SUV.csproj".: (TargetId:3612)
The error number 1073750991 looks more as a memory pointer that to a coded value. Does the couple of numbers Microsoft.Common.CurrentVersion.targets(4548,5) have a meaning ?
Sorry for the long description, I will be very grateful for any hint.
The cmd file in question basically does this:
nmake.exe %PROJECTDIR%\Allianz.Vita.Web.SUV.Post-Build.mak
echo ERRORLEVEL = %ERRORLEVEL%
and Allianz.Vita.Web.SUV.Post-Build.mak basically is a sequence of xcopy statements as
#xcopy /R /Y .....\FRAMEWORK\Deploy\Allianz.Framework.Security.dll.config .\Bin\
None of them reports (apparently) an error.

Related

How to load multiple html files by using wkhtmltopdf with other options in a batch file

I'm trying to combine multiple html files into one pdf file by using wkhtmltopdf(ver 0.12.6) in a batch file, besides there are some options need to work with.
Since the number of html files that I need may changes before running my batch file, I move all of them in a folder. Therefore my goal is to load all the html files in the folder, add some options I need, and call wkhtmltopdf to generate the pdf file.
Here's what I've done:
#echo off
setlocal
set TARGET=Result
:: go to the folder with lots of html files and one css file
cd .\myfolder
:: convert to a pdf file
wkhtmltopdf ^
--enable-local-file-access ^
--user-style-sheet %TARGET%_Report.css ^
(FOR %%A IN ("*.html") DO %%A) ^
%TARGET%_Report.pdf
cd..
pause
Sadly it can not work. I think the problem is I can not use FOR loop in this way, but I'm not sure how to fix it.
Here's the error message. Please give me some advise, thank you!
Loading pages (1/6)
Error: Failed to load http:/, with network status code 3 and http status code 0 - Host not found
Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed to load http:/, with network status code 3 and http status code 0 - Host not found
Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed to load http:/, with network status code 3 and http status code 0 - Host not found
Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed to load http:/, with network status code 3 and http status code 0 - Host not found
Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed to load http://in/, with network status code 3 and http status code 0 - Host in not found
Error: Failed loading page http://in (sometimes it will work just to ignore this error with --load-error-handling ignore)
Error: Failed to load http://do/, with network status code 3 and http status code 0 - Host do not found
Error: Failed loading page http://do (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: HostNotFoundError
Please try my code
echo on
for /f "delims=" %%a in ('dir /b /s "D:\source folder*.html"') do "directorywkhtmltopdf\bin\wkhtmltopdf.exe" [-s A4] "%%a" "D:\OUTPUT DIRECTORY\pdf%%~na.pdf"
pause
echo off
I try this code and it works
But the result on result.pdf you must go to the last page of your pdf documents to see the result.
I still confused about the result :D
perhaps any helps more

How to let pentaho spoon follow the hop 'follow when result false' from a windows batch file

I have an old script that does a number of things, renaming some files. But there error is that if there are no files, it just continues. So I added a hop that is followed on 'result false', and that is executed when there are no files there. This is the script, the first four lines are added by me:
IF NOT EXIST "${DATA_DIR}\*.*" (
ECHO NO FILES DOWNLOADED, ABORTING
ABORT
) ELSE (
IF EXIST "${DATA_DIR}\Bel_Main*.txt" (
RENAME "${DATA_DIR}\Bel_Main*.txt" Bel_Main.txt
)
IF EXIST "${DATA_DIR}\ParcomBE*.txt" (
RENAME "${DATA_DIR}\ParcomBE*.txt" ParcomBE.txt
)
IF EXIST "${DATA_DIR}\BalansBE*.txt" (
RENAME "${DATA_DIR}\BalansBE*.txt" BalansBE.txt
)
)
However, it seems to follow the 'abort path', just because it does not recognize the command 'ABORT'. This is the output:
2022/08/10 17:21:11 - rename files - (stdout) )
2022/08/10 17:21:11 - rename files - (stdout) NO FILES DOWNLOADED, ABORTING
2022/08/10 17:21:11 - rename files - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : (stderr) 'ABORT' is not recognized as an internal or external command,
2022/08/10 17:21:11 - rename files - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : (stderr) operable program or batch file.
2022/08/10 17:21:11 - DnB Data Preparation - Starting entry [Abort job]
2022/08/10 17:21:11 - Abort job - ERROR (version 7.1-SNAPSHOT, build 1 from 2017-08-23 17.37.41 by olbicoserviceuser) : Aborting job.
2022/08/10 17:21:11 - DnB Data Preparation - Finished job entry [Abort job] (result=[false])
2022/08/10 17:21:11 - DnB Data Preparation - Job execution finished
2022/08/10 17:21:11 - Spoon - Job has ended.
2022/08/10 17:21:47 - Spoon - Spoon
Now though it seems to work, I wonder if there is a cleverer way to let the 'false' hop to be chosen apart from just making it crash by an unknown command. I tried return false, false, set errorlevel. But I just cannot find the proper way.
'EXIT /B 1'
With the '1' indicating that the result of the batch file was false, so it hops to the 'red arrow' in spoon.

Postprocess drmemory error stacks with new symbols after process exits

After running a set of tests with drmemory overnight I am trying to resolve the error stacks by providing pdb symbols. The pdb's come from a large samba-mapped repository and using _NT_SYMBOL_PATH at runtime slowed things down too much.
Does anyone know of a tool that post-processes results.txt and pulls new symbols (via NT_SYMBOL_PATH or otherwise) as required to produce more detailed stacks ? If not, any hints for adapting asan_symbolize.py to do this ?
https://llvm.org/svn/llvm-project/compiler-rt/trunk/lib/asan/scripts/asan_symbolize.py
What I came up with so far using dbghelp.dll is below. Works but could be better.
https://github.com/patraulea/postpdb
ok this Query does not pertain to use of windbg or doesn't have anything to do with _NT_SYMBOL_PATH
Dr.Memory is a memory diagnostic tool akin to valgrind and is based on Dynamorio instumentation framework usable on raw unmodified binaries
on windows you can invoke it like drmemory.exe calc.exe from a command prompt (cmd.exe)
as soon as the binary finishes execution a log file named results.txt is written to a default location
if you had setup _NT_SYMBOL_PATH drmemory honors it and resolves symbol information from prepulled symbol file (viz *.pdb) it does not seem to download files from ms symbol server it simply seems to ignore the SRV* cache and seems to use only the downstream symbol folder
so if the pdb file is missing or isnt downloaded yet
the results.txt will contain stack trace like
# 6 USER32.dll!gapfnScSendMessage +0x1ce (0x75fdc4e7 <USER32.dll+0x1c4e7>)
# 7 USER32.dll!gapfnScSendMessage +0x2ce (0x75fdc5e7 <USER32.dll+0x1c5e7>)
while if the symbol file was available it would show
# 6 USER32.dll!InternalCallWinProc
# 7 USER32.dll!UserCallWinProcCheckWow
so basically you need the symbol file for appplication in question
so as i commented you need to fetch the symbols for the exe in question
you can use symchk on a running process too and create a manifest file
and you can use symchk on a machine that is connected to internet
to download symbols and copy it to a local folder on a non_internet machine
and point _NT_SYMBOL_PATH to this folder
>tlist | grep calc.exe
1772 calc.exe Calculator
>symchk /om calcsyms.txt /ip 1772
SYMCHK: GdiPlus.dll FAILED - MicrosoftWindowsGdiPlus-
1.1.7601.17514-gdiplus.pdb mismatched or not found
SYMCHK: FAILED files = 1
SYMCHK: PASSED + IGNORED files = 27
>head -n 4 calcsyms.txt
calc.pdb,971D2945E998438C847643A9DB39C88E2,1
calc.exe,4ce7979dc0000,1
ntdll.pdb,120028FA453F4CD5A6A404EC37396A582,1
ntdll.dll,4ce7b96e13c000,1
>tail -n 4 calcsyms.txt
CLBCatQ.pdb,00A720C79BAC402295B6EBDC147257182,1
clbcatq.dll,4a5bd9b183000,1
oleacc.pdb,67620D076A2E43C5A18ECD5AF77AADBE2,1
oleacc.dll,4a5bdac83c000,1
so assuming you have fetched the symbols it would be easier to rerun the tests with a locally cached copies of the symbol files
if you have fetched the symbols but you cannot rerun the tests and have to work solely with the output from results.txt you have some text processing work (sed . grep , awk . or custom parser)
the drmemory suite comes with a symbolquery.exe in the bin folder and it can be used to resolve the symbols from results.txt
in the example above you can notice the offset relative to modulebase like
0x1c4e7 in the line # 6 USER32.dll!gapfnScSendMessage +0x1ce (0x75fdc4e7 {USER32.dll+0x1c4e7})
so for each line in results.txt you have to parse out the offset and invoke symbolquery on the module like below
:\>symquery.exe -f -e c:\Windows\System32\user32.dll -a +0x1c4e7
InternalCallWinProc+0x23
??:0
:\>symquery.exe -f -e c:\Windows\System32\user32.dll -a +0x1c5e7
UserCallWinProcCheckWow+0xb3
a simple test processing example from a result.txt and a trimmed output
:\>grep "^#" results.txt | sed s/".*<"//g
# 0 system call NtUserBuildPropList parameter #2
USER32.dll+0x649d9>)
snip
COMCTL32.dll+0x2f443>)
notice the comctl32.dll (there is a default comctl.dll in system32.dll and several others in winsxs you have to consult the other files like global.log to view the dll load path
symquery.exe -f -e c:\Windows\winsxs\x86_microsoft.windows.common-
controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll -a +0x2f443
CallOriginalWndProc+0x1a
??:0
symquery.exe -f -e c:\Windows\system32\comctl32.dll -a +0x2f443
DrawInsert+0x120 <----- wrong symbol due to wrong module (late binding
/forwarded xxx yyy reasons)

Remove usb drive using cli, on success remove turn off the windows

I wondering to make a batch file that have purposed like this :
when a usb drive that ejected on my notebook is succesfully unmount, I want to make my windows is shutdown.
So, I use RemoveDrive.
Assumed, I mounted my flash drive to E, I use this command
RemoveDrive.exe E: -L
it gives me message like this :
Removing 'My drive'(E:)
success
Now, I was wondering to make a batch file (.bat), when success, it execute 'shutdown / s'. if failed, it gives me just a message error. How come ?
Amy help it so appreciated.
Edit :
based this web : FAQ
it said :
0 - successfully removed a device
1 - device identified but not removed
2 - device not found or parameters are invalid
4 - RemoveDrive.exe located on the drive to remove -> temporary copy
created and executed
so this is my code so far :
#ECHO OFF
set def="0"
SET /P uname=Enter the drive (letter:):
IF "%uname%"=="" GOTO Error
RemoveDrive.exe "%uname%" -L
if %ERRORLEVEL% == def
shutdwon /s
else
echo 'Something have problem'
GOTO End
:Error
ECHO Please enter your drive's name!
:End
if success or failed, it still gives me the syntax of command is inicnorrect message
As per if command syntax and explanation in Command-Line Reference:
if %ERRORLEVEL% == def (
shutdown /s
) else (
echo 'Something have problem'
)

Windows copy command return codes?

I would like to test for the success/failure of a copy in a batch file, but I can't find any documentation on what if any errorlevel codes are returned. For example
copy x y
if %errorlevel%. equ 1. (
echo Copy x y failed due to ...
exit /B
) else (
if %errorlevel% equ 2. (
echo Copy x y failed due to ...
exit /B
)
... etc ...
)
I'd opt for xcopy in this case since the error levels are documented (see xcopy documentation, paraphrased below):
Exit code Description
========= ===========
0 Files were copied without error.
1 No files were found to copy.
2 The user pressed CTRL+C to terminate xcopy.
4 Initialization error occurred. There is not
enough memory or disk space, or you entered
an invalid drive name or invalid syntax on
the command line.
5 Disk write error occurred.
In any case, xcopy is a far more powerful solution. The equivalent documentation for copy does not document the error levels.
As an aside, you may want to rethink your use of the %errorlevel% variable. It has unexpected results, at least in some versions of Windows, if someone has explicitly done something silly like:
set errorlevel=22
In those cases, the actual variable will be used rather than grabbing the actual error level. The "normal" way of doing this is (in decreasing order since errorlevel is a "greater than or equal to" check):
if errorlevel 2 (
echo Copy x y failed due to reason 2
exit /B
)
if errorlevel 1 (
echo Copy x y failed due to reason 1
exit /B
)
In addition, if you are running Win7 or Win Server 2008 or later, you should look into Robocopy, which is now the preferred mass-copy solution.
It might also be worth pointing out that xcopy doesn't always return the error code you expect.
For example when trying to copy multiple files with a wildcard but there are no files to copy you expect a return error code of 1 ("No files were found to copy"), but it actually returns 0 ("Files were copied without error")
C:\Users\wilson>mkdir bla
C:\Users\wilson>mkdir blert
C:\Users\wilson>xcopy bla\* blert\
0 File(s) copied
C:\Users\wilson>echo %ERRORLEVEL%
0
I believe Copy only returns 0 for success or 1 for failure.
XCopy has documented return codes:
0 = Files were copied without error.
1 = No files were found to copy.
2 = The user pressed CTRL+C to terminate xcopy.
4 = Initialization error occurred. There is not enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.
5 = Disk write error occurred.
There is also one point I would like to emphasize: xcopy as well as robocopy can only copy files, but they can't rename them.
While looking at the original situation (copy x y, which looks like a rename to me), I have the impression that the copy command still is the only one suitable for this purpose.
Error# Description
0 No error
1 Not owner
2 No such file or directory
3 Interrupted system call
4 I/O error
5 Bad file number
6 No more processes
7 Not enough core memory
8 Permission denied
9 Bad address
10 File exists
11 No such device
12 Not a directory
13 Is a directory
14 File table overflow
15 Too many open files
16 File too large
17 No space left on device
18 Directory not empty
999 Unmapped error (ABL default)

Categories

Resources