My build runs fine creates the .zip packages but i get the All arguments must begin with "-" upon Release error in logs.
WHAT I DID SO FAR: I have created a .pubxml file it works but i think i am trying to pass the parameters wrong.
QUESTION: I saw that there is a way of creating seperate parameters.xml file in the root of the project but I dont understand how to do it and how it works. Any help would be appreciated.
UPDATE Just found out that the parameters.xml are being generated inside the .zip package But i still dont know how to assign them.
<PreSource Path="Url=http://Somepath/spath/pathh.svc; Domain=somedomain; Username=someusernam; Password=somepass;" includeData="False" />
Web Deploy parameters are useful when you have to create a package without knowing some of the values that will be needed when the package is installed
It seems that you want replace the Url in the web.config file.
Code:
<parameters>
<parameter name="DemoUrl" description="Please enter the name of the Environment" defaultvalue="_UrlValue_" tags="">
<parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/appSettings/add[@key='DemoUrl']/@value">
</parameterentry>
</parameter>
</parameters>
Create a .pubxml file to deploy. Then do a publish in your local VS. Check if there's a projectname.SetParameters.xml
file generated.
Check in the Parameters.xml
together with your project to TFS.
In TFS build, build your project to generate .zip packages.
In TFS release, add a Replace token step to replace the Url value in projectname.SetParameters.xml
file. Create a variable named 'DemoUrl' in release definition, and the value of this variable you enter in will replace 'UrlValue'.
For more information, you could refer to: http://andrew.lansdowne.me/2016/12/15/using-environment-variables-for-configuration-with-vsts-build-and-release/