I am getting following error when trying to build the solution.
Error The command "
copy "D:\Code\..\libs\xyz_ext.x64.dll" "D:\Code\bin\"
copy "D:\Code\..\libs\xyz.x86.dll" "D:\Code\bin\"
" exited with code 1. C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets 4714
MSBuild exited with code 1 error
First, just as nozzleman comment "is this the real command (including ..) from the post build event" If yes, this is the reason why you got this error. That because build events follow the same syntax as DOS commands, and DOS never supported wildcard * expansion and \..\ in the path by the shell. So you should specify the full path in the command line.
Besides, if you want to copy the file in all the subfolders of Code, you need some way using existing windows tools (cmd.exe), or powershell with wildcard *, for example, powershell:
This is code in the .ps1 file:
Get-ChildItem "D:\Code\*\libs" -Recurse -Include xyz_ext.x64.dll | Copy-Item -Destination D:\Code\bin
Then execute this PS script by post build event:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file D:\Code\Test.ps1
If \..\ is nor the real command from the post build event, just a shorthand expression. You should check the path of this command. According to the error log "code 1 error", it specify that this command is incorrect. And I have checked this command, the syntax of copy is correct, so the problem is the path is not incorrect, you should double check it.
Related
I am trying to build the visual studio code and I get the following build error.
I searched for answers regarding the same topic. I already tried adding nuget.exe to Path variable. But nothing seems to work.
This is my error in the error list
MSB3073 The command "nuget.exe push -Source Application_Internal -ApiKey VSTS C:Users\Documents\LOCAL_NUGET_FEED\App.Util.*.*0.0.0*.nupkg" exited with code 9009
The corresponding line from csconfig file is
<Exec Command="NuGet.exe push -Source Application_Internal -ApiKey VSTS $(LOCAL_NUGET_FEED)\$(AssemblyName)*.*$(Version)*.nupkg " />
Any help would be much appreciated.
code 9009 : error code MSB3073
Agree with Klaus, 9009 in this situation means the nuget.exe can't be found during the build process. It seems that you have a MSBuild Exec task used to execute the nuget push command.
For msbuild exec task, it actually will call something like cmd.exe to execute the command. So if one command failed in Exec task or post-build-event, most of the time it indicates the command would fail in cmd.exe.
I already tried adding nuget.exe to Path variable
You can open cmd.exe and type nuget, if it displays many switchs about nuget.exe, it means your path variable is set well. But if it shows 'nuget' is not recognized as an internal or external command, it means you didn't add path of nuget.exe to Path Variable successfully. And that's why you got the 9009 in VS.
I Tried it, still getting the same error.
If the same error you mean is 9009, please check content above in #2. If the same error you mean is MSB3073, you need to check the error code, still code 9009 or xxx?
If you simply type nuget in cmd.exe and display many switches, then your path is set well. And I think the code 9009 will go away in VS if you rebuild the project. But it doesn't mean the MSB3073 error would go away. Only if nothing is wrong in your command NuGet.exe push -Source Application_Internal -ApiKey VSTS $(LOCAL_NUGET_FEED)\$(AssemblyName)*.*$(Version)*.nupkg the MSB3073 error would disappear.
For this situation, I mean the nuget.exe can be found. But it may have error when nuget.exe executed the push command, maybe the package not found, source invalid or what.
Note:
1.MSB3073 just means something is wrong with the command. (Perhaps not only one error in the command)
2.code 9009 means the nuget.exe is not found
So you may get MSB3073 and exited code 1 or what even after the nuget.exe can be found. At least for App.Util.*.*0.0.0*.nupkg, I think the nuget.exe didn't find your package.
Suggestion:
Please set the verbosity to Detailed and check the detailed log about why the build failed.
Some possibilities about why you get the MSB3073 after the code 9009 error go away(Examples for code 1):
I think you may get this error message for the wrong use of wildcard $(AssemblyName)*.*$(Version)*.
When I tried to create dispatch-Model for my bot., I am getting following error - 'dispatch' is not recognized as an internal or external command, operable program or batch file.Before using dispatch command, I installed botdispatch using npm install -g botdispatch. But still I am getting this error.
Can you check your NPM folder to see if there is anything with dispatch there? Assuming you're on Windows, this is typically in AppData\Roaming\npm.
PowerShell:
dir $home\AppData\Roaming\npm
CMD:
dir %homepath%\AppData\Roaming\npm.
If dispatch (dispatch.cmd) is there, then it might be a pathing issue. Check your path variables to make sure that that path is there:
CMD:
echo %path%
PowerShell:
($env:path).Split(';')
So I was having this same issue, it turns out I needed to add the path of the NPM folder C:\Users\xxxxxx\AppData\Roaming\npm to my path for Powershell7.
$env:Path += ";C:\Users\xxxxxx\AppData\Roaming\npm"
Where xxxxxx is your userid. After adding this command to Powershell the npm modules began to work.
If you do not see this path by running this command below, then you need to add it with the one above.
($env:path).Split(';')
All of these should be ran inside of a PS7 window, I ran them with Administrator rights when I launched the Powershell 7 window.
I have a simple Android application wrote in c# and Xamarin. My purpose is to import this project into Android native application. I saw that Embeddinator-4000 can do the work and I installed it via Nuget, but unfortunately I can't find how to export an .aar file.
In project properties ->Build Events->Post Build Event command line I put this command:
set OUTPUT="$(SolutionDir)output"
if exist %OUTPUT% rmdir /S /Q %OUTPUT%
"$(SolutionDir)packages\Embeddinator-4000.0.3.0\tools\Embeddinator-4000.exe" "$(TargetPath)" --gen=Java --platform=Android --outdir=%OUTPUT% -c
After build I get the error:"The command exited with code 3"
After build I get the error:"The command exited with code 3"
As listed in this documentation, code 3 means the system cannot find the path specified.
Please check your path in the command.
when I build my project I have this error
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB3073: The command "xcopy "/Users/max/core/ExternalInterfaces/Betinaction.ExtTransactions/Betinaction.ExtTransactions/bin/Debug/*.dll" "/Users/max/core//../packages/BetInAction.Core.1.0.0/" /Y" exited with code 127. (MSB3073) (Betinaction.ExtTransactions)
and this error moves me to this line of code(this line is in Exec tag in code):
WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)"
this is the file where that line is:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets
You should carefully choose what commands to use on non-Windows platforms. One example can be found here,
https://github.com/lextm/obfuscar/blob/master/Console/Obfuscar.Console.csproj#L104
rename -> mv
del -> rm
In your case, xcopy -> cp
Information about how to use cp can be found here,
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/cp.1.html
I am trying to run a project and keep receiving this error message:
"del ..\..\..\..\bin\Debug\Examples.Browser_*.zip >nul 2>&1" exited with code 1
How to get rid of this error and get the project to work?
Error code 1 generally means that a pre-build or post-build command encountered an error, often related to an invalid path.
Assuming this is command is running as a pre/post-build command, ensure the path is correct. Consider using a macro to make the path relative to a well-known location, such as $(ProjectDir) or $(TargetDir). If a path can contain spaces, it should be quoted.
The following may work for you, depending on your exact directory structure
del "$(TargetDir)\Examples.Browser_*.zip" > null 2>&1