Im trying to post a http request to "new relic" by using the "Publish" button in Visual Studio.
In my publishing profile I choose "web deploy" and then finnish my setup. After that I'll go in to my ".pubxml"-file and add a target at the bottom:
<Target Name="AfterBuild">
<Exec Command="curl -H "x-api-key:mykey"
-d "deployment[application_id]=appId"
-d "deployment[description]=MSbuild deploy using curl"
-d "deployment[revision]=0"
-d "deployment[changelog]=Deployed using MSBuild"
-d "deployment[user]=User"
-d http://api.newrelic.com/deployments.xml"/>
</Target>
</project>
In the error list in visual studio I get this:
Severity Code Description Project File Line Suppression State Error The command
"curl
-H "x-api-key:APPKEY"
-d "deployment[application_id]=APPID"
-d "deployment[description]=MSbuild deploy using curl"
-d "deployment[revision]=1"
-d "deployment[changelog]=Deployed using MSBuild"
-d "deployment[user]=User"
http://api.newrelic.com/deployments.xml"
exited with code 9009
If I run the curl command in curl.exe it works (the post succeeds) but not during msbuild.
As you can see above there are quotes around everything accept the url, (have tried that also)
I have tried specifying the path to curl like this
"C:\WINDOWS\system32\curl.exe"
but that doesent work eather.
I have removed the "ItemGroup" since I dont want the web config to be included (Have set the buildaction to "none" on the web config)
What can I try?
Updated
<Target Name="AfterBuild"> and <Message Text="Test"/>..
This runns successfully but I cant see the text "Test" in the build output.
<Target Name="AfterBuild">
<Exec WorkingDirectory="C:\Windows\System32\" Command="curl http://www.google.com"/>
This returns error 9009.
Proof that its in the correct directory: