VS 2017 for Mac Error MSB3073 - c#

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

Related

Visual Studio 2017 during build exited with code 9009 : error code MSB3073

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)*.

Tasklist is not recognized as internal or external command

I have built an asp.net MVC application, which is working fine on IIS in the same machine where source project is laying. However I have to change some code in my source project but when I start my project in visual studio 2013, builds process runs and failed. It shows the following error.
1> 'tasklist' is not recognized as an internal or external command,
1> operable program or batch file.
1> C:\Program Files
(x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5):
error MSB3073: The command "tasklist /fi "imagename eq iisexpress.exe"
|find ":" > nul
1>C:\Program Files
(x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131,5):
error MSB3073: if errorlevel 1 taskkill /f /im "iisexpress.exe""
exited with code 255.
When I ran this command taskkill /f /im iisexpress.exe then no process is found message appear.
do you know what is causing this?
depending on the version of windows you are currently running, taskkill is indeed not included.
If you believe that taskkill is included, it is possible that your path is set incorrectly.
I had the same issue on a jenkins that I do not manage myself.
My solution was to adapt the path in the local shell
set PATH=%PATH%;C:\Windows\System32;
however, this was for a .bat file.
For c# i have no solution handy, but maybe this can point you in the right direction.

MSBuild exited with code 1 error

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.

Xamarin Studio Android App "aapt.exe" exited with code -1073741819 error MSB6006:

I just create a project and wanna build and run this in my Android phone.
Here is Normal detail of my project Output. I did not put space and dash in any of my file. while error error MSB6006: "aapt.exe" exited with code -1073741819.
Display
C:\Users\DeviceBee SAQE\AppData\Local\Android\android-sdk\build-tools\21.0.1\aapt.exe
package -f -m -M "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy
\AndroidManifest.xml" -J "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy"
--custom-package app1.app1 -F "C:\Users\DeviceBee SAQE\AppData\Local\Temp\mwyidlg1.uvy
\resources.apk.bk" -S obj\Debug\res -I "C:\Users\DeviceBee SAQE\AppData\Local\Android
\android-sdk\platforms\android-12\android.jar" --auto-add-overlay --max-res-version
12
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(783,2): error MSB6006: "aapt.exe" exited with code -1073741819.
Adding TechNote link - Remove SDK 24 using the Android SDK Manager is the solution as noted by #ali. Technote on this exact issue here - https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/ . Totally removing "24" from my machine cleared it. Just changing targets did not.
I have some problem ,after this, i read output error see this:
I:\Program Files\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe package -f -m -M obj\Debug\android\manifest\AndroidManifest.xml -J "C:\Users\Ali Visual Studio\AppData\Local\Temp\5q0cnsx0.m3e" --custom-package app3.app3 -F obj\Debug\android\bin\packaged_resources.bk -S obj\Debug\res -I "I:\Program Files\Android\android-sdk\platforms\android-10\android.jar" --auto-add-overlay --max-res-version 10 (TaskId:200)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1698,3): error MSB6006: "aapt.exe" exited with code -1073741819.
1>Done executing task "Aapt". (TaskId:200)
1>Task "Touch" (TaskId:201)
1> Task Parameter:Files=obj\Debug\android\bin\packaged_resources (TaskId:201)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1724,3): error MSB3375: The file "obj\Debug\android\bin\packaged_resources" does not exist.
1>Done executing task "Touch" -- FAILED. (TaskId:201)
1>Done building target "_CreateBaseApk" in project "App3.csproj" -- FAILED.: (TargetId:130)
Ok this line is my problem:
I:\Program Files\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe
go to your your android build-tools installed path and check your build-tools versions, you can update build-tools from Android SDK Manager or remove version if has error,
i have build-tools 23.0.1 and 23.0.2 and 24.0.0-preview (default build version is latest 24.0.0-preview)
i removed 24.0.0-preview folder and rebuild my project and it's works.

error debug visual studio Error "del ..\..\..\..\bin\Debug\Examples.Browser_*.zip >nul 2>&1" exited with code 1

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

Categories

Resources